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.
sliding_cable_element_3D.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Klaus B. Sautter
11 //
12 //
13 //
14 
15 #if !defined(KRATOS_SLIDING_CABLE_ELEMENT_H_INCLUDED )
16 #define KRATOS_SLIDING_CABLE_ELEMENT_H_INCLUDED
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/element.h"
24 #include "includes/define.h"
26 
27 namespace Kratos
28 {
37  class KRATOS_API(CABLE_NET_APPLICATION) SlidingCableElement3D : public Element
38  {
39  protected:
40 
41  ConstitutiveLaw::Pointer mpConstitutiveLaw = nullptr;
42 
43  public:
45 
46 
47  typedef Element BaseType;
55  typedef BaseType::EquationIdVectorType EquationIdVectorType;
56  typedef BaseType::DofsVectorType DofsVectorType;
57 
58 
61  GeometryType::Pointer pGeometry);
63  GeometryType::Pointer pGeometry,
64  PropertiesType::Pointer pProperties);
65 
66 
67  ~SlidingCableElement3D() override;
68 
76  Element::Pointer Create(
77  IndexType NewId,
78  GeometryType::Pointer pGeom,
79  PropertiesType::Pointer pProperties
80  ) const override;
81 
89  Element::Pointer Create(
90  IndexType NewId,
91  NodesArrayType const& ThisNodes,
92  PropertiesType::Pointer pProperties
93  ) const override;
94 
95  void EquationIdVector(
96  EquationIdVectorType& rResult,
97  const ProcessInfo& rCurrentProcessInfo) const override;
98 
99  void GetDofList(
100  DofsVectorType& rElementalDofList,
101  const ProcessInfo& rCurrentProcessInfo) const override;
102 
103  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
104 
105  void CalculateLeftHandSide(
106  MatrixType& rLeftHandSideMatrix,
107  const ProcessInfo& rCurrentProcessInfo) override;
108 
109  void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix,
110  VectorType &rRightHandSideVector,
111  const ProcessInfo &rCurrentProcessInfo) override;
112 
113  void CalculateRightHandSide(VectorType &rRightHandSideVector,
114  const ProcessInfo &rCurrentProcessInfo) override;
115 
116  void GetValuesVector(Vector& rValues,int Step = 0) const override;
117  void GetSecondDerivativesVector(Vector& rValues, int Step = 0) const override;
118  void GetFirstDerivativesVector(Vector& rValues,int Step = 0) const override;
119 
120  Vector GetCurrentLengthArray(int Step = 0) const;
121  Vector GetRefLengthArray() const;
122  Vector GetDeltaPositions(const int& rDirection) const;
123  Vector GetDirectionVectorNt() const;
124  Vector GetInternalForces();
125 
126  Matrix ElasticStiffnessMatrix(const ProcessInfo& rCurrentProcessInfo) const;
127  Matrix GeometricStiffnessMatrix(const ProcessInfo& rCurrentProcessInfo) const;
128  inline Matrix TotalStiffnessMatrix(const ProcessInfo& rCurrentProcessInfo) const;
129 
130  double GetCurrentLength() const;
131  double GetRefLength() const;
132  double CalculateGreenLagrangeStrain() const;
133  inline double LinearStiffness() const
134  {
135  return (this->GetProperties()[CROSS_AREA] * this->GetProperties()[YOUNG_MODULUS] / this->GetRefLength());
136  };
137 
138  double GetPK2PrestressValue() const
139  {
140  // TODO move this to the cpp then the include of "structural_mechanics_application_variables.h" can be moved to the cpp tpp
141  double prestress = 0.00;
142  if (this->GetProperties().Has(TRUSS_PRESTRESS_PK2)) {
143  prestress = this->GetProperties()[TRUSS_PRESTRESS_PK2];
144  }
145  return prestress;
146  };
147 
148  void CalculateLumpedMassVector(
149  VectorType &rLumpedMassVector,
150  const ProcessInfo &rCurrentProcessInfo) const override;
151 
152  void CalculateMassMatrix(
153  MatrixType& rMassMatrix,
154  const ProcessInfo& rCurrentProcessInfo) override;
155 
156  void CalculateDampingMatrix(
157  MatrixType& rDampingMatrix,
158  const ProcessInfo& rCurrentProcessInfo) override;
159 
160 
161  void AddExplicitContribution(
162  const VectorType& rRHSVector,
163  const Variable<VectorType>& rRHSVariable,
164  const Variable<double >& rDestinationVariable,
165  const ProcessInfo& rCurrentProcessInfo
166  ) override;
167 
168  void AddExplicitContribution(const VectorType& rRHSVector,
169  const Variable<VectorType>& rRHSVariable,
170  const Variable<array_1d<double, 3> >& rDestinationVariable,
171  const ProcessInfo& rCurrentProcessInfo
172  ) override;
173 
174  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
175 
176 
177  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
178 
182  bool HasSelfWeight() const;
183 
187  Vector CalculateBodyForces();
188 
189  Vector GetCustomInternalForceWithFriction(const Vector& rNormalForces);
190 
191  Vector CalculateProjectionLengths();
192 
193  double ReturnTangentModulus1D(const ProcessInfo& rCurrentProcessInfo) const;
194 
195  private:
196 
197  // boolean for the cable --> does not resist to compression
198  bool mIsCompressed;
199 
200  friend class Serializer;
201  void save(Serializer& rSerializer) const override;
202  void load(Serializer& rSerializer) override;
203  };
204 
205 
206 }
207 
208 
209 #endif
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
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 sliding node element with 3 translational dofs per node.
Definition: sliding_cable_element_3D.hpp:38
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(SlidingCableElement3D)
BaseType::VectorType VectorType
Definition: sliding_cable_element_3D.hpp:54
SlidingCableElement3D()
Definition: sliding_cable_element_3D.hpp:59
BaseType::DofsVectorType DofsVectorType
Definition: sliding_cable_element_3D.hpp:56
Element BaseType
Definition: sliding_cable_element_3D.hpp:47
BaseType::MatrixType MatrixType
Definition: sliding_cable_element_3D.hpp:53
double GetPK2PrestressValue() const
Definition: sliding_cable_element_3D.hpp:138
BaseType::SizeType SizeType
Definition: sliding_cable_element_3D.hpp:52
BaseType::EquationIdVectorType EquationIdVectorType
Definition: sliding_cable_element_3D.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::PropertiesType PropertiesType
Definition: sliding_cable_element_3D.hpp:50
double LinearStiffness() const
Definition: sliding_cable_element_3D.hpp:133
BaseType::NodesArrayType NodesArrayType
Definition: sliding_cable_element_3D.hpp:49
BaseType::IndexType IndexType
Definition: sliding_cable_element_3D.hpp:51
BaseType::GeometryType GeometryType
Definition: sliding_cable_element_3D.hpp:48
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
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
std::size_t SizeType
Definition: nurbs_utilities.h:41
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