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.
spring_damper_element.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: Quirin Aumann,
10 // Aron Noordam
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/element.h"
21 
22 namespace Kratos
23 {
38 
40 template<std::size_t TDim>
41 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) SpringDamperElement
42  : public Element
43 {
44 public:
45 
51 
52 public:
53 
56 
58  SpringDamperElement(IndexType NewId, GeometryType::Pointer pGeometry);
59 
60  SpringDamperElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
61 
64 
66  ~SpringDamperElement() override;
67 
71 
74 
78 
86  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
87 
95  Element::Pointer Create(
96  IndexType NewId,
97  GeometryType::Pointer pGeom,
98  PropertiesType::Pointer pProperties
99  ) const override;
100 
108  Element::Pointer Clone(IndexType NewId, NodesArrayType const& ThisNodes) const override;
109 
110  //************* GETTING METHODS
111 
115  void GetDofList(DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
116 
120  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
121 
125  void GetValuesVector(Vector& rValues, int Step = 0) const override;
126 
130  void GetFirstDerivativesVector(Vector& rValues, int Step = 0) const override;
131 
135  void GetSecondDerivativesVector(Vector& rValues, int Step = 0) const override;
136 
137 
138  //************* COMPUTING METHODS
139 
149  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
150  VectorType& rRightHandSideVector,
151  const ProcessInfo& rCurrentProcessInfo) override;
152 
153 
161  void CalculateRightHandSide( VectorType& rRightHandSideVector,
162  const ProcessInfo& rCurrentProcessInfo) override;
163 
171  void CalculateLeftHandSide( MatrixType& rLeftHandSideMatrix,
172  const ProcessInfo& rCurrentProcessInfo) override;
173 
180  void CalculateMassMatrix(MatrixType& rMassMatrix,
181  const ProcessInfo& rCurrentProcessInfo) override;
182 
189  void CalculateDampingMatrix(MatrixType& rDampingMatrix,
190  const ProcessInfo& rCurrentProcessInfo) override;
191 
199  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
200 
214 
215 protected:
218 
219  static constexpr unsigned int msNumNodes = 2;
220  static constexpr unsigned int msLocalSize = (TDim == 2) ? 3 : (TDim == 3) ? 6 : 0;
221  static constexpr unsigned int msElementSize = msLocalSize * msNumNodes;
222 
226 
231  {
232  }
233 
247 
248 private:
249 
261 
262  void ConstCalculateDampingMatrix(MatrixType& rDampingMatrix) const;
263 
264  void ConstCalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector) const;
265 
266  void ConstCalculateLeftHandSide(MatrixType& rLeftHandSideMatrix) const;
267 
268  void ConstCalculateRightHandSide(VectorType& rRightHandSideVector) const;
269 
270 
278  friend class Serializer;
279 
280  // A private default constructor necessary for serialization
281 
282  void save(Serializer& rSerializer) const override;
283 
284  void load(Serializer& rSerializer) override;
285 
286 
293 
294 }; // Class SpringDamperElement
295 
303 
304 } // namespace Kratos.
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
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
Concentrated nodal for 3D and 2D points.
Definition: spring_damper_element.hpp:43
SpringDamperElement()
Definition: spring_damper_element.hpp:230
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(SpringDamperElement)
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307