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.
displacement_lagrangemultiplier_contact_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
24 
25 namespace Kratos
26 {
29 
32 
36 
40 
44 
47 
57 template< class TSparseSpace,
58  class TDenseSpace >
60  : public ConvergenceCriteria< TSparseSpace, TDenseSpace >
61 {
62 public:
63 
66 
69 
71  KRATOS_DEFINE_LOCAL_FLAG( ENSURE_CONTACT );
72  KRATOS_DEFINE_LOCAL_FLAG( PRINTING_OUTPUT );
73  KRATOS_DEFINE_LOCAL_FLAG( TABLE_IS_INITIALIZED );
74  KRATOS_DEFINE_LOCAL_FLAG( ROTATION_DOF_IS_CONSIDERED );
75 
78 
81 
84 
87 
90 
92  using SparseSpaceType = TSparseSpace;
93 
95  using TablePrinterPointerType = TableStreamUtility::Pointer;
96 
98  using IndexType = std::size_t;
99 
101  static constexpr double Tolerance = std::numeric_limits<double>::epsilon();
102 
106 
111  : BaseType()
112  {
113  }
114 
120  : BaseType()
121  {
122  // Validate and assign defaults
123  ThisParameters = this->ValidateAndAssignParameters(ThisParameters, this->GetDefaultParameters());
124  this->AssignSettings(ThisParameters);
125  }
126 
140  const double DispRatioTolerance,
141  const double DispAbsTolerance,
142  const double RotRatioTolerance,
143  const double RotAbsTolerance,
144  const double LMRatioTolerance,
145  const double LMAbsTolerance,
146  const bool EnsureContact = false,
147  const bool PrintingOutput = false
148  )
149  : BaseType()
150  {
151  // Set local flags
152  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::ENSURE_CONTACT, EnsureContact);
153  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::PRINTING_OUTPUT, PrintingOutput);
154  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::TABLE_IS_INITIALIZED, false);
155  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED, false);
156 
157  // The displacement solution
158  mDispRatioTolerance = DispRatioTolerance;
159  mDispAbsTolerance = DispAbsTolerance;
160 
161  // The rotation solution
162  mRotRatioTolerance = RotRatioTolerance;
163  mRotAbsTolerance = RotAbsTolerance;
164 
165  // The contact solution
166  mLMRatioTolerance = LMRatioTolerance;
167  mLMAbsTolerance = LMAbsTolerance;
168  }
169 
170  // Copy constructor.
172  :BaseType(rOther)
173  ,mOptions(rOther.mOptions)
174  ,mDispRatioTolerance(rOther.mDispRatioTolerance)
175  ,mDispAbsTolerance(rOther.mDispAbsTolerance)
176  ,mRotRatioTolerance(rOther.mRotRatioTolerance)
177  ,mRotAbsTolerance(rOther.mRotAbsTolerance)
178  ,mLMRatioTolerance(rOther.mLMRatioTolerance)
179  ,mLMAbsTolerance(rOther.mLMAbsTolerance)
180  {
181  }
182 
185 
189 
193 
198  typename BaseType::Pointer Create(Parameters ThisParameters) const override
199  {
200  return Kratos::make_shared<ClassType>(ThisParameters);
201  }
202 
213  ModelPart& rModelPart,
214  DofsArrayType& rDofSet,
215  const TSystemMatrixType& rA,
216  const TSystemVectorType& rDx,
217  const TSystemVectorType& rb
218  ) override
219  {
220  if (SparseSpaceType::Size(rDx) != 0) { //if we are solving for something
221  // Initialize
222  double disp_solution_norm = 0.0, rot_solution_norm = 0.0, lm_solution_norm = 0.0, disp_increase_norm = 0.0, rot_increase_norm = 0.0, lm_increase_norm = 0.0;
223  IndexType disp_dof_num(0),rot_dof_num(0),lm_dof_num(0);
224 
225  // Auxiliary values
226  struct AuxValues {
227  std::size_t dof_id = 0;
228  double dof_value = 0.0, dof_incr = 0.0;
229  };
230 
231  // The number of active dofs
232  const std::size_t number_active_dofs = rb.size();
233 
234  // Auxiliary displacement DoF check
235  const std::function<bool(const VariableData&)> check_without_rot =
236  [](const VariableData& rCurrVar) -> bool {return true;};
237  const std::function<bool(const VariableData&)> check_with_rot =
238  [](const VariableData& rCurrVar) -> bool {return ((rCurrVar == DISPLACEMENT_X) || (rCurrVar == DISPLACEMENT_Y) || (rCurrVar == DISPLACEMENT_Z));};
239  const auto* p_check_disp = (mOptions.Is(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED)) ? &check_with_rot : &check_without_rot;
240 
241  // Loop over Dofs
243  std::tie(disp_solution_norm, rot_solution_norm, lm_solution_norm, disp_increase_norm, rot_increase_norm, lm_increase_norm, disp_dof_num, rot_dof_num, lm_dof_num) = block_for_each<NineReduction>(rDofSet, AuxValues(), [this,p_check_disp,&number_active_dofs,&rDx](Dof<double>& rDof, AuxValues& aux_values) {
244  aux_values.dof_id = rDof.EquationId();
245 
246  // Check dof id is solved
247  if (aux_values.dof_id < number_active_dofs) {
248  if (mActiveDofs[aux_values.dof_id] == 1) {
249  aux_values.dof_value = rDof.GetSolutionStepValue(0);
250  aux_values.dof_incr = rDx[aux_values.dof_id];
251 
252  const auto& r_curr_var = rDof.GetVariable();
253  if ((r_curr_var == VECTOR_LAGRANGE_MULTIPLIER_X) || (r_curr_var == VECTOR_LAGRANGE_MULTIPLIER_Y) || (r_curr_var == VECTOR_LAGRANGE_MULTIPLIER_Z) || (r_curr_var == LAGRANGE_MULTIPLIER_CONTACT_PRESSURE)) {
254  return std::make_tuple(0.0,0.0,std::pow(aux_values.dof_value, 2),0.0,0.0,std::pow(aux_values.dof_incr, 2),0,0,1);
255  } else if ((*p_check_disp)(r_curr_var)) {
256  return std::make_tuple(std::pow(aux_values.dof_value, 2),0.0,0.0,std::pow(aux_values.dof_incr, 2),0.0,0.0,1,0,0);
257  } else { // We will assume is rotation dof
258  KRATOS_DEBUG_ERROR_IF_NOT((r_curr_var == ROTATION_X) || (r_curr_var == ROTATION_Y) || (r_curr_var == ROTATION_Z)) << "Variable must be a ROTATION and it is: " << r_curr_var.Name() << std::endl;
259  return std::make_tuple(0.0,std::pow(aux_values.dof_value, 2),0.0,0.0,std::pow(aux_values.dof_incr, 2),0.0,0,1,0);
260  }
261  }
262  }
263  return std::make_tuple(0.0,0.0,0.0,0.0,0.0,0.0,0,0,0);
264  });
265 
266  if(disp_increase_norm < Tolerance) disp_increase_norm = 1.0;
267  if(rot_increase_norm < Tolerance) rot_increase_norm = 1.0;
268  if(lm_increase_norm < Tolerance) lm_increase_norm = 1.0;
269  if(disp_solution_norm < Tolerance) disp_solution_norm = 1.0;
270 
271  KRATOS_ERROR_IF(mOptions.Is(DisplacementLagrangeMultiplierContactCriteria::ENSURE_CONTACT) && lm_solution_norm < Tolerance) << "WARNING::CONTACT LOST::ARE YOU SURE YOU ARE SUPPOSED TO HAVE CONTACT?" << std::endl;
272 
273  const double disp_ratio = std::sqrt(disp_increase_norm/disp_solution_norm);
274  const double rot_ratio = std::sqrt(rot_increase_norm/rot_solution_norm);
275  const double lm_ratio = lm_solution_norm > Tolerance ? std::sqrt(lm_increase_norm/lm_solution_norm) : 0.0;
276 
277  const double disp_abs = std::sqrt(disp_increase_norm)/static_cast<double>(disp_dof_num);
278  const double rot_abs = std::sqrt(rot_increase_norm)/static_cast<double>(rot_dof_num);
279  const double lm_abs = std::sqrt(lm_increase_norm)/static_cast<double>(lm_dof_num);
280 
281  // The process info of the model part
282  ProcessInfo& r_process_info = rModelPart.GetProcessInfo();
283 
284  // We print the results // TODO: Replace for the new log
285  if (rModelPart.GetCommunicator().MyPID() == 0 && this->GetEchoLevel() > 0) {
286  if (r_process_info.Has(TABLE_UTILITY)) {
287  std::cout.precision(4);
288  TablePrinterPointerType p_table = r_process_info[TABLE_UTILITY];
289  auto& r_table = p_table->GetTable();
290  if (mOptions.Is(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
291  r_table << disp_ratio << mDispRatioTolerance << disp_abs << mDispAbsTolerance << rot_ratio << mRotRatioTolerance << rot_abs << mRotAbsTolerance << lm_ratio << mLMRatioTolerance << lm_abs << mLMAbsTolerance;
292  } else {
293  r_table << disp_ratio << mDispRatioTolerance << disp_abs << mDispAbsTolerance << lm_ratio << mLMRatioTolerance << lm_abs << mLMAbsTolerance;
294  }
295  } else {
296  std::cout.precision(4);
297  if (mOptions.IsNot(DisplacementLagrangeMultiplierContactCriteria::PRINTING_OUTPUT)) {
298  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << BOLDFONT("DoF ONVERGENCE CHECK") << "\tSTEP: " << r_process_info[STEP] << "\tNL ITERATION: " << r_process_info[NL_ITERATION_NUMBER] << std::endl;
299  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << BOLDFONT("\tDISPLACEMENT: RATIO = ") << disp_ratio << BOLDFONT(" EXP.RATIO = ") << mDispRatioTolerance << BOLDFONT(" ABS = ") << disp_abs << BOLDFONT(" EXP.ABS = ") << mDispAbsTolerance << std::endl;
300  if (mOptions.Is(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
301  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << BOLDFONT("\tROTATION: RATIO = ") << rot_ratio << BOLDFONT(" EXP.RATIO = ") << mRotRatioTolerance << BOLDFONT(" ABS = ") << rot_abs << BOLDFONT(" EXP.ABS = ") << mRotAbsTolerance << std::endl;
302  }
303  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << BOLDFONT(" LAGRANGE MUL:\tRATIO = ") << lm_ratio << BOLDFONT(" EXP.RATIO = ") << mLMRatioTolerance << BOLDFONT(" ABS = ") << lm_abs << BOLDFONT(" EXP.ABS = ") << mLMAbsTolerance << std::endl;
304  } else {
305  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << "DoF ONVERGENCE CHECK" << "\tSTEP: " << r_process_info[STEP] << "\tNL ITERATION: " << r_process_info[NL_ITERATION_NUMBER] << std::endl;
306  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << "\tDISPLACEMENT: RATIO = " << disp_ratio << " EXP.RATIO = " << mDispRatioTolerance << " ABS = " << disp_abs << " EXP.ABS = " << mDispAbsTolerance << std::endl;
307  if (mOptions.Is(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
308  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << "\tROTATION: RATIO = " << rot_ratio << " EXP.RATIO = " << mRotRatioTolerance << " ABS = " << rot_abs << " EXP.ABS = " << mRotAbsTolerance << std::endl;
309  }
310  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << " LAGRANGE MUL:\tRATIO = " << lm_ratio << " EXP.RATIO = " << mLMRatioTolerance << " ABS = " << lm_abs << " EXP.ABS = " << mLMAbsTolerance << std::endl;
311  }
312  }
313  }
314 
315  // We check if converged
316  const bool disp_converged = (disp_ratio <= mDispRatioTolerance || disp_abs <= mDispAbsTolerance);
317  const bool rot_converged = (mOptions.Is(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED)) ? (rot_ratio <= mRotRatioTolerance || rot_abs <= mRotAbsTolerance) : true;
318  const bool lm_converged = (mOptions.IsNot(DisplacementLagrangeMultiplierContactCriteria::ENSURE_CONTACT) && lm_solution_norm < Tolerance) ? true : (lm_ratio <= mLMRatioTolerance || lm_abs <= mLMAbsTolerance);
319 
320  if (disp_converged && rot_converged && lm_converged) {
321  if (rModelPart.GetCommunicator().MyPID() == 0 && this->GetEchoLevel() > 0) {
322  if (r_process_info.Has(TABLE_UTILITY)) {
323  TablePrinterPointerType p_table = r_process_info[TABLE_UTILITY];
324  auto& r_table = p_table->GetTable();
325  if (mOptions.IsNot(DisplacementLagrangeMultiplierContactCriteria::PRINTING_OUTPUT))
326  r_table << BOLDFONT(FGRN(" Achieved"));
327  else
328  r_table << "Achieved";
329  } else {
330  if (mOptions.IsNot(DisplacementLagrangeMultiplierContactCriteria::PRINTING_OUTPUT))
331  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << BOLDFONT("\tDoF") << " convergence is " << BOLDFONT(FGRN("achieved")) << std::endl;
332  else
333  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << "\tDoF convergence is achieved" << std::endl;
334  }
335  }
336  return true;
337  } else {
338  if (rModelPart.GetCommunicator().MyPID() == 0 && this->GetEchoLevel() > 0) {
339  if (r_process_info.Has(TABLE_UTILITY)) {
340  TablePrinterPointerType p_table = r_process_info[TABLE_UTILITY];
341  auto& r_table = p_table->GetTable();
342  if (mOptions.IsNot(DisplacementLagrangeMultiplierContactCriteria::PRINTING_OUTPUT))
343  r_table << BOLDFONT(FRED(" Not achieved"));
344  else
345  r_table << "Not achieved";
346  } else {
347  if (mOptions.IsNot(DisplacementLagrangeMultiplierContactCriteria::PRINTING_OUTPUT))
348  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << BOLDFONT("\tDoF") << " convergence is " << BOLDFONT(FRED(" not achieved")) << std::endl;
349  else
350  KRATOS_INFO("DisplacementLagrangeMultiplierContactCriteria") << "\tDoF convergence is not achieved" << std::endl;
351  }
352  }
353  return false;
354  }
355  }
356  else // In this case all the displacements are imposed!
357  return true;
358  }
359 
364  void Initialize( ModelPart& rModelPart ) override
365  {
366  // Initialize
367  BaseType::mConvergenceCriteriaIsInitialized = true;
368 
369  // Check rotation dof
370  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED, ContactUtilities::CheckModelPartHasRotationDoF(rModelPart));
371 
372  // Initialize header
373  ProcessInfo& r_process_info = rModelPart.GetProcessInfo();
374  if (r_process_info.Has(TABLE_UTILITY) && mOptions.IsNot(DisplacementLagrangeMultiplierContactCriteria::TABLE_IS_INITIALIZED)) {
375  TablePrinterPointerType p_table = r_process_info[TABLE_UTILITY];
376  auto& r_table = p_table->GetTable();
377  r_table.AddColumn("DP RATIO", 10);
378  r_table.AddColumn("EXP. RAT", 10);
379  r_table.AddColumn("ABS", 10);
380  r_table.AddColumn("EXP. ABS", 10);
381  if (mOptions.Is(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
382  r_table.AddColumn("RT RATIO", 10);
383  r_table.AddColumn("EXP. RAT", 10);
384  r_table.AddColumn("ABS", 10);
385  r_table.AddColumn("EXP. ABS", 10);
386  }
387  r_table.AddColumn("LM RATIO", 10);
388  r_table.AddColumn("EXP. RAT", 10);
389  r_table.AddColumn("ABS", 10);
390  r_table.AddColumn("EXP. ABS", 10);
391  r_table.AddColumn("CONVERGENCE", 15);
392  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::TABLE_IS_INITIALIZED, true);
393  }
394  }
395 
405  ModelPart& rModelPart,
406  DofsArrayType& rDofSet,
407  const TSystemMatrixType& rA,
408  const TSystemVectorType& rDx,
409  const TSystemVectorType& rb
410  ) override
411  {
412  // Filling mActiveDofs when MPC exist
413  ConstraintUtilities::ComputeActiveDofs(rModelPart, mActiveDofs, rDofSet);
414  }
415 
421  {
422  Parameters default_parameters = Parameters(R"(
423  {
424  "name" : "displacement_lagrangemultiplier_contact_criteria",
425  "ensure_contact" : false,
426  "print_convergence_criterion" : false,
427  "displacement_relative_tolerance" : 1.0e-4,
428  "displacement_absolute_tolerance" : 1.0e-9,
429  "rotation_relative_tolerance" : 1.0e-4,
430  "rotation_absolute_tolerance" : 1.0e-9,
431  "contact_displacement_relative_tolerance" : 1.0e-4,
432  "contact_displacement_absolute_tolerance" : 1.0e-9
433  })");
434 
435  // Getting base class default parameters
436  const Parameters base_default_parameters = BaseType::GetDefaultParameters();
437  default_parameters.RecursivelyAddMissingParameters(base_default_parameters);
438  return default_parameters;
439  }
440 
445  static std::string Name()
446  {
447  return "displacement_lagrangemultiplier_contact_criteria";
448  }
449 
453 
457 
461 
463  std::string Info() const override
464  {
465  return "DisplacementLagrangeMultiplierContactCriteria";
466  }
467 
469  void PrintInfo(std::ostream& rOStream) const override
470  {
471  rOStream << Info();
472  }
473 
475  void PrintData(std::ostream& rOStream) const override
476  {
477  rOStream << Info();
478  }
479 
481 protected:
484 
488 
492 
496 
501  void AssignSettings(const Parameters ThisParameters) override
502  {
503  BaseType::AssignSettings(ThisParameters);
504 
505  // The displacement solution
506  mDispRatioTolerance = ThisParameters["displacement_relative_tolerance"].GetDouble();
507  mDispAbsTolerance = ThisParameters["displacement_absolute_tolerance"].GetDouble();
508 
509  // The rotation solution
510  mRotRatioTolerance = ThisParameters["rotation_relative_tolerance"].GetDouble();
511  mRotAbsTolerance = ThisParameters["rotation_absolute_tolerance"].GetDouble();
512 
513  // The contact solution
514  mLMRatioTolerance = ThisParameters["contact_displacement_relative_tolerance"].GetDouble();
515  mLMAbsTolerance = ThisParameters["contact_displacement_absolute_tolerance"].GetDouble();
516 
517  // Set local flags
518  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::ENSURE_CONTACT, ThisParameters["ensure_contact"].GetBool());
519  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::PRINTING_OUTPUT, ThisParameters["print_convergence_criterion"].GetBool());
520  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::TABLE_IS_INITIALIZED, false);
521  mOptions.Set(DisplacementLagrangeMultiplierContactCriteria::ROTATION_DOF_IS_CONSIDERED, false);
522  }
523 
525 private:
528 
532 
533  Flags mOptions;
534 
535  double mDispRatioTolerance;
536  double mDispAbsTolerance;
537 
538  double mRotRatioTolerance;
539  double mRotAbsTolerance;
540 
541  double mLMRatioTolerance;
542  double mLMAbsTolerance;
543 
544  std::vector<int> mActiveDofs;
545 
547 }; // Kratos DisplacementLagrangeMultiplierContactCriteria
548 
551 
553 template<class TSparseSpace, class TDenseSpace>
554 const Kratos::Flags DisplacementLagrangeMultiplierContactCriteria<TSparseSpace, TDenseSpace>::ENSURE_CONTACT(Kratos::Flags::Create(0));
555 template<class TSparseSpace, class TDenseSpace>
556 const Kratos::Flags DisplacementLagrangeMultiplierContactCriteria<TSparseSpace, TDenseSpace>::PRINTING_OUTPUT(Kratos::Flags::Create(1));
557 template<class TSparseSpace, class TDenseSpace>
558 const Kratos::Flags DisplacementLagrangeMultiplierContactCriteria<TSparseSpace, TDenseSpace>::TABLE_IS_INITIALIZED(Kratos::Flags::Create(2));
559 template<class TSparseSpace, class TDenseSpace>
560 const Kratos::Flags DisplacementLagrangeMultiplierContactCriteria<TSparseSpace, TDenseSpace>::ROTATION_DOF_IS_CONSIDERED(Kratos::Flags::Create(3));
561 }
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
virtual int MyPID() const
Definition: communicator.cpp:91
static bool CheckModelPartHasRotationDoF(ModelPart &rModelPart)
This method checks that the modelpart has a rotation DoF.
Definition: contact_utilities.cpp:147
This is the base class to define the different convergence criterion considered.
Definition: convergence_criteria.h:58
int GetEchoLevel()
This returns the level of echo for the solving strategy.
Definition: convergence_criteria.h:209
virtual Parameters ValidateAndAssignParameters(Parameters ThisParameters, const Parameters DefaultParameters) const
This method validate and assign default parameters.
Definition: convergence_criteria.h:466
TSparseSpace::MatrixType TSystemMatrixType
Matrix type definition.
Definition: convergence_criteria.h:72
ModelPart::DofsArrayType DofsArrayType
DoF array type definition.
Definition: convergence_criteria.h:81
TSparseSpace::VectorType TSystemVectorType
Vector type definition.
Definition: convergence_criteria.h:74
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
Convergence criteria for contact problems.
Definition: displacement_lagrangemultiplier_contact_criteria.h:61
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
EquationIdType EquationId() const
Definition: dof.h:324
Definition: flags.h:58
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
bool Is(Flags const &rOther) const
Definition: flags.h:274
static Flags Create(IndexType ThisPosition, bool Value=true)
Definition: flags.h:138
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Communicator & GetCommunicator()
Definition: model_part.h:1821
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
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
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
utility function to do a sum reduction
Definition: reduction_utilities.h:68
static IndexType Size(VectorType const &rV)
return size of vector rV
Definition: ublas_space.h:190
This class is the base of variables and variable's components which contains their common data.
Definition: variable_data.h:49
#define FGRN(x)
Definition: color_utilities.h:27
#define FRED(x)
Definition: color_utilities.h:26
#define BOLDFONT(x)
Definition: color_utilities.h:34
std::size_t IndexType
The index type definition.
Definition: displacement_lagrangemultiplier_contact_criteria.h:98
std::string Info() const override
Turn back information as a string.
Definition: displacement_lagrangemultiplier_contact_criteria.h:463
TableStreamUtility::Pointer TablePrinterPointerType
The table stream definition TODO: Replace by logger.
Definition: displacement_lagrangemultiplier_contact_criteria.h:95
static constexpr double Tolerance
The epsilon tolerance definition.
Definition: displacement_lagrangemultiplier_contact_criteria.h:101
void InitializeSolutionStep(ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) override
This function initializes the solution step.
Definition: displacement_lagrangemultiplier_contact_criteria.h:404
TSparseSpace SparseSpaceType
The sparse space used.
Definition: displacement_lagrangemultiplier_contact_criteria.h:92
static std::string Name()
Returns the name of the class as used in the settings (snake_case format)
Definition: displacement_lagrangemultiplier_contact_criteria.h:445
typename BaseType::TSystemMatrixType TSystemMatrixType
The sparse matrix type.
Definition: displacement_lagrangemultiplier_contact_criteria.h:86
typename BaseType::DofsArrayType DofsArrayType
The dofs array type.
Definition: displacement_lagrangemultiplier_contact_criteria.h:83
~DisplacementLagrangeMultiplierContactCriteria() override=default
Destructor.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: displacement_lagrangemultiplier_contact_criteria.h:469
DisplacementLagrangeMultiplierContactCriteria(DisplacementLagrangeMultiplierContactCriteria const &rOther)
Definition: displacement_lagrangemultiplier_contact_criteria.h:171
BaseType::Pointer Create(Parameters ThisParameters) const override
Create method.
Definition: displacement_lagrangemultiplier_contact_criteria.h:198
void AssignSettings(const Parameters ThisParameters) override
This method assigns settings to member variables.
Definition: displacement_lagrangemultiplier_contact_criteria.h:501
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: displacement_lagrangemultiplier_contact_criteria.h:475
Parameters GetDefaultParameters() const override
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: displacement_lagrangemultiplier_contact_criteria.h:420
bool PostCriteria(ModelPart &rModelPart, DofsArrayType &rDofSet, const TSystemMatrixType &rA, const TSystemVectorType &rDx, const TSystemVectorType &rb) override
Compute relative and absolute error.
Definition: displacement_lagrangemultiplier_contact_criteria.h:212
KRATOS_CLASS_POINTER_DEFINITION(DisplacementLagrangeMultiplierContactCriteria)
Pointer definition of DisplacementLagrangeMultiplierContactCriteria.
void Initialize(ModelPart &rModelPart) override
This function initialize the convergence criteria.
Definition: displacement_lagrangemultiplier_contact_criteria.h:364
typename BaseType::TSystemVectorType TSystemVectorType
The dense vector type.
Definition: displacement_lagrangemultiplier_contact_criteria.h:89
DisplacementLagrangeMultiplierContactCriteria()
Default constructor.
Definition: displacement_lagrangemultiplier_contact_criteria.h:110
DisplacementLagrangeMultiplierContactCriteria(Kratos::Parameters ThisParameters)
Default constructor. (with parameters)
Definition: displacement_lagrangemultiplier_contact_criteria.h:119
DisplacementLagrangeMultiplierContactCriteria(const double DispRatioTolerance, const double DispAbsTolerance, const double RotRatioTolerance, const double RotAbsTolerance, const double LMRatioTolerance, const double LMAbsTolerance, const bool EnsureContact=false, const bool PrintingOutput=false)
Default Constructor.
Definition: displacement_lagrangemultiplier_contact_criteria.h:139
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_INFO(label)
Definition: logger.h:250
void ComputeActiveDofs(ModelPart &rModelPart, std::vector< int > &rActiveDofs, const ModelPart::DofsArrayType &rDofSet)
This method computes the active dofs.
Definition: constraint_utilities.cpp:26
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
REACTION_CHECK_STIFFNESS_FACTOR INNER_LOOP_ITERATION DISTANCE_THRESHOLD ACTIVE_CHECK_FACTOR AUXILIAR_COORDINATES NORMAL_GAP WEIGHTED_GAP WEIGHTED_SCALAR_RESIDUAL bool
Definition: contact_structural_mechanics_application_variables.h:93
Definition: reduction_utilities.h:310