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.
U_Pw_normal_lysmer_absorbing_condition.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 //
11 // Main authors: Aron Noordam
12 //
13 #pragma once
14 
15 // Project includes
16 #include "includes/serializer.h"
17 
18 // Application includes
19 #include "custom_conditions/U_Pw_condition.hpp"
20 #include "custom_conditions/U_Pw_face_load_condition.hpp"
21 #include "custom_utilities/element_utilities.hpp"
24 
25 namespace Kratos
26 {
27 
28 template< unsigned int TDim, unsigned int TNumNodes >
29 class KRATOS_API(GEO_MECHANICS_APPLICATION) UPwLysmerAbsorbingCondition : public UPwFaceLoadCondition<TDim,TNumNodes>
30 {
31 
32 public:
33 
35 
36  using IndexType = std::size_t;
38  using NodeType = Node;
41  using VectorType = Vector;
42  using MatrixType = Matrix;
43 
44 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
45 
46  // Default constructor
48 
49  // Constructor 1
50  UPwLysmerAbsorbingCondition( IndexType NewId, GeometryType::Pointer pGeometry ) : UPwFaceLoadCondition<TDim,TNumNodes>(NewId, pGeometry) {}
51 
52  // Constructor 2
53  UPwLysmerAbsorbingCondition( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties ) : UPwFaceLoadCondition<TDim,TNumNodes>(NewId, pGeometry, pProperties) {}
54 
55 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
56 
57  Condition::Pointer Create(IndexType NewId,NodesArrayType const& ThisNodes,PropertiesType::Pointer pProperties ) const override;
58 
64  void GetValuesVector(Vector& rValues, int Step) const override;
65 
71  void GetFirstDerivativesVector(Vector& rValues, int Step) const override;
72 
78  void CalculateRightHandSide(VectorType& rRightHandSideVector,
79  const ProcessInfo& rCurrentProcessInfo) override;
80 
86  void CalculateDampingMatrix(MatrixType& rDampingMatrix, const ProcessInfo& rCurrentProcessInfo) override;
87 
94  void CalculateLocalSystem(MatrixType& rLhsMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
95 
96 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
97 
98 protected:
99 
100  static constexpr SizeType N_DOF = TNumNodes * TDim;
101  static constexpr SizeType CONDITION_SIZE = TNumNodes * TDim + TNumNodes;
102 
105 
107  {
108  double rho; // density of soil mixture
109  double Ec; // p wave modulus
110  double G; // shear modulus
111  double n; // porosity
112  double vp; // p wave velocity
113  double vs; // shear wave velocity
114  double p_factor; // p wave relaxation factor
115  double s_factor; // s wave relaxation factor
121 
122  DimensionMatrixType CAbsMatrix; // damping part of absorbing matrix;
123  DimensionMatrixType KAbsMatrix; // stiffness part of absorbing matrix;
124  };
125 
126  // Member Variables
127 
128 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
129 
130 
136  void AddLHS(MatrixType& rLeftHandSideMatrix, const ElementMatrixType& rUMatrix);
137 
143  void CalculateAndAddRHS(VectorType& rRightHandSideVector, const MatrixType& rStiffnessMatrix);
144 
151 
157  void GetNeighbourElementVariables(NormalLysmerAbsorbingVariables& rVariables, const ProcessInfo& rCurrentProcessInfo);
158 
164  void GetVariables(NormalLysmerAbsorbingVariables& rVariables, const ProcessInfo& rCurrentProcessInfo);
165 
171  void CalculateNodalDampingMatrix(NormalLysmerAbsorbingVariables& rVariables, const Element::GeometryType& rGeom);
172 
178  void CalculateNodalStiffnessMatrix(NormalLysmerAbsorbingVariables& rVariables, const Element::GeometryType& rGeom);
179 
184  Matrix CalculateExtrapolationMatrixNeighbour(const Element& rNeighbourElement);
185 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
186 
187 private:
188  using hashmap = std::unordered_multimap<DenseVector<int>, std::vector<Condition::Pointer>, KeyHasherRange<DenseVector<int>>, KeyComparorRange<DenseVector<int>>>;
189 
195  void CalculateRotationMatrix2DLine(DimensionMatrixType& rRotationMatrix, const Element::GeometryType& rGeom);
196 
202  void CalculateConditionStiffnessMatrix(ElementMatrixType& rStiffnessMatrix, const ProcessInfo& rCurrentProcessInfo);
203 
204  friend class Serializer;
205 
206  void save(Serializer& rSerializer) const override
207  {
209  }
210 
211  void load(Serializer& rSerializer) override
212  {
214  }
215 
216 }; // class UPwLysmerAbsorbingCondition.
217 
218 } // namespace Kratos.
Base class for all Conditions.
Definition: condition.h:59
std::size_t SizeType
Definition: condition.h:94
Base class for all Elements.
Definition: element.h:60
std::size_t IndexType
Definition: flags.h:74
Geometry base class.
Definition: geometry.h:71
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
This class defines the node.
Definition: node.h:65
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
Definition: U_Pw_face_load_condition.hpp:33
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:30
UPwLysmerAbsorbingCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:53
UPwLysmerAbsorbingCondition()
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:47
UPwLysmerAbsorbingCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:50
void CalculateRotationMatrix(DimensionMatrixType &rRotationMatrix, const Element::GeometryType &rGeom)
Calculates the rotation matrix of the current condition.
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(UPwLysmerAbsorbingCondition)
#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
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
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
def load(f)
Definition: ode_solve.py:307
This is a key comparer of general pourpose between two classes.
Definition: key_hash.h:100
This is a hasher of general pourpose.
Definition: key_hash.h:138
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:107
double rho
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:108
Vector GNodes
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:118
Vector EcNodes
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:117
double Ec
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:109
double G
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:110
Vector rhoNodes
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:120
double n
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:111
DimensionMatrixType CAbsMatrix
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:122
Vector SaturationNodes
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:119
DimensionMatrixType KAbsMatrix
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:123
double vp
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:112
double vs
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:113
double virtual_thickness
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:116
double s_factor
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:115
double p_factor
Definition: U_Pw_normal_lysmer_absorbing_condition.hpp:114