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.
coupling_lagrange_condition.h
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 
11 #if !defined(KRATOS_COUPLING_LAGRANGE_CONDITION_H_INCLUDED )
12 #define KRATOS_COUPLING_LAGRANGE_CONDITION_H_INCLUDED
13 
14 // System includes
15 #include "includes/define.h"
16 #include "includes/condition.h"
17 
18 // External includes
19 
20 // Project includes
23 
25 
26 namespace Kratos
27 {
28 
30 
36  : public Condition
37 {
38 public:
41 
44 
46  typedef std::size_t SizeType;
47  typedef std::size_t IndexType;
48 
52 
55  IndexType NewId,
56  GeometryType::Pointer pGeometry)
57  : Condition(NewId, pGeometry)
58  {};
59 
62  IndexType NewId,
63  GeometryType::Pointer pGeometry,
64  PropertiesType::Pointer pProperties)
65  : Condition(NewId, pGeometry, pProperties)
66  {};
67 
70  : Condition()
71  {};
72 
74  virtual ~CouplingLagrangeCondition() = default;
75 
79 
81  Condition::Pointer Create(
82  IndexType NewId,
83  GeometryType::Pointer pGeom,
84  PropertiesType::Pointer pProperties
85  ) const override
86  {
87  return Kratos::make_intrusive<CouplingLagrangeCondition>(
88  NewId, pGeom, pProperties);
89  };
90 
92  Condition::Pointer Create(
93  IndexType NewId,
94  NodesArrayType const& ThisNodes,
95  PropertiesType::Pointer pProperties
96  ) const override
97  {
98  return Kratos::make_intrusive< CouplingLagrangeCondition >(
99  NewId, GetGeometry().Create(ThisNodes), pProperties);
100  };
101 
105 
113  VectorType& rRightHandSideVector,
114  const ProcessInfo& rCurrentProcessInfo) override
115  {
116  MatrixType left_hand_side_matrix = Matrix(0, 0);
117 
118  CalculateAll(left_hand_side_matrix, rRightHandSideVector,
119  rCurrentProcessInfo, false, true);
120  }
121 
129  MatrixType& rLeftHandSideMatrix,
130  const ProcessInfo& rCurrentProcessInfo) override
131  {
132  VectorType right_hand_side_vector = Vector(0);
133 
134  CalculateAll(rLeftHandSideMatrix, right_hand_side_vector,
135  rCurrentProcessInfo, true, false);
136  }
137 
147  MatrixType& rLeftHandSideMatrix,
148  VectorType& rRightHandSideVector,
149  const ProcessInfo& rCurrentProcessInfo) override
150  {
151  CalculateAll(rLeftHandSideMatrix, rRightHandSideVector,
152  rCurrentProcessInfo, true, true);
153  }
154 
160  void EquationIdVector(
161  EquationIdVectorType& rResult,
162  const ProcessInfo& rCurrentProcessInfo
163  ) const override;
164 
170  void GetDofList(
171  DofsVectorType& rElementalDofList,
172  const ProcessInfo& rCurrentProcessInfo
173  ) const override;
174 
183  void CalculateAll(
184  MatrixType& rLeftHandSideMatrix,
185  VectorType& rRightHandSideVector,
186  const ProcessInfo& rCurrentProcessInfo,
187  const bool CalculateStiffnessMatrixFlag,
188  const bool CalculateResidualVectorFlag
189  );
190 
192  const GeometryType& rGeometry,
193  Vector& rDeterminantOfJacobian);
194 
198 
200  std::string Info() const override
201  {
202  std::stringstream buffer;
203  buffer << "\"CouplingLagrangeCondition\" #" << Id();
204  return buffer.str();
205  }
206 
208  void PrintInfo(std::ostream& rOStream) const override
209  {
210  rOStream << "\"CouplingLagrangeCondition\" #" << Id();
211  }
212 
214  void PrintData(std::ostream& rOStream) const override {
215  pGetGeometry()->PrintData(rOStream);
216  }
217 
219 
220 private:
223 
224  const double shape_function_tolerance = 1e-6;
225 
229 
230  /* @brief checks all shape functions and
231  * returns the number of non zero nodes.
232  */
233  SizeType GetNumberOfNonZeroNodesMaster() const;
234  SizeType GetNumberOfNonZeroNodesSlave() const;
235 
236 
239 
240  friend class Serializer;
241 
242  virtual void save(Serializer& rSerializer) const override
243  {
245  }
246 
247  virtual void load(Serializer& rSerializer) override
248  {
250  }
251 
253 
254 }; // Class CouplingLagrangeCondition
255 
256 } // namespace Kratos.
257 
258 #endif // KRATOS_COUPLING_LAGRANGE_CONDITION_H_INCLUDED defined
259 
260 
Base class for all Conditions.
Definition: condition.h:59
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
Matrix MatrixType
Definition: condition.h:90
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
Lagrange factor based coupling condition.
Definition: coupling_lagrange_condition.h:37
void CalculateAll(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo, const bool CalculateStiffnessMatrixFlag, const bool CalculateResidualVectorFlag)
Definition: coupling_lagrange_condition.cpp:24
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the condition left hand side matri...
Definition: coupling_lagrange_condition.h:128
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Sets on rResult the ID's of the element degrees of freedom.
Definition: coupling_lagrange_condition.cpp:238
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
This function provides a more general interface to the element.
Definition: coupling_lagrange_condition.h:146
KRATOS_CLASS_POINTER_DEFINITION(CouplingLagrangeCondition)
Counted pointer of CouplingLagrangeCondition.
virtual ~CouplingLagrangeCondition()=default
Destructor.
void DeterminantOfJacobianInitial(const GeometryType &rGeometry, Vector &rDeterminantOfJacobian)
Definition: coupling_lagrange_condition.cpp:199
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
This is called during the assembling process in order to calculate the condition right hand side matr...
Definition: coupling_lagrange_condition.h:112
void GetDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const override
Sets on rElementalDofList the degrees of freedom of the considered element geometry.
Definition: coupling_lagrange_condition.cpp:302
CouplingLagrangeCondition()
Default constructor.
Definition: coupling_lagrange_condition.h:69
std::string Info() const override
Turn back information as a string.
Definition: coupling_lagrange_condition.h:200
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: coupling_lagrange_condition.h:208
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: coupling_lagrange_condition.h:214
CouplingLagrangeCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constructor with Id, geometry and property.
Definition: coupling_lagrange_condition.h:61
CouplingLagrangeCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor with Id and geometry.
Definition: coupling_lagrange_condition.h:54
Condition::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Create with Id, pointer to geometry and pointer to property.
Definition: coupling_lagrange_condition.h:81
std::size_t SizeType
Size types.
Definition: coupling_lagrange_condition.h:46
std::size_t IndexType
Definition: coupling_lagrange_condition.h:47
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create with Id, pointer to geometry and pointer to property.
Definition: coupling_lagrange_condition.h:92
std::size_t IndexType
Definition: flags.h:74
GeometryType::Pointer pGetGeometry()
Returns the pointer to the geometry.
Definition: geometrical_object.h:140
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
IndexType Id() const
Definition: indexed_object.h:107
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
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
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
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
def load(f)
Definition: ode_solve.py:307
e
Definition: run_cpp_mpi_tests.py:31