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.
mpc_mortar_contact_condition.h
Go to the documentation of this file.
1 // KRATOS ______ __ __ _____ __ __ __
2 // / ____/___ ____ / /_____ ______/ /_/ ___// /________ _______/ /___ ___________ _/ /
3 // / / / __ \/ __ \/ __/ __ `/ ___/ __/\__ \/ __/ ___/ / / / ___/ __/ / / / ___/ __ `/ /
4 // / /___/ /_/ / / / / /_/ /_/ / /__/ /_ ___/ / /_/ / / /_/ / /__/ /_/ /_/ / / / /_/ / /
5 // \____/\____/_/ /_/\__/\__,_/\___/\__//____/\__/_/ \__,_/\___/\__/\__,_/_/ \__,_/_/ MECHANICS
6 //
7 // License: BSD License
8 // license: ContactStructuralMechanicsApplication/license.txt
9 //
10 // Main authors: Vicente Mataix Ferrandiz
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
22 #include "utilities/math_utils.h"
23 #include "includes/kratos_flags.h"
24 #include "includes/checks.h"
26 
27 /* Utilities */
30 
31 /* Geometries */
32 #include "geometries/line_2d_2.h"
34 
35 namespace Kratos
36 {
37 
40 
44 
46  using SizeType = std::size_t;
47 
51 
55 
59 
70 template< const SizeType TDim, const SizeType TNumNodes,const SizeType TNumNodesMaster = TNumNodes>
71 class KRATOS_API(CONTACT_STRUCTURAL_MECHANICS_APPLICATION) MPCMortarContactCondition
72  : public PairedCondition
73 {
74 public:
77 
80 
83 
85  using VectorType = typename BaseType::VectorType;
86 
88  using MatrixType = typename BaseType::MatrixType;
89 
91  using IndexType = typename BaseType::IndexType;
92 
94  using GeometryPointerType = typename BaseType::GeometryType::Pointer;
95 
98 
100  using PropertiesPointerType = typename BaseType::PropertiesType::Pointer;
101 
103  using PointType = Point;
104 
107 
109  using ConditionArrayListType = typename std::vector<ConditionArrayType>;
110 
113 
114  // Type definition for integration methods
116 
119 
122 
125 
128 
131 
134 
137 
140 
142  static constexpr IndexType MatrixSize = TDim * (TNumNodes + TNumNodesMaster);
143 
147 
150  : PairedCondition()
151  {}
152 
153  // Constructor 1
155  IndexType NewId,
156  GeometryType::Pointer pGeometry
157  ) :PairedCondition(NewId, pGeometry)
158  {}
159 
160  // Constructor 2
162  IndexType NewId,
163  GeometryType::Pointer pGeometry,
164  PropertiesType::Pointer pProperties
165  ) :PairedCondition( NewId, pGeometry, pProperties )
166  {}
167 
168  // Constructor 3
170  IndexType NewId,
171  GeometryType::Pointer pGeometry,
172  PropertiesType::Pointer pProperties,
173  GeometryType::Pointer pMasterGeometry
174  )
175  :PairedCondition( NewId, pGeometry, pProperties, pMasterGeometry)
176  {}
177 
180 
183 
187 
188 
192 
200  Condition::Pointer Create(
201  IndexType NewId,
202  NodesArrayType const& rThisNodes,
203  PropertiesType::Pointer pProperties
204  ) const override;
205 
213  Condition::Pointer Create(
214  IndexType NewId,
215  GeometryType::Pointer pGeom,
216  PropertiesType::Pointer pProperties
217  ) const override;
218 
227  Condition::Pointer Create(
228  IndexType NewId,
229  GeometryType::Pointer pGeom,
230  PropertiesType::Pointer pProperties,
231  GeometryType::Pointer pMasterGeom
232  ) const override;
233 
238  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
239 
244  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
245 
250  void InitializeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
251 
256  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
257 
262  void FinalizeNonLinearIteration(const ProcessInfo& rCurrentProcessInfo) override;
263 
269  void EquationIdVector(
270  EquationIdVectorType& rResult,
271  const ProcessInfo& rCurrentProcessInfo
272  ) const override;
273 
279  void GetDofList(
280  DofsVectorType& rConditionalDofList,
281  const ProcessInfo& rCurrentProcessInfo
282  ) const override;
283 
284 
290  void CalculateMassMatrix(
291  MatrixType& rMassMatrix,
292  const ProcessInfo& rCurrentProcessInfo
293  ) override;
294 
300  void CalculateDampingMatrix(
301  MatrixType& rDampingMatrix,
302  const ProcessInfo& rCurrentProcessInfo
303  ) override;
304 
310  void AddExplicitContribution(const ProcessInfo& rCurrentProcessInfo) override;
311 
312  /******************************************************************/
313  /********** AUXILLIARY METHODS FOR GENERAL CALCULATIONS ***********/
314  /******************************************************************/
315 
323  const Variable<double>& rVariable,
324  std::vector<double>& rOutput,
325  const ProcessInfo& rCurrentProcessInfo
326  ) override;
327 
335  const Variable<array_1d<double, 3 > >& rVariable,
336  std::vector< array_1d<double, 3 > >& rOutput,
337  const ProcessInfo& rCurrentProcessInfo
338  ) override;
339 
347  const Variable<Vector>& rVariable,
348  std::vector<Vector>& rOutput,
349  const ProcessInfo& rCurrentProcessInfo
350  ) override;
351 
359  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
360 
364 
368 
372 
374  std::string Info() const override
375  {
376  std::stringstream buffer;
377  buffer << "MPCMortarContactCondition #" << this->Id();
378  return buffer.str();
379  }
380 
382  void PrintInfo(std::ostream& rOStream) const override
383  {
384  rOStream << "MPCMortarContactCondition #" << this->Id();
385  }
386 
388  void PrintData(std::ostream& rOStream) const override
389  {
390  PrintInfo(rOStream);
391  this->GetParentGeometry().PrintData(rOStream);
392  this->GetPairedGeometry().PrintData(rOStream);
393  }
394 
398 
400 
401 protected:
404 
408 
409  bool mPreviousMortarOperatorsInitialized = false;
410 
412 
416 
420 
421  /******************************************************************/
422  /*********************** COMPUTING METHODS ***********************/
423  /******************************************************************/
424 
433  void CalculateLocalSystem(
434  MatrixType& rLeftHandSideMatrix,
435  VectorType& rRightHandSideVector,
436  const ProcessInfo& rCurrentProcessInfo
437  ) override;
438 
445  void CalculateRightHandSide(
446  VectorType& rRightHandSideVector,
447  const ProcessInfo& rCurrentProcessInfo
448  ) override;
449 
456  void CalculateLeftHandSide(
457  MatrixType& rLeftHandSideMatrix,
458  const ProcessInfo& rCurrentProcessInfo
459  ) override;
460 
465  {
466  // Setting the auxiliary integration points
467  const IndexType integration_order = GetProperties().Has(INTEGRATION_ORDER_CONTACT) ? GetProperties().GetValue(INTEGRATION_ORDER_CONTACT) : 2;
468  switch (integration_order) {
475  }
476  }
477 
481 
485 
489 
491 private:
494 
498 
502 
506 
513  void ConstraintDofDatabaseUpdate(
514  Matrix& rRelationMatrix,
515  Vector& rConstantVector,
516  const ProcessInfo& rCurrentProcessInfo
517  );
518 
527  void UpdateConstraintFrictionless(
528  MortarConditionMatrices& rMortarConditionMatrices,
529  Matrix& rRelationMatrix,
530  Vector& rConstantVector,
531  const ProcessInfo& rCurrentProcessInfo,
532  const bool DualLM = true
533  );
534 
543  void UpdateConstraintFrictional(
544  MortarConditionMatrices& rMortarConditionMatrices,
545  Matrix& rRelationMatrix,
546  Vector& rConstantVector,
547  const ProcessInfo& rCurrentProcessInfo,
548  const bool DualLM = true
549  );
550 
559  void UpdateConstraintTying(
560  MortarConditionMatrices& rMortarConditionMatrices,
561  Matrix& rRelationMatrix,
562  Vector& rConstantVector,
563  const ProcessInfo& rCurrentProcessInfo,
564  const bool DualLM = true
565  );
566 
571  void ComputePreviousMortarOperators(const ProcessInfo& rCurrentProcessInfo);
572 
576 
580 
584 
585  // Serialization
586 
587  friend class Serializer;
588 
589  void save(Serializer& rSerializer) const override
590  {
592  rSerializer.save("PreviousMortarOperators", mPreviousMortarOperators);
593  rSerializer.save("PreviousMortarOperatorsInitialized", mPreviousMortarOperatorsInitialized);
594  }
595 
596  void load(Serializer& rSerializer) override
597  {
599  rSerializer.load("PreviousMortarOperators", mPreviousMortarOperators);
600  rSerializer.load("PreviousMortarOperatorsInitialized", mPreviousMortarOperatorsInitialized);
601  }
602 
604 
605 }; // Class MPCMortarContactCondition
606 
608 
611 
615 
617 
618 }// namespace Kratos.
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
This utilities are used in order to compute the directional derivatives during mortar contact.
Definition: derivatives_utilities.h:63
This is the definition dual lagrange multiplier operators according to the work of Alexander Popp: ht...
Definition: mortar_classes.h:1513
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
An two node 2D line geometry with linear shape functions.
Definition: line_2d_2.h:65
MPCMortarContactCondition.
Definition: mpc_mortar_contact_condition.h:73
MortarConditionMatrices mPreviousMortarOperators
In order to know iw we need to initialize the previous operators.
Definition: mpc_mortar_contact_condition.h:411
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mpc_mortar_contact_condition.h:388
typename BaseType::IndexType IndexType
Index type definition.
Definition: mpc_mortar_contact_condition.h:91
~MPCMortarContactCondition() override
Destructor.
MPCMortarContactCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties, GeometryType::Pointer pMasterGeometry)
Definition: mpc_mortar_contact_condition.h:169
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mpc_mortar_contact_condition.h:382
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(MPCMortarContactCondition)
Counted pointer of MPCMortarContactCondition.
MPCMortarContactCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: mpc_mortar_contact_condition.h:161
std::string Info() const override
Turn back information as a string.
Definition: mpc_mortar_contact_condition.h:374
typename BaseType::GeometryType::Pointer GeometryPointerType
Geometry pointer definition.
Definition: mpc_mortar_contact_condition.h:94
MPCMortarContactCondition(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: mpc_mortar_contact_condition.h:154
typename std::conditional< TDim==2, LineType, TriangleType >::type DecompositionType
Type definition for decomposition based on dimension.
Definition: mpc_mortar_contact_condition.h:124
typename BaseType::PropertiesType::Pointer PropertiesPointerType
Properties pointer definition.
Definition: mpc_mortar_contact_condition.h:100
typename std::vector< ConditionArrayType > ConditionArrayListType
Type definition for a list of condition arrays.
Definition: mpc_mortar_contact_condition.h:109
typename GeometryType::IntegrationPointsArrayType IntegrationPointsType
Definition: mpc_mortar_contact_condition.h:115
IntegrationMethod GetIntegrationMethod() const override
It returns theintegration method considered.
Definition: mpc_mortar_contact_condition.h:464
MPCMortarContactCondition()
Default constructor.
Definition: mpc_mortar_contact_condition.h:149
MPCMortarContactCondition(MPCMortarContactCondition const &rOther)
Copy constructor.
Definition: mpc_mortar_contact_condition.h:179
This is a base class for the conditions paired.
Definition: paired_condition.h:53
Point class.
Definition: point.h:59
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
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
A three node 3D triangle geometry with linear shape functions.
Definition: triangle_3d_3.h:77
Short class definition.
Definition: array_1d.h:61
#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
Definition: binary_expression.cpp:25
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
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
type
Definition: generate_gid_list_file.py:35
def load(f)
Definition: ode_solve.py:307