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_linear_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_LINEAR_TRUSS_ELEMENT_H_INCLUDED)
14 #define KRATOS_GEO_LINEAR_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) GeoLinearTrussElement
35  : public GeoTrussElementLinearBase<TDim, TNumNodes>
36 {
37 protected:
38  // const values
39  static constexpr int mStressVectorSize = 1;
40  Vector mInternalStresses = ZeroVector(mStressVectorSize);
41  Vector mInternalStressesFinalized = ZeroVector(mStressVectorSize);
42  Vector mInternalStressesFinalizedPrevious = ZeroVector(mStressVectorSize);
43 
44 public:
46 
57 
59 
61  GeoLinearTrussElement(IndexType NewId, GeometryType::Pointer pGeometry);
62  GeoLinearTrussElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
63 
64  ~GeoLinearTrussElement() override;
65 
73  Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override;
74 
82  Element::Pointer Create(IndexType NewId,
83  NodesArrayType const& ThisNodes,
84  PropertiesType::Pointer pProperties) const override;
85 
86  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
87 
92  void UpdateInternalForces(FullDofVectorType& rInternalForces, const ProcessInfo& rCurrentProcessInfo) override;
93 
95  std::vector<array_1d<double, 3>>& rOutput,
96  const ProcessInfo& rCurrentProcessInfo) override;
97 
98  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
99 
100  void ResetConstitutiveLaw() override;
101 
102 private:
103  friend class Serializer;
104 
105  void save(Serializer& rSerializer) const override
106  {
108  rSerializer.save("InternalStresses", mInternalStresses);
109  rSerializer.save("InternalStressesFinalized", mInternalStressesFinalized);
110  rSerializer.save("InternalStressesFinalizedPrevious", mInternalStressesFinalizedPrevious);
111  }
112 
113  void load(Serializer& rSerializer) override
114  {
115  KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, BaseType);
116  rSerializer.load("InternalStresses", mInternalStresses);
117  rSerializer.load("InternalStressesFinalized", mInternalStressesFinalized);
118  rSerializer.load("InternalStressesFinalizedPrevious", mInternalStressesFinalizedPrevious);
119  }
120 };
121 } // namespace Kratos
122 
123 #endif
Vector VectorType
Definition: element.h:88
std::size_t SizeType
Definition: element.h:94
Properties PropertiesType
Definition: element.h:80
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: element.h:86
Matrix MatrixType
Definition: element.h:90
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: element.h:83
std::size_t IndexType
Definition: element.h:92
std::size_t IndexType
Definition: flags.h:74
This is a linear truss element.
Definition: geo_linear_truss_element.hpp:36
GeoLinearTrussElement()
Definition: geo_linear_truss_element.hpp:60
typename GeoTrussElementBase< TDim, TNumNodes >::FullDofVectorType FullDofVectorType
Definition: geo_linear_truss_element.hpp:56
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(GeoLinearTrussElement)
typename GeoTrussElementBase< TDim, TNumNodes >::FullDofMatrixType FullDofMatrixType
Definition: geo_linear_truss_element.hpp:55
This is a 2D-2node truss element with 2 translational dofs per node.
Definition: geo_truss_element_base.hpp:37
This is a linear truss element inheriting from GeoTrussElementBase.
Definition: geo_linear_truss_element_base.hpp:39
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