KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
adjoint_finite_difference_small_displacement_element.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Armin Geiser, https://github.com/armingeiser
10 // Daniel Baumgaertner, https://github.com/dbaumgaertner
11 //
12 
13 
14 #pragma once
15 
17 
18 namespace Kratos
19 {
20 
21 
27 template <typename TPrimalElement>
29 {
30 public:
31 
34 
35  // redefine the typedefs because of templated base class
37  typedef typename BaseType::SizeType SizeType;
38  typedef typename BaseType::IndexType IndexType;
40  typedef typename BaseType::NodeType NodeType;
43  typedef typename BaseType::VectorType VectorType;
44  typedef typename BaseType::MatrixType MatrixType;
50 
52 
54  : BaseType(NewId, false)
55  {
56  }
57 
58  AdjointFiniteDifferencingSmallDisplacementElement(IndexType NewId, typename GeometryType::Pointer pGeometry)
59  : BaseType(NewId, pGeometry, false)
60  {
61  }
62 
64  typename GeometryType::Pointer pGeometry,
65  typename PropertiesType::Pointer pProperties)
66  : BaseType(NewId, pGeometry, pProperties, false)
67  {
68  }
69 
74  void CalculateStressDisplacementDerivative(const Variable<Vector>& rStressVariable,
75  Matrix& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
76 
77  Element::Pointer Create(IndexType NewId,
78  NodesArrayType const& ThisNodes,
79  typename PropertiesType::Pointer pProperties) const override
80  {
81  return Kratos::make_intrusive<AdjointFiniteDifferencingSmallDisplacementElement<TPrimalElement>>(
82  NewId, this->GetGeometry().Create(ThisNodes), pProperties);
83  }
84 
85  Element::Pointer Create(IndexType NewId,
86  typename GeometryType::Pointer pGeometry,
87  typename PropertiesType::Pointer pProperties) const override
88  {
89  return Kratos::make_intrusive<AdjointFiniteDifferencingSmallDisplacementElement<TPrimalElement>>(
90  NewId, pGeometry, pProperties);
91  }
92 
93  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
94 
95 private:
96 
97  friend class Serializer;
98  void save(Serializer& rSerializer) const override;
99  void load(Serializer& rSerializer) override;
100 };
101 
102 
103 }
AdjointFiniteDifferencingBaseElement.
Definition: adjoint_finite_difference_base_element.h:54
AdjointFiniteDifferencingSmallDisplacementElement.
Definition: adjoint_finite_difference_small_displacement_element.h:29
BaseType::VectorType VectorType
Definition: adjoint_finite_difference_small_displacement_element.h:43
BaseType::SizeType SizeType
Definition: adjoint_finite_difference_small_displacement_element.h:37
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: adjoint_finite_difference_small_displacement_element.cpp:143
BaseType::PropertiesType PropertiesType
Definition: adjoint_finite_difference_small_displacement_element.h:41
BaseType::GeometryType GeometryType
Definition: adjoint_finite_difference_small_displacement_element.h:39
AdjointFiniteDifferencingSmallDisplacementElement(IndexType NewId, typename GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Definition: adjoint_finite_difference_small_displacement_element.h:63
BaseType::IndexType IndexType
Definition: adjoint_finite_difference_small_displacement_element.h:38
AdjointFiniteDifferencingSmallDisplacementElement(IndexType NewId=0)
Definition: adjoint_finite_difference_small_displacement_element.h:53
BaseType::GeometryDataType GeometryDataType
Definition: adjoint_finite_difference_small_displacement_element.h:49
AdjointFiniteDifferencingBaseElement< TPrimalElement > BaseType
Definition: adjoint_finite_difference_small_displacement_element.h:36
Element::Pointer Create(IndexType NewId, typename GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: adjoint_finite_difference_small_displacement_element.h:85
BaseType::DofsArrayType DofsArrayType
Definition: adjoint_finite_difference_small_displacement_element.h:47
BaseType::NodesArrayType NodesArrayType
Definition: adjoint_finite_difference_small_displacement_element.h:42
BaseType::MatrixType MatrixType
Definition: adjoint_finite_difference_small_displacement_element.h:44
BaseType::EquationIdVectorType EquationIdVectorType
Definition: adjoint_finite_difference_small_displacement_element.h:45
BaseType::IntegrationMethod IntegrationMethod
Definition: adjoint_finite_difference_small_displacement_element.h:48
void CalculateStressDisplacementDerivative(const Variable< Vector > &rStressVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_small_displacement_element.cpp:25
BaseType::DofsVectorType DofsVectorType
Definition: adjoint_finite_difference_small_displacement_element.h:46
BaseType::NodeType NodeType
Definition: adjoint_finite_difference_small_displacement_element.h:40
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(AdjointFiniteDifferencingSmallDisplacementElement)
AdjointFiniteDifferencingSmallDisplacementElement(IndexType NewId, typename GeometryType::Pointer pGeometry)
Definition: adjoint_finite_difference_small_displacement_element.h:58
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: adjoint_finite_difference_small_displacement_element.h:77
GeometryData::IntegrationMethod IntegrationMethod
Type definition for integration methods.
Definition: element.h:105
Vector VectorType
Definition: element.h:88
PointerVectorSet< DofType > DofsArrayType
Definition: element.h:102
std::size_t SizeType
Definition: element.h:94
Properties PropertiesType
Definition: element.h:80
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: element.h:86
GeometryData GeometryDataType
Definition: element.h:107
Matrix MatrixType
Definition: element.h:90
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
std::size_t IndexType
Defines the index type.
Definition: geometrical_object.h:73
Geometry base class.
Definition: geometry.h:71
virtual Pointer Create(PointsArrayType const &rThisPoints) const
Creates a new geometry pointer.
Definition: geometry.h:813
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307