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.
ALM_frictional_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 
23 namespace Kratos
24 {
25 
28 
32 
33  using PointType = Point;
34  using GeometryType = Geometry<Node>;
35  using GeometryPointType = Geometry<PointType>;
38 
42 
46 
50 
64 template< std::size_t TDim, std::size_t TNumNodes, bool TNormalVariation, std::size_t TNumNodesMaster = TNumNodes>
65 class KRATOS_API(CONTACT_STRUCTURAL_MECHANICS_APPLICATION) AugmentedLagrangianMethodFrictionalMortarContactCondition
66  : public MortarContactCondition<TDim, TNumNodes, FrictionalCase::FRICTIONAL, TNormalVariation, TNumNodesMaster>
67 {
68 public:
71 
74 
77 
80 
83 
85  using MortarConditionMatrices = typename BaseType::MortarConditionMatrices;
86 
88  using GeneralVariables = typename BaseType::GeneralVariables;
89 
91  using IntegrationUtility = typename BaseType::IntegrationUtility;
92 
94  using DerivativesUtilitiesType = typename BaseType::DerivativesUtilitiesType;
95 
97  using BelongType = typename BaseType::BelongType;
98 
100  using ConditionArrayListType = typename BaseType::ConditionArrayListType;
101 
104 
107 
110 
113 
115  using GeometryPointerType = typename ConditionBaseType::GeometryType::Pointer;
116 
119 
122 
124  using PropertiesPointerType = typename PropertiesType::Pointer;
125 
128 
131 
134 
137 
140 
143 
145  static constexpr IndexType MatrixSize = TDim * (TNumNodes + TNumNodes + TNumNodesMaster);
146 
148  static constexpr IndexType StepSlip = TNormalVariation ? 0 : 1;
149 
153 
156  : BaseType()
157  {
158  }
159 
160  // Constructor 1
162  IndexType NewId,
163  GeometryPointerType pGeometry
164  ):BaseType(NewId, pGeometry)
165  {
166  }
167 
168  // Constructor 2
170  IndexType NewId,
171  GeometryPointerType pGeometry,
172  PropertiesPointerType pProperties
173  ):BaseType( NewId, pGeometry, pProperties )
174  {
175  }
176 
177  // Constructor 3
179  IndexType NewId,
180  GeometryPointerType pGeometry,
181  PropertiesPointerType pProperties,
182  GeometryType::Pointer pMasterGeometry
183  ):BaseType( NewId, pGeometry, pProperties, pMasterGeometry )
184  {
185  }
186 
189  {
190  }
191 
194 
198 
199 
203 
207  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
208 
213  void InitializeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
214 
219  void FinalizeSolutionStep(const ProcessInfo& rCurrentProcessInfo) override;
220 
228  Condition::Pointer Create(
229  IndexType NewId,
230  NodesArrayType const& rThisNodes,
231  PropertiesPointerType pProperties
232  ) const override;
233 
241  Condition::Pointer Create(
242  IndexType NewId,
243  GeometryPointerType pGeom,
244  PropertiesPointerType pProperties
245  ) const override;
246 
255  Condition::Pointer Create(
256  IndexType NewId,
257  GeometryPointerType pGeom,
258  PropertiesPointerType pProperties,
259  GeometryPointerType pMasterGeom
260  ) const override;
261 
272  void AddExplicitContribution(const ProcessInfo& rCurrentProcessInfo) override;
273 
274  /********************************************************************************/
275  /**************** METHODS TO CALCULATE MORTAR CONDITION MATRICES ****************/
276  /********************************************************************************/
277 
289  PairedCondition* pCondition,
290  const MortarBaseConditionMatrices& rPreviousMortarOperators,
292  Vector& rLocalRHS,
293  const MortarConditionMatrices& rMortarConditionMatrices,
294  const DerivativeDataType& rDerivativeData,
295  const IndexType rActiveInactive,
296  const ProcessInfo& rCurrentProcessInfo
297  );
298 
299  /******************************************************************/
300  /********** AUXILLIARY METHODS FOR GENERAL CALCULATIONS ***********/
301  /******************************************************************/
302 
308  void EquationIdVector(
309  EquationIdVectorType& rResult,
310  const ProcessInfo& rCurrentProcessInfo
311  ) const override;
312 
318  void GetDofList(
319  DofsVectorType& rConditionalDofList,
320  const ProcessInfo& rCurrentProcessInfo
321  ) const override;
322 
330  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
331 
335 
339 
343 
345  std::string Info() const override
346  {
347  std::stringstream buffer;
348  buffer << "AugmentedLagrangianMethodFrictionalMortarContactCondition #" << this->Id();
349  return buffer.str();
350  }
351 
353  void PrintInfo(std::ostream& rOStream) const override
354  {
355  rOStream << "AugmentedLagrangianMethodFrictionalMortarContactCondition #" << this->Id();
356  }
357 
359  void PrintData(std::ostream& rOStream) const override
360  {
361  PrintInfo(rOStream);
362  this->GetParentGeometry().PrintData(rOStream);
363  this->GetPairedGeometry().PrintData(rOStream);
364  }
365 
369 
371 
372 protected:
375 
379 
380  bool mPreviousMortarOperatorsInitialized = false;
381 
383 
384  // TODO: Define the "CL" or friction law to compute this. Or do it nodally
385 
389 
393 
394  /********************************************************************************/
395  /**************** METHODS TO CALCULATE MORTAR CONDITION MATRICES ****************/
396  /********************************************************************************/
397 
406  Matrix& rLocalLHS,
407  const MortarConditionMatrices& rMortarConditionMatrices,
408  const DerivativeDataType& rDerivativeData,
409  const IndexType rActiveInactive,
410  const ProcessInfo& rCurrentProcessInfo
411  ) override;
412 
420  void CalculateLocalRHS(
421  Vector& rLocalRHS,
422  const MortarConditionMatrices& rMortarConditionMatrices,
423  const DerivativeDataType& rDerivativeData,
424  const IndexType rActiveInactive,
425  const ProcessInfo& rCurrentProcessInfo
426  ) override;
427 
428  /******************************************************************/
429  /********** AUXILLIARY METHODS FOR GENERAL CALCULATIONS ***********/
430  /******************************************************************/
431 
437  IndexType GetActiveInactiveValue(const GeometryType& CurrentGeometry) const override
438  {
439  IndexType value = 0;
440  for (IndexType i_node = 0; i_node < TNumNodes; ++i_node) {
441  if (CurrentGeometry[i_node].Is(ACTIVE) == true) {
442  if (CurrentGeometry[i_node].Is(SLIP) == true)
443  value += std::pow(3, i_node);
444  else
445  value += 2 * std::pow(3, i_node);
446  }
447  }
448 
449  return value;
450  }
451 
457  {
458  // The friction coefficient
459  array_1d<double, TNumNodes> friction_coeffient_vector;
460  auto& r_geometry = this->GetParentGeometry();
461 
462  for (std::size_t i_node = 0; i_node < TNumNodes; ++i_node) {
463  friction_coeffient_vector[i_node] = r_geometry[i_node].GetValue(FRICTION_COEFFICIENT);
464  }
465 
466  // TODO: Define the "CL" or friction law to compute this
467 
468  return friction_coeffient_vector;
469  }
470 
474 
478 
482 
484 private:
487 
491 
495 
499 
504  void ComputePreviousMortarOperators(const ProcessInfo& rCurrentProcessInfo);
505 
509 
513 
517 
518  // Serialization
519 
520  friend class Serializer;
521 
522  void save(Serializer& rSerializer) const override
523  {
525  rSerializer.save("PreviousMortarOperatorsInitialized", mPreviousMortarOperatorsInitialized);
526  rSerializer.save("PreviousMortarOperators", mPreviousMortarOperators);
527  }
528 
529  void load(Serializer& rSerializer) override
530  {
531  KRATOS_SERIALIZE_LOAD_BASE_CLASS( rSerializer, BaseType );
532  rSerializer.load("PreviousMortarOperatorsInitialized", mPreviousMortarOperatorsInitialized);
533  rSerializer.load("PreviousMortarOperators", mPreviousMortarOperators);
534  }
535 
537 
538 }; // Class AugmentedLagrangianMethodFrictionalMortarContactCondition
539 
541 
544 
548 
550 
551 }// namespace Kratos.
AugmentedLagrangianMethodFrictionalMortarContactCondition.
Definition: ALM_frictional_mortar_contact_condition.h:67
typename ConditionBaseType::IndexType IndexType
Type for the index type used in the condition.
Definition: ALM_frictional_mortar_contact_condition.h:112
AugmentedLagrangianMethodFrictionalMortarContactCondition(AugmentedLagrangianMethodFrictionalMortarContactCondition const &rOther)
Copy constructor.
Definition: ALM_frictional_mortar_contact_condition.h:188
AugmentedLagrangianMethodFrictionalMortarContactCondition()
Default constructor.
Definition: ALM_frictional_mortar_contact_condition.h:155
std::string Info() const override
Turn back information as a string.
Definition: ALM_frictional_mortar_contact_condition.h:345
AugmentedLagrangianMethodFrictionalMortarContactCondition(IndexType NewId, GeometryPointerType pGeometry)
Definition: ALM_frictional_mortar_contact_condition.h:161
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: ALM_frictional_mortar_contact_condition.h:359
Condition::Pointer Create(IndexType NewId, GeometryPointerType pGeom, PropertiesPointerType pProperties, GeometryPointerType pMasterGeom) const override
Creates a new element pointer from an existing geometry.
typename BaseType::DerivativesUtilitiesType DerivativesUtilitiesType
Type for the derivatives utilities used in the mortar contact condition.
Definition: ALM_frictional_mortar_contact_condition.h:94
typename BaseType::IntegrationUtility IntegrationUtility
Type for the integration utility used in the mortar contact condition.
Definition: ALM_frictional_mortar_contact_condition.h:91
AugmentedLagrangianMethodFrictionalMortarContactCondition(IndexType NewId, GeometryPointerType pGeometry, PropertiesPointerType pProperties)
Definition: ALM_frictional_mortar_contact_condition.h:169
typename ConditionBaseType::GeometryType::Pointer GeometryPointerType
Pointer type for the geometry of the condition.
Definition: ALM_frictional_mortar_contact_condition.h:115
typename BaseType::ConditionArrayListType ConditionArrayListType
Type for the array list of conditions used in the mortar contact condition.
Definition: ALM_frictional_mortar_contact_condition.h:100
MortarBaseConditionMatrices mPreviousMortarOperators
In order to know iw we need to initialize the previous operators.
Definition: ALM_frictional_mortar_contact_condition.h:382
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: ALM_frictional_mortar_contact_condition.h:353
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(AugmentedLagrangianMethodFrictionalMortarContactCondition)
Counted pointer of AugmentedLagrangianMethodFrictionalMortarContactCondition.
AugmentedLagrangianMethodFrictionalMortarContactCondition(IndexType NewId, GeometryPointerType pGeometry, PropertiesPointerType pProperties, GeometryType::Pointer pMasterGeometry)
Definition: ALM_frictional_mortar_contact_condition.h:178
typename BaseType::GeneralVariables GeneralVariables
Type for the general variables used in the mortar contact condition.
Definition: ALM_frictional_mortar_contact_condition.h:88
static void StaticCalculateLocalRHS(PairedCondition *pCondition, const MortarBaseConditionMatrices &rPreviousMortarOperators, const array_1d< double, TNumNodes > &mu, Vector &rLocalRHS, const MortarConditionMatrices &rMortarConditionMatrices, const DerivativeDataType &rDerivativeData, const IndexType rActiveInactive, const ProcessInfo &rCurrentProcessInfo)
Calculates the local contibution of the RHS.
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 std::conditional< TDim==2, LineType, TriangleType >::type DecompositionType
Type for the decomposition based on the dimension.
Definition: ALM_frictional_mortar_contact_condition.h:139
typename BaseType::MortarConditionMatrices MortarConditionMatrices
Type for the matrices used in the mortar contact condition.
Definition: ALM_frictional_mortar_contact_condition.h:85
typename PropertiesType::Pointer PropertiesPointerType
Pointer type for the properties of the condition.
Definition: ALM_frictional_mortar_contact_condition.h:124
array_1d< double, TNumNodes > GetFrictionCoefficient()
This method returns a vector containing the friction coefficients.
Definition: ALM_frictional_mortar_contact_condition.h:456
typename BaseType::BelongType BelongType
Type for the belong type used in the mortar contact condition.
Definition: ALM_frictional_mortar_contact_condition.h:97
IndexType GetActiveInactiveValue(const GeometryType &CurrentGeometry) const override
Returns a value depending of the active/inactive set.
Definition: ALM_frictional_mortar_contact_condition.h:437
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 class is a derived class of DerivativeData.
Definition: mortar_classes.h:934
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
An two node 2D line geometry with linear shape functions.
Definition: line_2d_2.h:65
MortarContactCondition.
Definition: mortar_contact_condition.h:78
This is a base class for the conditions paired.
Definition: paired_condition.h:53
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
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
#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
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
Properties PropertiesType
Definition: regenerate_pfem_pressure_conditions_process.h:26
GeometryData::IntegrationMethod IntegrationMethod
Type definition for integration methods.
Definition: exact_mortar_segmentation_utility.h:57
Geometry< PointType > GeometryPointType
Definition: exact_mortar_segmentation_utility.h:54
Geometry< Node > GeometryType
The definition of the geometry.
Definition: mortar_classes.h:37
ModelPart::NodesContainerType NodesArrayType
Definition: gid_gauss_point_container.h:42
mu
Definition: generate_frictional_mortar_condition.py:127
type
Definition: generate_gid_list_file.py:35
def load(f)
Definition: ode_solve.py:307
Configure::PointType PointType
Definition: transfer_utility.h:245