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.
penalty_frictionless_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
21 
22 namespace Kratos
23 {
24 
27 
31 
33  using SizeType = std::size_t;
34 
38 
42 
46 
60 template< SizeType TDim, SizeType TNumNodes, bool TNormalVariation, const SizeType TNumNodesMaster = TNumNodes >
61 class KRATOS_API(CONTACT_STRUCTURAL_MECHANICS_APPLICATION) PenaltyMethodFrictionlessMortarContactCondition
62  : public MortarContactCondition<TDim, TNumNodes, FrictionalCase::FRICTIONLESS_PENALTY, TNormalVariation, TNumNodesMaster>
63 {
64 public:
67 
70 
73 
75  using MortarConditionMatrices = typename BaseType::MortarConditionMatrices;
76 
78  using GeneralVariables = typename BaseType::GeneralVariables;
79 
81  using AeData = typename BaseType::AeData;
82 
84  using IntegrationUtility = typename BaseType::IntegrationUtility;
85 
87  using DerivativesUtilitiesType = typename BaseType::DerivativesUtilitiesType;
88 
90  using BelongType = typename BaseType::BelongType;
91 
93  using ConditionArrayType = typename BaseType::ConditionArrayType;
94 
96  using ConditionArrayListType = typename BaseType::ConditionArrayListType;
97 
99  using DecompositionType = typename BaseType::DecompositionType;
100 
102  using DerivativeDataType = typename BaseType::DerivativeDataType;
103 
106 
109 
112 
115 
118 
120  using GeometryPointerType = typename ConditionBaseType::GeometryType::Pointer;
121 
124 
127 
129  using PropertiesPointerType = typename PropertiesType::Pointer;
130 
133 
136 
138  using PointType = Point;
139 
142 
143  // Type definition for integration methods
145 
146  static constexpr IndexType MatrixSize = TDim * (TNumNodes + TNumNodesMaster);
147 
151 
154  : BaseType()
155  {
156  }
157 
158  // Constructor 1
160  IndexType NewId,
161  GeometryPointerType pGeometry
162  ):BaseType(NewId, pGeometry)
163  {
164  }
165 
166  // Constructor 2
168  IndexType NewId,
169  GeometryPointerType pGeometry,
170  PropertiesPointerType pProperties
171  ):BaseType( NewId, pGeometry, pProperties )
172  {
173  }
174 
175  // Constructor 3
177  IndexType NewId,
178  GeometryPointerType pGeometry,
179  PropertiesPointerType pProperties,
180  GeometryType::Pointer pMasterGeometry
181  ):BaseType( NewId, pGeometry, pProperties, pMasterGeometry )
182  {
183  }
184 
187  {
188  }
189 
192 
196 
197 
201 
209  Condition::Pointer Create(
210  IndexType NewId,
211  NodesArrayType const& rThisNodes,
212  PropertiesPointerType pProperties
213  ) const override;
214 
222  Condition::Pointer Create(
223  IndexType NewId,
224  GeometryPointerType pGeom,
225  PropertiesPointerType pProperties
226  ) const override;
227 
236  Condition::Pointer Create(
237  IndexType NewId,
238  GeometryPointerType pGeom,
239  PropertiesPointerType pProperties,
240  GeometryPointerType pMasterGeom
241  ) const override;
242 
253  void AddExplicitContribution(const ProcessInfo& rCurrentProcessInfo) override;
254 
264  void AddExplicitContribution(
265  const VectorType& rRHSVector,
266  const Variable<VectorType>& rRHSVariable,
267  const Variable<double >& rDestinationVariable,
268  const ProcessInfo& rCurrentProcessInfo
269  ) override;
270 
280  void AddExplicitContribution(const VectorType& rRHSVector,
281  const Variable<VectorType>& rRHSVariable,
282  const Variable<array_1d<double, 3> >& rDestinationVariable,
283  const ProcessInfo& rCurrentProcessInfo
284  ) override;
285 
286  /********************************************************************************/
287  /**************** METHODS TO CALCULATE MORTAR CONDITION MATRICES ****************/
288  /********************************************************************************/
289 
299  PairedCondition* pCondition,
300  Vector& rLocalRHS,
301  const MortarConditionMatrices& rMortarConditionMatrices,
302  const DerivativeDataType& rDerivativeData,
303  const IndexType rActiveInactive,
304  const ProcessInfo& rCurrentProcessInfo
305  );
306 
307  /******************************************************************/
308  /********** AUXILLIARY METHODS FOR GENERAL CALCULATIONS ***********/
309  /******************************************************************/
310 
316  void EquationIdVector(
317  EquationIdVectorType& rResult,
318  const ProcessInfo& rCurrentProcessInfo
319  ) const override;
320 
326  void GetDofList(
327  DofsVectorType& rConditionalDofList,
328  const ProcessInfo& rCurrentProcessInfo
329  ) const override;
330 
338  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
339 
343 
347 
351 
353  std::string Info() const override
354  {
355  std::stringstream buffer;
356  buffer << "PenaltyMethodFrictionlessMortarContactCondition #" << this->Id();
357  return buffer.str();
358  }
359 
361  void PrintInfo(std::ostream& rOStream) const override
362  {
363  rOStream << "PenaltyMethodFrictionlessMortarContactCondition #" << this->Id();
364  }
365 
367  void PrintData(std::ostream& rOStream) const override
368  {
369  PrintInfo(rOStream);
370  this->GetParentGeometry().PrintData(rOStream);
371  this->GetPairedGeometry().PrintData(rOStream);
372  }
373 
377 
379 
380 protected:
383 
387 
391 
395 
396  /********************************************************************************/
397  /**************** METHODS TO CALCULATE MORTAR CONDITION MATRICES ****************/
398  /********************************************************************************/
399 
408  Matrix& rLocalLHS,
409  const MortarConditionMatrices& rMortarConditionMatrices,
410  const DerivativeDataType& rDerivativeData,
411  const IndexType rActiveInactive,
412  const ProcessInfo& rCurrentProcessInfo
413  ) override;
414 
422  void CalculateLocalRHS(
423  Vector& rLocalRHS,
424  const MortarConditionMatrices& rMortarConditionMatrices,
425  const DerivativeDataType& rDerivativeData,
426  const IndexType rActiveInactive,
427  const ProcessInfo& rCurrentProcessInfo
428  ) override;
429 
430  /******************************************************************/
431  /********** AUXILLIARY METHODS FOR GENERAL CALCULATIONS ***********/
432  /******************************************************************/
433 
439  IndexType GetActiveInactiveValue(const GeometryType& rCurrentGeometry) const override
440  {
441  IndexType value = 0;
442  for (IndexType i_node = 0; i_node < TNumNodes; ++i_node)
443  if (rCurrentGeometry[i_node].Is(ACTIVE) == true)
444  value += 1 << i_node;
445 
446  return value;
447  }
448 
452 
456 
460 
462 private:
465 
469 
473 
477 
481 
485 
489 
490  // Serialization
491 
492  friend class Serializer;
493 
494  void save(Serializer& rSerializer) const override
495  {
497  }
498 
499  void load(Serializer& rSerializer) override
500  {
501  KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, BaseType );
502  }
503 
505 
506 }; // Class PenaltyMethodFrictionlessMortarContactCondition
507 
509 
512 
516 
518 
519 }// namespace Kratos.
Base class for all Conditions.
Definition: condition.h:59
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
This defines the geometrical object, base definition of the element and condition entities.
Definition: geometrical_object.h:58
Geometry base class.
Definition: geometry.h:71
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
MortarContactCondition.
Definition: mortar_contact_condition.h:78
This is a base class for the conditions paired.
Definition: paired_condition.h:53
BaseType::GeometryType::Pointer GeometryPointerType
Geometry pointer type definition.
Definition: paired_condition.h:83
BaseType::PropertiesType::Pointer PropertiesPointerType
Properties pointer type definition.
Definition: paired_condition.h:89
PenaltyMethodFrictionlessMortarContactCondition.
Definition: penalty_frictionless_mortar_contact_condition.h:63
typename GeometryType::IntegrationPointsArrayType IntegrationPointsType
Definition: penalty_frictionless_mortar_contact_condition.h:144
typename BaseType::ConditionArrayListType ConditionArrayListType
Type definition for condition array list type.
Definition: penalty_frictionless_mortar_contact_condition.h:96
IndexType GetActiveInactiveValue(const GeometryType &rCurrentGeometry) const override
Returns a value depending of the active/inactive set.
Definition: penalty_frictionless_mortar_contact_condition.h:439
typename BaseType::DerivativesUtilitiesType DerivativesUtilitiesType
Type definition for derivatives utilities type.
Definition: penalty_frictionless_mortar_contact_condition.h:87
typename BaseType::ConditionArrayType ConditionArrayType
Type definition for pair index container.
Definition: penalty_frictionless_mortar_contact_condition.h:93
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: penalty_frictionless_mortar_contact_condition.h:367
PenaltyMethodFrictionlessMortarContactCondition(IndexType NewId, GeometryPointerType pGeometry)
Definition: penalty_frictionless_mortar_contact_condition.h:159
typename BaseType::AeData AeData
Type definition for Ae data.
Definition: penalty_frictionless_mortar_contact_condition.h:81
typename ConditionBaseType::IndexType IndexType
Type definition for index type.
Definition: penalty_frictionless_mortar_contact_condition.h:117
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: penalty_frictionless_mortar_contact_condition.h:361
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(PenaltyMethodFrictionlessMortarContactCondition)
Counted pointer of PenaltyMethodFrictionlessMortarContactCondition.
PenaltyMethodFrictionlessMortarContactCondition(IndexType NewId, GeometryPointerType pGeometry, PropertiesPointerType pProperties, GeometryType::Pointer pMasterGeometry)
Definition: penalty_frictionless_mortar_contact_condition.h:176
typename BaseType::IntegrationUtility IntegrationUtility
Type definition for integration utility.
Definition: penalty_frictionless_mortar_contact_condition.h:84
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...
typename BaseType::MortarConditionMatrices MortarConditionMatrices
Type definition for mortar condition matrices.
Definition: penalty_frictionless_mortar_contact_condition.h:75
PenaltyMethodFrictionlessMortarContactCondition(IndexType NewId, GeometryPointerType pGeometry, PropertiesPointerType pProperties)
Definition: penalty_frictionless_mortar_contact_condition.h:167
PenaltyMethodFrictionlessMortarContactCondition(PenaltyMethodFrictionlessMortarContactCondition const &rOther)
Copy constructor.
Definition: penalty_frictionless_mortar_contact_condition.h:186
void CalculateLocalLHS(Matrix &rLocalLHS, const MortarConditionMatrices &rMortarConditionMatrices, const DerivativeDataType &rDerivativeData, const IndexType rActiveInactive, const ProcessInfo &rCurrentProcessInfo) override
Calculates the local contibution of the LHS.
typename BaseType::DecompositionType DecompositionType
Type definition for decomposition type.
Definition: penalty_frictionless_mortar_contact_condition.h:99
static void StaticCalculateLocalRHS(PairedCondition *pCondition, Vector &rLocalRHS, const MortarConditionMatrices &rMortarConditionMatrices, const DerivativeDataType &rDerivativeData, const IndexType rActiveInactive, const ProcessInfo &rCurrentProcessInfo)
Calculates the local contibution of the RHS.
Condition::Pointer Create(IndexType NewId, GeometryPointerType pGeom, PropertiesPointerType pProperties, GeometryPointerType pMasterGeom) const override
Creates a new element pointer from an existing geometry.
std::string Info() const override
Turn back information as a string.
Definition: penalty_frictionless_mortar_contact_condition.h:353
typename BaseType::GeneralVariables GeneralVariables
Type definition for general variables.
Definition: penalty_frictionless_mortar_contact_condition.h:78
typename BaseType::BelongType BelongType
Type definition for belong type.
Definition: penalty_frictionless_mortar_contact_condition.h:90
PenaltyMethodFrictionlessMortarContactCondition()
Default constructor.
Definition: penalty_frictionless_mortar_contact_condition.h:153
~PenaltyMethodFrictionlessMortarContactCondition() override
Destructor.
typename BaseType::DerivativeDataType DerivativeDataType
Type definition for derivative data type.
Definition: penalty_frictionless_mortar_contact_condition.h:102
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
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Properties PropertiesType
Definition: regenerate_pfem_pressure_conditions_process.h:26
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
def load(f)
Definition: ode_solve.py:307