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.
truss_element_3D2N.hpp
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Klaus B. Sautter
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/element.h"
20 #include "includes/define.h"
21 #include "includes/variables.h"
22 
23 namespace Kratos
24 {
33  class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) TrussElement3D2N : public Element
34  {
35  protected:
36  //const values
37  static constexpr int msNumberOfNodes = 2;
38  static constexpr int msDimension = 3;
39  static constexpr unsigned int msLocalSize = msNumberOfNodes * msDimension;
40  ConstitutiveLaw::Pointer mpConstitutiveLaw = nullptr;
41 
42  public:
44 
45 
46  typedef Element BaseType;
54  typedef BaseType::EquationIdVectorType EquationIdVectorType;
55  typedef BaseType::DofsVectorType DofsVectorType;
56 
57 
60  GeometryType::Pointer pGeometry);
62  GeometryType::Pointer pGeometry,
63  PropertiesType::Pointer pProperties);
64 
65 
66  ~TrussElement3D2N() override;
67 
75  Element::Pointer Create(
76  IndexType NewId,
77  GeometryType::Pointer pGeom,
78  PropertiesType::Pointer pProperties
79  ) const override;
80 
88  Element::Pointer Create(
89  IndexType NewId,
90  NodesArrayType const& ThisNodes,
91  PropertiesType::Pointer pProperties
92  ) const override;
93 
94  void EquationIdVector(
95  EquationIdVectorType& rResult,
96  const ProcessInfo& rCurrentProcessInfo) const override;
97 
98  void GetDofList(
99  DofsVectorType& rElementalDofList,
100  const ProcessInfo& rCurrentProcessInfo) const override;
101 
102  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
103 
108  CreateElementStiffnessMatrix(const ProcessInfo& rCurrentProcessInfo);
109 
110  void Calculate(const Variable<Matrix>& rVariable, Matrix& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
111 
112  void Calculate(const Variable<double>& rVariable, double& rOutput, const ProcessInfo& rCurrentProcessInfo) override;
113 
115  const Variable<double>& rVariable,
116  std::vector<double>& rOutput,
117  const ProcessInfo& rCurrentProcessInfo) override;
118 
120  const Variable<array_1d<double, 3 > >& rVariable,
121  std::vector< array_1d<double, 3 > >& rOutput,
122  const ProcessInfo& rCurrentProcessInfo) override;
123 
125  const Variable<Vector>& rVariable,
126  std::vector<Vector>& rOutput,
127  const ProcessInfo& rCurrentProcessInfo) override;
128 
133  virtual void UpdateInternalForces(BoundedVector<double,msLocalSize>& rInternalForces, const ProcessInfo& rCurrentProcessInfo);
134 
139  void CreateTransformationMatrix(BoundedMatrix<double,msLocalSize,msLocalSize>& rRotationMatrix);
140 
141 
142  void CalculateLocalSystem(
143  MatrixType& rLeftHandSideMatrix,
144  VectorType& rRightHandSideVector,
145  const ProcessInfo& rCurrentProcessInfo) override;
146 
147 
148  void CalculateRightHandSide(
149  VectorType& rRightHandSideVector,
150  const ProcessInfo& rCurrentProcessInfo) override;
151 
152  void CalculateLeftHandSide(
153  MatrixType& rLeftHandSideMatrix,
154  const ProcessInfo& rCurrentProcessInfo) override;
155 
156  void CalculateMassMatrix(
157  MatrixType& rMassMatrix,
158  const ProcessInfo& rCurrentProcessInfo) override;
159 
160  void CalculateConsistentMassMatrix(
161  MatrixType& rMassMatrix,
162  const ProcessInfo& rCurrentProcessInfo) const;
163 
164  void CalculateDampingMatrix(
165  MatrixType& rDampingMatrix,
166  const ProcessInfo& rCurrentProcessInfo) override;
167 
168 
178  void AddExplicitContribution(
179  const VectorType& rRHSVector,
180  const Variable<VectorType>& rRHSVariable,
181  const Variable<double >& rDestinationVariable,
182  const ProcessInfo& rCurrentProcessInfo
183  ) override;
184 
194  void AddExplicitContribution(const VectorType& rRHSVector,
195  const Variable<VectorType>& rRHSVariable,
196  const Variable<array_1d<double, 3> >& rDestinationVariable,
197  const ProcessInfo& rCurrentProcessInfo
198  ) override;
199 
200 
201  void GetValuesVector(
202  Vector& rValues,
203  int Step = 0) const override;
204 
205  void GetSecondDerivativesVector(
206  Vector& rValues,
207  int Step = 0) const override;
208 
209  void GetFirstDerivativesVector(
210  Vector& rValues,
211  int Step = 0) const override;
212 
213  int Check(
214  const ProcessInfo& rCurrentProcessInfo) const override;
215 
219  double CalculateGreenLagrangeStrain()const;
220 
224  BoundedVector<double,msLocalSize> CalculateBodyForces();
225 
231  void CalculateGeometricStiffnessMatrix(BoundedMatrix<double,msLocalSize,msLocalSize>& rGeometricStiffnessMatrix,
232  const ProcessInfo& rCurrentProcessInfo);
233 
239  void CalculateElasticStiffnessMatrix(BoundedMatrix<double,msLocalSize,msLocalSize>& rElasticStiffnessMatrix,
240  const ProcessInfo& rCurrentProcessInfo);
241 
246  virtual void WriteTransformationCoordinates(
247  BoundedVector<double,msLocalSize>& rReferenceCoordinates);
248 
249  double ReturnTangentModulus1D(const ProcessInfo& rCurrentProcessInfo);
250 
251  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
252 
256  bool HasSelfWeight() const;
257 
258  const Parameters GetSpecifications() const override;
259 
260 private:
265  void CalculateLumpedMassVector(
266  VectorType& rMassVector,
267  const ProcessInfo& rCurrentProcessInfo) const override;
268 
269  friend class Serializer;
270  void save(Serializer& rSerializer) const override;
271  void load(Serializer& rSerializer) override;
272  };
273 
274 
275 }
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Defines the index type.
Definition: geometrical_object.h:73
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
This is a 3D-2node truss element with 3 translational dofs per node.
Definition: truss_element_3D2N.hpp:34
BaseType::EquationIdVectorType EquationIdVectorType
Definition: truss_element_3D2N.hpp:54
BaseType::IndexType IndexType
Definition: truss_element_3D2N.hpp:50
BaseType::GeometryType GeometryType
Definition: truss_element_3D2N.hpp:47
BaseType::MatrixType MatrixType
Definition: truss_element_3D2N.hpp:52
BaseType::PropertiesType PropertiesType
Definition: truss_element_3D2N.hpp:49
BaseType::DofsVectorType DofsVectorType
Definition: truss_element_3D2N.hpp:55
void AddExplicitContribution(const VectorType &rRHSVector, const Variable< VectorType > &rRHSVariable, const Variable< array_1d< double, 3 > > &rDestinationVariable, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to make the element to assemble an rRHS vector identified by a variable rRH...
BaseType::NodesArrayType NodesArrayType
Definition: truss_element_3D2N.hpp:48
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 3 > > &rVariable, std::vector< array_1d< double, 3 > > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
BaseType::VectorType VectorType
Definition: truss_element_3D2N.hpp:53
Element BaseType
Definition: truss_element_3D2N.hpp:46
BaseType::SizeType SizeType
Definition: truss_element_3D2N.hpp:51
TrussElement3D2N()
Definition: truss_element_3D2N.hpp:58
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(TrussElement3D2N)
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
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
std::size_t SizeType
Definition: nurbs_utilities.h:41
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
TDataType Calculate(GeometryType &dummy, const Variable< TDataType > &rVariable)
Definition: add_geometries_to_python.cpp:103
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Properties PropertiesType
Definition: regenerate_pfem_pressure_conditions_process.h:26
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307