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_spring_damper_element_3D2N.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: Martin Fusseder, https://github.com/MFusseder
10 //
11 
12 #pragma once
13 
15 
16 namespace Kratos
17 {
18 
25 template <typename TPrimalElement>
27 {
28 public:
29 
30  // redefine the typedefs because of templated base class
32  typedef typename BaseType::SizeType SizeType;
33  typedef typename BaseType::IndexType IndexType;
35  typedef typename BaseType::NodeType NodeType;
38  typedef typename BaseType::VectorType VectorType;
39  typedef typename BaseType::MatrixType MatrixType;
45 
47 
49  : BaseType(NewId, true)
50  {
51  }
52 
53  AdjointFiniteDifferenceSpringDamperElement(IndexType NewId, typename GeometryType::Pointer pGeometry)
54  : BaseType(NewId, pGeometry, true)
55  {
56  }
57 
59  typename GeometryType::Pointer pGeometry,
60  typename PropertiesType::Pointer pProperties)
61  : BaseType(NewId, pGeometry, pProperties, true)
62  {
63  }
64 
65  Element::Pointer Create(IndexType NewId,
66  NodesArrayType const& ThisNodes,
67  typename PropertiesType::Pointer pProperties) const override
68  {
69  return Kratos::make_intrusive<AdjointFiniteDifferenceSpringDamperElement<TPrimalElement>>(
70  NewId, this->GetGeometry().Create(ThisNodes), pProperties);
71  }
72 
73  Element::Pointer Create(IndexType NewId,
74  typename GeometryType::Pointer pGeometry,
75  typename PropertiesType::Pointer pProperties) const override
76  {
77  return Kratos::make_intrusive<AdjointFiniteDifferenceSpringDamperElement<TPrimalElement>>(
78  NewId, pGeometry, pProperties);
79  }
80 
81  void CalculateSensitivityMatrix(const Variable<double>& rDesignVariable, Matrix& rOutput,
82  const ProcessInfo& rCurrentProcessInfo) override;
83 
84  void CalculateSensitivityMatrix(const Variable<array_1d<double,3>>& rDesignVariable, Matrix& rOutput,
85  const ProcessInfo& rCurrentProcessInfo) override;
86 
87  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
88 
89 private:
90  friend class Serializer;
91  void save(Serializer& rSerializer) const override;
92  void load(Serializer& rSerializer) override;
93 };
94 
95 
96 }
AdjointFiniteDifferenceSpringDamperElement.
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:27
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: adjoint_finite_difference_spring_damper_element_3D2N.cpp:97
BaseType::IndexType IndexType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:33
BaseType::NodesArrayType NodesArrayType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:37
AdjointFiniteDifferencingBaseElement< TPrimalElement > BaseType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:31
AdjointFiniteDifferenceSpringDamperElement(IndexType NewId, typename GeometryType::Pointer pGeometry)
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:53
BaseType::DofsVectorType DofsVectorType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:41
BaseType::NodeType NodeType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:35
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(AdjointFiniteDifferenceSpringDamperElement)
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:65
AdjointFiniteDifferenceSpringDamperElement(IndexType NewId, typename GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:58
void CalculateSensitivityMatrix(const Variable< double > &rDesignVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_spring_damper_element_3D2N.cpp:22
BaseType::EquationIdVectorType EquationIdVectorType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:40
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_spring_damper_element_3D2N.h:73
BaseType::PropertiesType PropertiesType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:36
BaseType::GeometryDataType GeometryDataType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:44
BaseType::GeometryType GeometryType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:34
BaseType::VectorType VectorType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:38
BaseType::DofsArrayType DofsArrayType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:42
BaseType::MatrixType MatrixType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:39
AdjointFiniteDifferenceSpringDamperElement(IndexType NewId=0)
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:48
BaseType::SizeType SizeType
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:32
BaseType::IntegrationMethod IntegrationMethod
Definition: adjoint_finite_difference_spring_damper_element_3D2N.h:43
AdjointFiniteDifferencingBaseElement.
Definition: adjoint_finite_difference_base_element.h:54
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307