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.
load_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 // Main authors: Tobias Teschemacher
11 //
12 
13 #if !defined(KRATOS_LOAD_CONDITION_H_INCLUDED )
14 #define KRATOS_LOAD_CONDITION_H_INCLUDED
15 
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
23 
24 #include "includes/condition.h"
25 
26 namespace Kratos
27 {
29  /*
30  * @brief This condition use the geometrical information, which
31  * is provided from the respective geometry. The respective
32  * loads are set to the data container.
33  */
35  : public Condition
36  {
37  public:
40 
43 
45  typedef std::size_t SizeType;
46  typedef std::size_t IndexType;
47 
49  typedef typename GeometryType::Pointer GeometryPointerType;
50 
54 
57  IndexType NewId,
58  GeometryType::Pointer pGeometry)
59  : Condition(NewId, pGeometry)
60  {};
61 
64  IndexType NewId,
65  GeometryType::Pointer pGeometry,
66  PropertiesType::Pointer pProperties)
67  : Condition(NewId, pGeometry, pProperties)
68  {};
69 
72  {};
73 
75  virtual ~LoadCondition() override
76  {};
77 
81 
83  Condition::Pointer Create(
84  IndexType NewId,
85  GeometryType::Pointer pGeom,
86  PropertiesType::Pointer pProperties
87  ) const override
88  {
89  return Kratos::make_intrusive<LoadCondition>(
90  NewId, pGeom, pProperties);
91  };
92 
94  Condition::Pointer Create(
95  IndexType NewId,
96  NodesArrayType const& ThisNodes,
97  PropertiesType::Pointer pProperties
98  ) const override
99  {
100  return Kratos::make_intrusive< LoadCondition >(
101  NewId, GetGeometry().Create(ThisNodes), pProperties);
102  };
103 
107 
115  VectorType& rRightHandSideVector,
116  const ProcessInfo& rCurrentProcessInfo) override
117  {
118  MatrixType left_hand_side_matrix = Matrix(0, 0);
119 
120  CalculateAll(left_hand_side_matrix, rRightHandSideVector,
121  rCurrentProcessInfo, false, true);
122  }
123 
131  MatrixType& rLeftHandSideMatrix,
132  const ProcessInfo& rCurrentProcessInfo) override
133  {
134  VectorType right_hand_side_vector = Vector(0);
135 
136  CalculateAll(rLeftHandSideMatrix, right_hand_side_vector,
137  rCurrentProcessInfo, true, false);
138  }
139 
149  MatrixType& rLeftHandSideMatrix,
150  VectorType& rRightHandSideVector,
151  const ProcessInfo& rCurrentProcessInfo) override
152  {
153  CalculateAll(rLeftHandSideMatrix, rRightHandSideVector,
154  rCurrentProcessInfo, true, true);
155  }
156 
162  void EquationIdVector(
163  EquationIdVectorType& rResult,
164  const ProcessInfo& rCurrentProcessInfo
165  ) const override;
166 
172  void GetDofList(
173  DofsVectorType& rElementalDofList,
174  const ProcessInfo& rCurrentProcessInfo
175  ) const override;
176 
185  void CalculateAll(
186  MatrixType& rLeftHandSideMatrix,
187  VectorType& rRightHandSideVector,
188  const ProcessInfo& rCurrentProcessInfo,
189  const bool CalculateStiffnessMatrixFlag,
190  const bool CalculateResidualVectorFlag
191  );
192 
194  const GeometryType& rGeometry,
195  Vector& rDeterminantOfJacobian);
196 
200 
202  std::string Info() const override
203  {
204  std::stringstream buffer;
205  buffer << "\"LoadCondition\" #" << Id();
206  return buffer.str();
207  }
208 
210  void PrintInfo(std::ostream& rOStream) const override
211  {
212  rOStream << "\"LoadCondition\" #" << Id();
213  }
214 
216  void PrintData(std::ostream& rOStream) const override
217  {
218  pGetGeometry()->PrintData(rOStream);
219  }
220 
222 
223  private:
226 
227  friend class Serializer;
228 
229  virtual void save(Serializer& rSerializer) const override
230  {
232  }
233 
234  virtual void load(Serializer& rSerializer) override
235  {
237  }
238 
240 
241  }; // Class LoadCondition
242 
243 } // namespace Kratos.
244 
245 #endif // KRATOS_LOAD_CONDITION_H_INCLUDED defined
Base class for all Conditions.
Definition: condition.h:59
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
Matrix MatrixType
Definition: condition.h:90
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
std::size_t IndexType
Definition: flags.h:74
GeometryType::Pointer pGetGeometry()
Returns the pointer to the geometry.
Definition: geometrical_object.h:140
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
IndexType Id() const
Definition: indexed_object.h:107
Condition for basic load types.
Definition: load_condition.h:36
Geometry< Node > GeometryType
Definition: load_condition.h:48
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the condition right hand side matr...
Definition: load_condition.h:114
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the condition left hand side matri...
Definition: load_condition.h:130
GeometryType::Pointer GeometryPointerType
Definition: load_condition.h:49
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: load_condition.h:216
Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Create with Id, pointer to geometry and pointer to property.
Definition: load_condition.h:83
std::size_t IndexType
Definition: load_condition.h:46
LoadCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor with Id, geometry and property.
Definition: load_condition.h:63
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create with Id, pointer to geometry and pointer to property.
Definition: load_condition.h:94
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Sets on rConditionDofList the degrees of freedom of the considered element geometry.
Definition: load_condition.cpp:280
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(LoadCondition)
Counted pointer definition of LoadCondition.
LoadCondition()
Default constructor.
Definition: load_condition.h:71
std::string Info() const override
Turn back information as a string.
Definition: load_condition.h:202
virtual ~LoadCondition() override
Destructor.
Definition: load_condition.h:75
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
This function provides a more general interface to the element.
Definition: load_condition.h:148
LoadCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor with Id and geometry.
Definition: load_condition.h:56
std::size_t SizeType
Size types.
Definition: load_condition.h:45
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: load_condition.h:210
void DeterminantOfJacobianInitial(const GeometryType &rGeometry, Vector &rDeterminantOfJacobian)
Definition: load_condition.cpp:228
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Sets on rResult the ID's of the element degrees of freedom.
Definition: load_condition.cpp:260
void CalculateAll(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo, const bool CalculateStiffnessMatrixFlag, const bool CalculateResidualVectorFlag)
Definition: load_condition.cpp:23
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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
def load(f)
Definition: ode_solve.py:307