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_potential_wall_condition.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 Nuñez, based on A. Geiser, M. Fusseder, I. Lopez and R. Rossi work
12 //
13 
14 #ifndef KRATOS_ADJOINT_POTENTIAL_WALL_CONDITION_H
15 #define KRATOS_ADJOINT_POTENTIAL_WALL_CONDITION_H
16 
17 namespace Kratos
18 {
19 
20 
21 template <class TPrimalCondition>
22 class KRATOS_API(COMPRESSIBLE_POTENTIAL_FLOW_APPLICATION) AdjointPotentialWallCondition : public Condition
23 {
24 public:
27 
28  static constexpr int TNumNodes = TPrimalCondition::NumNodes;
29  static constexpr int TDim = TPrimalCondition::Dim;
30 
33 
34  typedef Element::WeakPointer ElementWeakPointerType;
35 
36  typedef Element::Pointer ElementPointerType;
37 
39  : Condition(NewId),
40  mpPrimalCondition(Kratos::make_intrusive<TPrimalCondition>(NewId, pGetGeometry()))
41  {
42  }
43 
44  AdjointPotentialWallCondition(IndexType NewId, GeometryType::Pointer pGeometry)
45  : Condition(NewId, pGeometry),
46  mpPrimalCondition(Kratos::make_intrusive<TPrimalCondition>(NewId, pGeometry))
47  {
48  }
49 
51  GeometryType::Pointer pGeometry,
52  PropertiesType::Pointer pProperties)
53  : Condition(NewId, pGeometry, pProperties),
54  mpPrimalCondition(Kratos::make_intrusive<TPrimalCondition>(NewId, pGeometry, pProperties))
55  {
56  }
57 
60 
62  {
63  Condition::operator=(rOther);
64  return *this;
65  }
66 
67 
68  Condition::Pointer Create(IndexType NewId,
69  NodesArrayType const& ThisNodes,
70  PropertiesType::Pointer pProperties) const override;
71 
72  Condition::Pointer Create(IndexType NewId,
73  Condition::GeometryType::Pointer pGeom,
74  PropertiesType::Pointer pProperties) const override;
75 
76  Condition::Pointer Clone(IndexType NewId, NodesArrayType const& rThisNodes) const override;
77 
78  // Find the condition's parent element.
79  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
80 
81  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
82 
83 
84  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix,
85  const ProcessInfo& rCurrentProcessInfo) override;
86 
87  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
88  VectorType& rRightHandSideVector,
89  const ProcessInfo& rCurrentProcessInfo) override;
90 
91  void EquationIdVector(EquationIdVectorType& rResult,
92  const ProcessInfo& rCurrentProcessInfo) const override;
93 
94  void GetDofList(DofsVectorType& ConditionDofList, const ProcessInfo& CurrentProcessInfo) const override;
95 
96  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
97 
98  void FinalizeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
99 
100  void GetValuesVector(Vector& rValues, int Step=0) const override;
101 
102  void CalculateSensitivityMatrix(const Variable<double>& rDesignVariable,
103  Matrix& rOutput,
104  const ProcessInfo& rCurrentProcessInfo) override;
105 
106  void CalculateSensitivityMatrix(const Variable<array_1d<double,3> >& rDesignVariable,
107  Matrix& rOutput,
108  const ProcessInfo& rCurrentProcessInfo) override;
109 
110  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
111 
112  std::string Info() const override;
113 
115  void PrintInfo(std::ostream& rOStream) const override;
116 
118  void PrintData(std::ostream& rOStream) const override;
119 
120 
121 protected:
122 
123  Condition::Pointer mpPrimalCondition;
124 
125 
126 private:
127 
131 
132  friend class Serializer;
133 
134  void save(Serializer& rSerializer) const override;
135 
136  void load(Serializer& rSerializer) override;
137 
138 
139 
140 }; // Class AdjointPotentialWallCondition
141 
143 
145 template <class TPrimalCondition>
146 inline std::istream& operator>>(std::istream& rIStream,
148 {
149  return rIStream;
150 }
151 
153 template <class TPrimalCondition>
154 inline std::ostream& operator<<(std::ostream& rOStream,
156 {
157  rThis.PrintInfo(rOStream);
158  rOStream << std::endl;
159  rThis.PrintData(rOStream);
160 
161  return rOStream;
162 }
163 
165 
167 
168 } // namespace Kratos.
169 
170 #endif // KRATOS_POTENTIAL_WALL_CONDITION_H
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Definition: adjoint_potential_wall_condition.h:23
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(AdjointPotentialWallCondition)
Pointer definition of AdjointPotentialWallCondition.
Condition::Pointer mpPrimalCondition
Definition: adjoint_potential_wall_condition.h:123
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: adjoint_potential_wall_condition.cpp:207
AdjointPotentialWallCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: adjoint_potential_wall_condition.h:50
AdjointPotentialWallCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: adjoint_potential_wall_condition.h:44
Element::Pointer ElementPointerType
Definition: adjoint_potential_wall_condition.h:36
~AdjointPotentialWallCondition() override
Destructor.
Definition: adjoint_potential_wall_condition.h:59
AdjointPotentialWallCondition(IndexType NewId=0)
Definition: adjoint_potential_wall_condition.h:38
AdjointPotentialWallCondition & operator=(AdjointPotentialWallCondition const &rOther)
Definition: adjoint_potential_wall_condition.h:61
Element::WeakPointer ElementWeakPointerType
Definition: adjoint_potential_wall_condition.h:34
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: adjoint_potential_wall_condition.cpp:214
Base class for all Conditions.
Definition: condition.h:59
Condition & operator=(Condition const &rOther)
Assignment operator.
Definition: condition.h:181
std::size_t IndexType
Definition: flags.h:74
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
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
intrusive_ptr< C > make_intrusive(Args &&...args)
Definition: smart_pointers.h:36
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
def load(f)
Definition: ode_solve.py:307