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.
geo_truss_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_TRUSS_ELEMENT_H_INCLUDED)
14 #define KRATOS_GEO_TRUSS_ELEMENT_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
22 
23 namespace Kratos
24 {
33 template <unsigned int TDim, unsigned int TNumNodes>
34 class KRATOS_API(GEO_MECHANICS_APPLICATION) GeoTrussElement : public GeoTrussElementBase<TDim, TNumNodes>
35 {
36 protected:
37  // const values
38  static constexpr int mStressVectorSize = 1;
39  Vector mInternalStresses = ZeroVector(mStressVectorSize);
40  Vector mInternalStressesFinalized = ZeroVector(mStressVectorSize);
41  Vector mInternalStressesFinalizedPrevious = ZeroVector(mStressVectorSize);
42 
43 public:
54 
56 
58 
60  GeoTrussElement(IndexType NewId, GeometryType::Pointer pGeometry);
61  GeoTrussElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
62 
63  ~GeoTrussElement() override;
64 
72  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override;
73 
81  Element::Pointer Create(IndexType NewId,
82  NodesArrayType const& ThisNodes,
83  PropertiesType::Pointer pProperties) const override;
84 
85  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
86 
91  void UpdateInternalForces(BoundedVector<double, TDim * TNumNodes>& rInternalForces,
92  const ProcessInfo& rCurrentProcessInfo) override;
93 
94  void CalculateOnIntegrationPoints(const Variable<Vector>& rVariable,
95  std::vector<Vector>& rOutput,
96  const ProcessInfo& rCurrentProcessInfo) override;
97 
99  std::vector<array_1d<double, 3>>& rOutput,
100  const ProcessInfo& rCurrentProcessInfo) override;
101 
102  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
103 
104  void ResetConstitutiveLaw() override;
105 
106 private:
107  friend class Serializer;
108 
109  void save(Serializer& rSerializer) const override
110  {
112  rSerializer.save("InternalStresses", mInternalStresses);
113  rSerializer.save("InternalStressesFinalized", mInternalStressesFinalized);
114  rSerializer.save("InternalStressesFinalizedPrevious", mInternalStressesFinalizedPrevious);
115  }
116 
117  void load(Serializer& rSerializer) override
118  {
119  KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, BaseType);
120  rSerializer.load("InternalStresses", mInternalStresses);
121  rSerializer.load("InternalStressesFinalized", mInternalStressesFinalized);
122  rSerializer.load("InternalStressesFinalizedPrevious", mInternalStressesFinalizedPrevious);
123  }
124 };
125 
126 } // namespace Kratos
127 
128 #endif
std::size_t SizeType
Definition: element.h:94
std::size_t IndexType
Definition: element.h:92
This is a 2D-2node truss element with 2 translational dofs per node.
Definition: geo_truss_element_base.hpp:37
This is a 2node truss element with reset-displacement.
Definition: geo_truss_element.hpp:35
Element::MatrixType MatrixType
Definition: geo_truss_element.hpp:50
GeoTrussElement()
Definition: geo_truss_element.hpp:59
GeoTrussElementBase< TDim, TNumNodes >::FullDofMatrixType FullDofMatrixType
Definition: geo_truss_element.hpp:52
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(GeoTrussElement)
Element::PropertiesType PropertiesType
Definition: geo_truss_element.hpp:47
GeoTrussElementBase< TDim, TNumNodes >::FullDofVectorType FullDofVectorType
Definition: geo_truss_element.hpp:53
Element::GeometryType GeometryType
Definition: geo_truss_element.hpp:45
Element::VectorType VectorType
Definition: geo_truss_element.hpp:51
Element::NodesArrayType NodesArrayType
Definition: geo_truss_element.hpp:46
GeoTrussElementBase< TDim, TNumNodes > BaseType
Definition: geo_truss_element.hpp:44
Element::SizeType SizeType
Definition: geo_truss_element.hpp:49
Element::IndexType IndexType
Definition: geo_truss_element.hpp:48
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
Geometry base class.
Definition: geometry.h:71
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
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#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
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
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307