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_potential_flow_element.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 //
11 // Main authors: Marc Nunez, based on A. Geiser, M. Fusseder, I. Lopez and R. Rossi work
12 //
13 
14 #if !defined(KRATOS_ADJOINT_FINITE_DIFFERENCE_POTENTIAL_FLOW_ELEMENT_H_INCLUDED )
15 #define KRATOS_ADJOINT_FINITE_DIFFERENCE_POTENTIAL_FLOW_ELEMENT_H_INCLUDED
16 
17 
18 // Project includes
20 
21 namespace Kratos
22 {
23 
24 template <class TPrimalElement>
26 {
27 public:
28 
31 
33  using BaseType::NumNodes;
34  using BaseType::Dim;
38 
43 
47 
52  : AdjointBasePotentialFlowElement<TPrimalElement>(NewId){};
53 
55  typename GeometryType::Pointer pGeometry)
56  : AdjointBasePotentialFlowElement<TPrimalElement>(NewId, pGeometry){};
57 
59  typename GeometryType::Pointer pGeometry,
60  typename PropertiesType::Pointer pProperties)
61  : AdjointBasePotentialFlowElement<TPrimalElement>(NewId, pGeometry, pProperties){};
66 
71 
75 
78  {
79  BaseType::operator=(rOther);
80  Flags::operator =(rOther);
81  return *this;
82  }
83 
87 
88  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, typename PropertiesType::Pointer pProperties) const override;
89 
90  Element::Pointer Create(IndexType NewId, typename GeometryType::Pointer pGeom, typename PropertiesType::Pointer pProperties) const override;
91 
92  Element::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override;
93 
94  void CalculateSensitivityMatrix(const Variable<array_1d<double,3> >& rDesignVariable,
95  Matrix& rOutput,
96  const ProcessInfo& rCurrentProcessInfo) override;
97 
98  void CalculateSensitivityMatrix(const Variable<double>& rDesignVariable,
99  Matrix& rOutput,
100  const ProcessInfo& rCurrentProcessInfo) override;
101 
102  std::string Info() const override;
103 
104  void PrintInfo(std::ostream& rOStream) const override;
105 
106 
107 protected:
108 
109 private:
110 
111  double GetPerturbationSize();
112 
113  friend class Serializer;
114 
115  void save(Serializer& rSerializer) const override;
116 
117  void load(Serializer& rSerializer) override;
118 
119 }; // Class AdjointFiniteDifferencePotentialFlowElement
120 
121 
122 } // namespace Kratos.
123 
124 #endif
Definition: adjoint_base_potential_flow_element.h:26
AdjointBasePotentialFlowElement & operator=(AdjointBasePotentialFlowElement const &rOther)
Assignment operator.
Definition: adjoint_base_potential_flow_element.h:82
static constexpr int NumNodes
Definition: adjoint_base_potential_flow_element.h:33
static constexpr int Dim
Definition: adjoint_base_potential_flow_element.h:34
Definition: adjoint_finite_difference_potential_flow_element.h:26
~AdjointFiniteDifferencePotentialFlowElement() override
Definition: adjoint_finite_difference_potential_flow_element.h:70
AdjointFiniteDifferencePotentialFlowElement(IndexType NewId, typename GeometryType::Pointer pGeometry, typename PropertiesType::Pointer pProperties)
Definition: adjoint_finite_difference_potential_flow_element.h:58
BaseType::PropertiesType PropertiesType
Definition: adjoint_finite_difference_potential_flow_element.h:36
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: adjoint_finite_difference_potential_flow_element.cpp:163
std::string Info() const override
Turn back information as a string.
Definition: adjoint_finite_difference_potential_flow_element.cpp:155
AdjointFiniteDifferencePotentialFlowElement(IndexType NewId=0)
Definition: adjoint_finite_difference_potential_flow_element.h:51
BaseType::NodesArrayType NodesArrayType
Definition: adjoint_finite_difference_potential_flow_element.h:37
void CalculateSensitivityMatrix(const Variable< array_1d< double, 3 > > &rDesignVariable, Matrix &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: adjoint_finite_difference_potential_flow_element.cpp:50
AdjointFiniteDifferencePotentialFlowElement(AdjointFiniteDifferencePotentialFlowElement const &rOther)
Definition: adjoint_finite_difference_potential_flow_element.h:65
Element::Pointer Clone(IndexType NewId, NodesArrayType const &ThisNodes) const override
It creates a new element pointer and clones the previous element data.
Definition: adjoint_finite_difference_potential_flow_element.cpp:41
BaseType::GeometryType GeometryType
Definition: adjoint_finite_difference_potential_flow_element.h:35
AdjointFiniteDifferencePotentialFlowElement(IndexType NewId, typename GeometryType::Pointer pGeometry)
Definition: adjoint_finite_difference_potential_flow_element.h:54
AdjointFiniteDifferencePotentialFlowElement & operator=(AdjointFiniteDifferencePotentialFlowElement const &rOther)
Assignment operator.
Definition: adjoint_finite_difference_potential_flow_element.h:77
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, typename PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: adjoint_finite_difference_potential_flow_element.cpp:25
AdjointBasePotentialFlowElement< TPrimalElement > BaseType
Definition: adjoint_finite_difference_potential_flow_element.h:32
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(AdjointFiniteDifferencePotentialFlowElement)
Properties PropertiesType
Definition: element.h:80
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: element.h:86
std::size_t IndexType
Definition: flags.h:74
Flags & operator=(Flags const &rOther)
Assignment operator.
Definition: flags.h:151
Geometry base class.
Definition: geometry.h:71
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
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307