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.
U_Pw_updated_lagrangian_element.hpp
Go to the documentation of this file.
1 // KRATOS___
2 // // ) )
3 // // ___ ___
4 // // ____ //___) ) // ) )
5 // // / / // // / /
6 // ((____/ / ((____ ((___/ / MECHANICS
7 //
8 // License: geo_mechanics_application/license.txt
9 //
10 // Main authors: Vahid Galavi
11 //
12 
13 #if !defined(KRATOS_GEO_U_PW_UPDATED_LAGRANGIAN_ELEMENT_H_INCLUDED)
14 #define KRATOS_GEO_U_PW_UPDATED_LAGRANGIAN_ELEMENT_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
22 #include "custom_elements/U_Pw_small_strain_element.hpp"
23 #include "custom_utilities/element_utilities.hpp"
26 
27 namespace Kratos
28 {
37 
41 
45 
53 template <unsigned int TDim, unsigned int TNumNodes>
54 class KRATOS_API(GEO_MECHANICS_APPLICATION) UPwUpdatedLagrangianElement
55  : public UPwSmallStrainElement<TDim, TNumNodes>
56 {
57 public:
60  using IndexType = std::size_t;
62  using NodeType = Node;
65  using VectorType = Vector;
66  using MatrixType = Matrix;
67 
70 
72  using SizeType = std::size_t;
79 
82 
85 
87 
89  UPwUpdatedLagrangianElement(IndexType NewId = 0) : UPwSmallStrainElement<TDim, TNumNodes>(NewId)
90  {
91  }
92 
95  : UPwSmallStrainElement<TDim, TNumNodes>(NewId, ThisNodes)
96  {
97  }
98 
100  UPwUpdatedLagrangianElement(IndexType NewId, GeometryType::Pointer pGeometry)
101  : UPwSmallStrainElement<TDim, TNumNodes>(NewId, pGeometry)
102  {
103  }
104 
106  UPwUpdatedLagrangianElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
107  : UPwSmallStrainElement<TDim, TNumNodes>(NewId, pGeometry, pProperties)
108  {
109  }
110 
113 
114  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
115 
123  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override;
124 
132  Element::Pointer Create(IndexType NewId,
133  NodesArrayType const& ThisNodes,
134  PropertiesType::Pointer pProperties) const override;
135 
142  void CalculateOnIntegrationPoints(const Variable<double>& rVariable,
143  std::vector<double>& rOutput,
144  const ProcessInfo& rCurrentProcessInfo) override;
145 
152  void CalculateOnIntegrationPoints(const Variable<Matrix>& rVariable,
153  std::vector<Matrix>& rOutput,
154  const ProcessInfo& rCurrentProcessInfo) override;
155 
159 
166 
168  std::string Info() const override
169  {
170  std::stringstream buffer;
171  buffer << "Updated Lagrangian U-Pw Element #" << this->Id()
172  << "\nConstitutive law: " << mConstitutiveLawVector[0]->Info();
173  return buffer.str();
174  }
175 
177  void PrintInfo(std::ostream& rOStream) const override
178  {
179  rOStream << "Updated Lagrangian U-Pw Element #" << this->Id()
180  << "\nConstitutive law: " << mConstitutiveLawVector[0]->Info();
181  }
182 
184  void PrintData(std::ostream& rOStream) const override
185  {
186  this->pGetGeometry()->PrintData(rOStream);
187  }
188 
193 
194 protected:
197 
201 
205 
214  void CalculateAll(MatrixType& rLeftHandSideMatrix,
215  VectorType& rRightHandSideVector,
216  const ProcessInfo& rCurrentProcessInfo,
217  const bool CalculateStiffnessMatrixFlag,
218  const bool CalculateResidualVectorFlag) override;
219 
233 
234 private:
237 
241 
245 
246  // Copy constructor
248 
252 
257 
261  friend class Serializer;
262 
263  // A private default constructor necessary for serialization
264 
265  void save(Serializer& rSerializer) const override
266  {
269  }
270 
271  void load(Serializer& rSerializer) override
272  {
275  }
276 
283  // UPwUpdatedLagrangianElement& operator=(const UPwUpdatedLagrangianElement& rOther);
285  // UPwUpdatedLagrangianElement(const UPwUpdatedLagrangianElement& rOther);
287 
288 }; // Class UPwUpdatedLagrangianElement
289 
297 
298 } // namespace Kratos.
299 #endif // KRATOS_GEO_U_PW_UPDATED_LAGRANGIAN_ELEMENT_H_INCLUDED defined
std::size_t SizeType
Definition: element.h:94
std::size_t IndexType
Definition: flags.h:74
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
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
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Definition: U_Pw_base_element.hpp:36
Definition: U_Pw_small_strain_element.hpp:30
Updated Lagrangian element for 2D and 3D geometries.
Definition: U_Pw_updated_lagrangian_element.hpp:56
typename UPwSmallStrainElement< TDim, TNumNodes >::ElementVariables ElementVariables
Definition: U_Pw_updated_lagrangian_element.hpp:80
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: U_Pw_updated_lagrangian_element.hpp:177
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: U_Pw_updated_lagrangian_element.hpp:184
UPwUpdatedLagrangianElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor using Properties.
Definition: U_Pw_updated_lagrangian_element.hpp:106
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(UPwUpdatedLagrangianElement)
Counted pointer of UPwUpdatedLagrangianElement.
UPwUpdatedLagrangianElement(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using Geometry.
Definition: U_Pw_updated_lagrangian_element.hpp:100
UPwUpdatedLagrangianElement(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: U_Pw_updated_lagrangian_element.hpp:94
~UPwUpdatedLagrangianElement() override
Destructor.
Definition: U_Pw_updated_lagrangian_element.hpp:112
std::string Info() const override
Turn back information as a string.
Definition: U_Pw_updated_lagrangian_element.hpp:168
UPwUpdatedLagrangianElement(IndexType NewId=0)
Default Constructor.
Definition: U_Pw_updated_lagrangian_element.hpp:89
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
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
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
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
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
BaseClass
Definition: altair_cube_mesher.py:3
def load(f)
Definition: ode_solve.py:307
Definition: U_Pw_small_strain_element.hpp:128