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.
mesh_tying_mortar_criteria.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
23 
24 namespace Kratos
25 {
28 
31 
35 
39 
43 
47 
54 template<class TSparseSpace, class TDenseSpace>
56  : public BaseMortarConvergenceCriteria< TSparseSpace, TDenseSpace >
57 {
58 public:
61 
64 
67 
70 
73 
76 
79 
82 
84  using TablePrinterPointerType = TableStreamUtility::Pointer;
85 
89 
94  : BaseType()
95  {
96  }
97 
103  : BaseType()
104  {
105  // Validate and assign defaults
106  ThisParameters = this->ValidateAndAssignParameters(ThisParameters, this->GetDefaultParameters());
107  this->AssignSettings(ThisParameters);
108  }
109 
112  :BaseType(rOther)
113  {
114  }
115 
118 
122 
126 
131  typename ConvergenceCriteriaBaseType::Pointer Create(Parameters ThisParameters) const override
132  {
133  return Kratos::make_shared<ClassType>(ThisParameters);
134  }
135 
146  ModelPart& rModelPart,
147  DofsArrayType& rDofSet,
148  const TSystemMatrixType& rA,
149  const TSystemVectorType& rDx,
150  const TSystemVectorType& rb
151  ) override
152  {
153  ProcessInfo& r_process_info = rModelPart.GetProcessInfo();
154  if (r_process_info.Has(TABLE_UTILITY)) {
155  TablePrinterPointerType p_table = r_process_info[TABLE_UTILITY];
156  // TODO: Add somethig if necessary
157  }
158 
159  return true;
160  }
161 
166  void Initialize(ModelPart& rModelPart) override
167  {
169 
170  ProcessInfo& r_process_info = rModelPart.GetProcessInfo();
171  if (r_process_info.Has(TABLE_UTILITY)) {
172  TablePrinterPointerType p_table = r_process_info[TABLE_UTILITY];
173  // TODO: Add somethig if necessary
174  }
175  }
176 
182  {
183  Parameters default_parameters = Parameters(R"(
184  {
185  "name" : "mesh_tying_mortar_criteria"
186  })" );
187 
188  // Getting base class default parameters
189  const Parameters base_default_parameters = BaseType::GetDefaultParameters();
190  default_parameters.RecursivelyAddMissingParameters(base_default_parameters);
191  return default_parameters;
192  }
193 
198  static std::string Name()
199  {
200  return "mesh_tying_mortar_criteria";
201  }
202 
206 
210 
214 
216  std::string Info() const override
217  {
218  return "MeshTyingMortarConvergenceCriteria";
219  }
220 
222  void PrintInfo(std::ostream& rOStream) const override
223  {
224  rOStream << Info();
225  }
226 
228  void PrintData(std::ostream& rOStream) const override
229  {
230  rOStream << Info();
231  }
232 
234 protected:
237 
241 
245 
249 
254  void AssignSettings(const Parameters ThisParameters) override
255  {
256  BaseType::AssignSettings(ThisParameters);
257  }
258 
260 
261 }; // Class MeshTyingMortarConvergenceCriteria
262 
265 
266 } // namespace Kratos
Custom convergence criteria for the mortar condition.
Definition: base_mortar_criteria.h:65
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: convergence_criteria.h:466
bool mConvergenceCriteriaIsInitialized
This "flag" is set in order to know if it is necessary to actualize the RHS.
Definition: convergence_criteria.h:448
bool Has(const Variable< TDataType > &rThisVariable) const
Checks if the data container has a value associated with a given variable.
Definition: data_value_container.h:382
Definition: mesh_tying_mortar_criteria.h:57
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
void RecursivelyAddMissingParameters(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing contain at least all parameters...
Definition: kratos_parameters.cpp:1457
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
typename BaseType::TSystemVectorType TSystemVectorType
The dense vector type.
Definition: mesh_tying_mortar_criteria.h:81
MeshTyingMortarConvergenceCriteria(MeshTyingMortarConvergenceCriteria const &rOther)
Copy constructor.
Definition: mesh_tying_mortar_criteria.h:111
std::string Info() const override
Turn back information as a string.
Definition: mesh_tying_mortar_criteria.h:216
typename BaseType::DofsArrayType DofsArrayType
The dofs array type.
Definition: base_mortar_criteria.h:85
~MeshTyingMortarConvergenceCriteria() override=default
Destructor.
MeshTyingMortarConvergenceCriteria(Kratos::Parameters ThisParameters)
Default constructor. (with parameters)
Definition: mesh_tying_mortar_criteria.h:102
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: mesh_tying_mortar_criteria.h:198
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mesh_tying_mortar_criteria.h:222
typename BaseType::TSystemMatrixType TSystemMatrixType
The sparse matrix type.
Definition: mesh_tying_mortar_criteria.h:78
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: mesh_tying_mortar_criteria.h:181
typename BaseType::DofsArrayType DofsArrayType
The dofs array type.
Definition: mesh_tying_mortar_criteria.h:75
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: mesh_tying_mortar_criteria.h:254
bool PostCriteria(ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) override
Compute relative and absolute error.
Definition: mesh_tying_mortar_criteria.h:145
void Initialize(ModelPart &rModelPart) override
This function initialize the convergence criteria.
Definition: mesh_tying_mortar_criteria.h:166
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mesh_tying_mortar_criteria.h:228
typename BaseType::TSystemMatrixType TSystemMatrixType
The sparse matrix type.
Definition: base_mortar_criteria.h:88
KRATOS_CLASS_POINTER_DEFINITION(MeshTyingMortarConvergenceCriteria)
Pointer definition of MeshTyingMortarConvergenceCriteria.
MeshTyingMortarConvergenceCriteria()
Default constructor.
Definition: mesh_tying_mortar_criteria.h:93
typename BaseType::TSystemVectorType TSystemVectorType
The dense vector type.
Definition: base_mortar_criteria.h:91
ConvergenceCriteriaBaseType::Pointer Create(Parameters ThisParameters) const override
Create method.
Definition: mesh_tying_mortar_criteria.h:131
TableStreamUtility::Pointer TablePrinterPointerType
The table stream definition TODO: Replace by logger.
Definition: mesh_tying_mortar_criteria.h:84
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: base_mortar_criteria.h:397
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: base_mortar_criteria.h:475
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21