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.
small_displacement_interface_element.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: Ignasi de Pouplana
11 // Lorenzo Gracia
12 //
13 
14 
15 #if !defined(KRATOS_SMALL_DISPLACEMENT_INTERFACE_ELEMENT_H_INCLUDED )
16 #define KRATOS_SMALL_DISPLACEMENT_INTERFACE_ELEMENT_H_INCLUDED
17 
18 // Project includes
19 #include "containers/array_1d.h"
20 #include "includes/define.h"
21 #include "includes/element.h"
22 #include "includes/serializer.h"
23 #include "geometries/geometry.h"
24 #include "utilities/math_utils.h"
26 
27 // Application includes
29 #include "custom_utilities/interface_element_utilities.hpp"
30 
33 
34 namespace Kratos
35 {
36 
37 template< unsigned int TDim, unsigned int TNumNodes >
39 {
40 
41 public:
42 
44 
45 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
46 
47  // Default constructor
49 
50  // Constructor 1
51  SmallDisplacementInterfaceElement(IndexType NewId, GeometryType::Pointer pGeometry) : Element( NewId, pGeometry ) {}
52 
53  // Constructor 2
54  SmallDisplacementInterfaceElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) : Element( NewId, pGeometry, pProperties )
55  {
56  // Lobatto integration method with the integration points located at the "mid plane nodes" of the interface
58  }
59 
60  // Destructor
62 
63 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
64 
65  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
66 
67  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
68 
69  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
70 
71  void GetDofList(DofsVectorType& rElementalDofList, const ProcessInfo& rCurrentProcessInfo) const override;
72 
73 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
74 
75  void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override;
76 
77  void CalculateDampingMatrix(MatrixType& rDampingMatrix, const ProcessInfo& rCurrentProcessInfo) override;
78 
79  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
80 
81  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
82 
83  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix, const ProcessInfo& rCurrentProcessInfo) override;
84 
85  void CalculateRightHandSide(VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
86 
87  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
88 
89  void GetValuesVector(Vector& rValues, int Step = 0) const override;
90 
91  void GetFirstDerivativesVector(Vector& rValues, int Step = 0) const override;
92 
93  void GetSecondDerivativesVector(Vector& rValues, int Step = 0) const override;
94 
95 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
96 
97  void SetValuesOnIntegrationPoints(const Variable<double>& rVariable,
98  const std::vector<double>& rValues,
99  const ProcessInfo& rCurrentProcessInfo) override;
100 
102  std::vector<array_1d<double,3>>& rOutput,
103  const ProcessInfo& rCurrentProcessInfo) override;
104 
105 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
106 
107 protected:
108 
110  {
111  //Properties variable
112  double Density;
113 
114  //Nodal variables;
117 
118  //General elemental variables
121 
122  //Variables computed at each GP
123 
124  //Constitutive Law parameters
131  double detF;
132  //Auxiliary Variables
136  double JointWidth;
141  };
142 
143  // Member Variables
145  std::vector<ConstitutiveLaw::Pointer> mConstitutiveLawVector;
146  std::vector<double> mInitialGap;
147 
148 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
149 
151 
152  void ExtrapolateGPJointWidth (const std::vector<double>& JointWidthContainer);
153 
154  void CalculateStiffnessMatrix( MatrixType& rStiffnessMatrix, const ProcessInfo& CurrentProcessInfo );
155 
156  void CalculateAll( MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo );
157 
158  void CalculateRHS( VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo );
159 
160  void InitializeElementVariables(ElementVariables& rVariables,ConstitutiveLaw::Parameters& rConstitutiveParameters,
161  const GeometryType& Geom, const PropertiesType& Prop, const ProcessInfo& CurrentProcessInfo);
162 
164 
165  void CalculateJointWidth(double& rJointWidth,const double& NormalRelDisp,const double& InitialJointWidth,const unsigned int& GPoint);
166 
167  void CheckAndCalculateJointWidth(double& rJointWidth,ConstitutiveLaw::Parameters& rConstitutiveParameters,
168  double& rNormalRelDisp,const double& InitialJointWidth,const unsigned int& GPoint);
169 
170  void CalculateIntegrationCoefficient(double& rIntegrationCoefficient, const double& weight, const double& detJ);
171 
172  void CalculateAndAddLHS(MatrixType& rLeftHandSideMatrix, ElementVariables& rVariables);
173 
174  void CalculateAndAddStiffnessMatrix(MatrixType& rLeftHandSideMatrix, ElementVariables& rVariables);
175 
176  void CalculateAndAddRHS(VectorType& rRightHandSideVector, ElementVariables& rVariables);
177 
178  void CalculateAndAddStiffnessForce(VectorType& rRightHandSideVector, ElementVariables& rVariables);
179 
180  void CalculateAndAddMixBodyForce(VectorType& rRightHandSideVector, ElementVariables& rVariables);
181 
182  void CalculateOutputDoubles( std::vector<double>& rOutput, const std::vector<double>& GPValues );
183 
184  template< class TValueType >
185  void CalculateOutputValues( std::vector<TValueType>& rOutput, const std::vector<TValueType>& GPValues );
186 
187 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
188 
189 private:
190 
191  // Serialization
192 
193  friend class Serializer;
194 
195  void save(Serializer& rSerializer) const override
196  {
198  }
199 
200  void load(Serializer& rSerializer) override
201  {
203  }
204 
205 
206 }; // Class SmallDisplacementInterfaceElement
207 
208 } // namespace Kratos
209 
210 #endif // KRATOS_SMALL_DISPLACEMENT_INTERFACE_ELEMENT_H_INCLUDED defined
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
Matrix MatrixType
Definition: element.h:90
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
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
Definition: small_displacement_interface_element.hpp:39
SmallDisplacementInterfaceElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: small_displacement_interface_element.hpp:54
void CalculateInitialGap(const GeometryType &Geom)
void CalculateOnIntegrationPoints(const Variable< array_1d< double, 3 >> &rVariable, std::vector< array_1d< double, 3 >> &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:587
void SetValuesOnIntegrationPoints(const Variable< double > &rVariable, const std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:576
virtual ~SmallDisplacementInterfaceElement()
Definition: small_displacement_interface_element.hpp:61
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(SmallDisplacementInterfaceElement)
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:406
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:157
void CalculateJointWidth(double &rJointWidth, const double &NormalRelDisp, const double &InitialJointWidth, const unsigned int &GPoint)
Definition: small_displacement_interface_element.cpp:1245
void GetValuesVector(Vector &rValues, int Step=0) const override
Definition: small_displacement_interface_element.cpp:509
std::vector< double > mInitialGap
Definition: small_displacement_interface_element.hpp:146
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Definition: small_displacement_interface_element.cpp:61
void CalculateStiffnessMatrix(MatrixType &rStiffnessMatrix, const ProcessInfo &CurrentProcessInfo)
Definition: small_displacement_interface_element.cpp:868
std::vector< ConstitutiveLaw::Pointer > mConstitutiveLawVector
Definition: small_displacement_interface_element.hpp:145
void InitializeElementVariables(ElementVariables &rVariables, ConstitutiveLaw::Parameters &rConstitutiveParameters, const GeometryType &Geom, const PropertiesType &Prop, const ProcessInfo &CurrentProcessInfo)
Definition: small_displacement_interface_element.cpp:1058
void CalculateAndAddLHS(MatrixType &rLeftHandSideMatrix, ElementVariables &rVariables)
Definition: small_displacement_interface_element.cpp:1302
void CalculateAndAddStiffnessMatrix(MatrixType &rLeftHandSideMatrix, ElementVariables &rVariables)
Definition: small_displacement_interface_element.cpp:1310
void CalculateOutputDoubles(std::vector< double > &rOutput, const std::vector< double > &GPValues)
void CalculateOutputValues(std::vector< TValueType > &rOutput, const std::vector< TValueType > &GPValues)
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:381
void Initialize(const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:30
void CalculateAndAddRHS(VectorType &rRightHandSideVector, ElementVariables &rVariables)
Definition: small_displacement_interface_element.cpp:1326
void GetFirstDerivativesVector(Vector &rValues, int Step=0) const override
Definition: small_displacement_interface_element.cpp:531
GeometryData::IntegrationMethod mThisIntegrationMethod
Definition: small_displacement_interface_element.hpp:144
void CheckAndCalculateJointWidth(double &rJointWidth, ConstitutiveLaw::Parameters &rConstitutiveParameters, double &rNormalRelDisp, const double &InitialJointWidth, const unsigned int &GPoint)
Definition: small_displacement_interface_element.cpp:1259
SmallDisplacementInterfaceElement()
Definition: small_displacement_interface_element.hpp:48
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:418
void ExtrapolateGPJointWidth(const std::vector< double > &JointWidthContainer)
SmallDisplacementInterfaceElement(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: small_displacement_interface_element.hpp:51
void FinalizeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:246
void CalculateRotationMatrix(BoundedMatrix< double, TDim, TDim > &rRotationMatrix, const GeometryType &Geom)
void CalculateAll(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: small_displacement_interface_element.cpp:932
void CalculateIntegrationCoefficient(double &rIntegrationCoefficient, const double &weight, const double &detJ)
void CalculateAndAddMixBodyForce(VectorType &rRightHandSideVector, ElementVariables &rVariables)
Definition: small_displacement_interface_element.cpp:1349
void CalculateDampingMatrix(MatrixType &rDampingMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: small_displacement_interface_element.cpp:216
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: small_displacement_interface_element.cpp:22
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Definition: small_displacement_interface_element.cpp:132
void CalculateAndAddStiffnessForce(VectorType &rRightHandSideVector, ElementVariables &rVariables)
Definition: small_displacement_interface_element.cpp:1336
void GetSecondDerivativesVector(Vector &rValues, int Step=0) const override
Definition: small_displacement_interface_element.cpp:554
void CalculateRHS(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo)
Definition: small_displacement_interface_element.cpp:998
#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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307
Definition: constitutive_law.h:189
Definition: small_displacement_interface_element.hpp:110
BoundedMatrix< double, TDim, TDim > RotationMatrix
Definition: small_displacement_interface_element.hpp:119
double IntegrationCoefficient
Definition: small_displacement_interface_element.hpp:135
array_1d< double, TNumNodes *TDim > UVector
Definition: small_displacement_interface_element.hpp:140
array_1d< double, TDim > BodyAcceleration
Definition: small_displacement_interface_element.hpp:134
BoundedMatrix< double, TNumNodes *TDim, TNumNodes *TDim > UMatrix
Definition: small_displacement_interface_element.hpp:137
double detF
Definition: small_displacement_interface_element.hpp:131
Matrix GradNpT
Definition: small_displacement_interface_element.hpp:129
Matrix ConstitutiveMatrix
Definition: small_displacement_interface_element.hpp:127
Vector Np
Definition: small_displacement_interface_element.hpp:128
double Density
Definition: small_displacement_interface_element.hpp:112
BoundedMatrix< double, TDim, TDim > DimMatrix
Definition: small_displacement_interface_element.hpp:138
array_1d< double, TDim > VoigtVector
Definition: small_displacement_interface_element.hpp:120
BoundedMatrix< double, TNumNodes *TDim, TDim > UDimMatrix
Definition: small_displacement_interface_element.hpp:139
array_1d< double, TNumNodes *TDim > DisplacementVector
Definition: small_displacement_interface_element.hpp:115
BoundedMatrix< double, TDim, TNumNodes *TDim > Nu
Definition: small_displacement_interface_element.hpp:133
Vector StrainVector
Definition: small_displacement_interface_element.hpp:125
Vector StressVector
Definition: small_displacement_interface_element.hpp:126
double JointWidth
Definition: small_displacement_interface_element.hpp:136
array_1d< double, TNumNodes *TDim > VolumeAcceleration
Definition: small_displacement_interface_element.hpp:116
Matrix F
Definition: small_displacement_interface_element.hpp:130