59 template<
class TSparseSpace,
105 static constexpr
double Tolerance = std::numeric_limits<double>::epsilon();
145 const double DispRatioTolerance,
146 const double DispAbsTolerance,
147 const double RotRatioTolerance,
148 const double RotAbsTolerance,
149 const double LMNormalRatioTolerance,
150 const double LMNormalAbsTolerance,
151 const double LMTangentStickRatioTolerance,
152 const double LMTangentStickAbsTolerance,
153 const double LMTangentSlipRatioTolerance,
154 const double LMTangentSlipAbsTolerance,
155 const double NormalTangentRatio,
156 const bool EnsureContact =
false,
157 const bool PureSlip =
false,
158 const bool PrintingOutput =
false
163 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ENSURE_CONTACT, EnsureContact);
164 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PRINTING_OUTPUT, PrintingOutput);
165 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::TABLE_IS_INITIALIZED,
false);
166 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED,
false);
167 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP, PureSlip);
168 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::INITIAL_RESIDUAL_IS_SET,
false);
171 mDispRatioTolerance = DispRatioTolerance;
172 mDispAbsTolerance = DispAbsTolerance;
175 mRotRatioTolerance = RotRatioTolerance;
176 mRotAbsTolerance = RotAbsTolerance;
179 mLMNormalRatioTolerance = LMNormalRatioTolerance;
180 mLMNormalAbsTolerance = LMNormalAbsTolerance;
183 mLMTangentStickRatioTolerance = LMTangentStickRatioTolerance;
184 mLMTangentStickAbsTolerance = LMTangentStickAbsTolerance;
185 mLMTangentSlipRatioTolerance = LMTangentSlipRatioTolerance;
186 mLMTangentSlipAbsTolerance = LMTangentSlipAbsTolerance;
189 mNormalTangentRatio = NormalTangentRatio;
195 ,mOptions(rOther.mOptions)
196 ,mDispRatioTolerance(rOther.mDispRatioTolerance)
197 ,mDispAbsTolerance(rOther.mDispAbsTolerance)
198 ,mDispInitialResidualNorm(rOther.mDispInitialResidualNorm)
199 ,mDispCurrentResidualNorm(rOther.mDispCurrentResidualNorm)
200 ,mRotRatioTolerance(rOther.mRotRatioTolerance)
201 ,mRotAbsTolerance(rOther.mRotAbsTolerance)
202 ,mRotInitialResidualNorm(rOther.mRotInitialResidualNorm)
203 ,mRotCurrentResidualNorm(rOther.mRotCurrentResidualNorm)
204 ,mLMNormalRatioTolerance(rOther.mLMNormalRatioTolerance)
205 ,mLMNormalAbsTolerance(rOther.mLMNormalAbsTolerance)
206 ,mLMTangentStickRatioTolerance(rOther.mLMTangentStickRatioTolerance)
207 ,mLMTangentStickAbsTolerance(rOther.mLMTangentStickAbsTolerance)
208 ,mLMTangentSlipRatioTolerance(rOther.mLMTangentSlipRatioTolerance)
209 ,mLMTangentSlipAbsTolerance(rOther.mLMTangentSlipAbsTolerance)
210 ,mNormalTangentRatio(rOther.mNormalTangentRatio)
231 return Kratos::make_shared<ClassType>(ThisParameters);
257 double disp_residual_solution_norm = 0.0, rot_residual_solution_norm = 0.0,normal_lm_solution_norm = 0.0, normal_lm_increase_norm = 0.0, tangent_lm_stick_solution_norm = 0.0, tangent_lm_slip_solution_norm = 0.0, tangent_lm_stick_increase_norm = 0.0, tangent_lm_slip_increase_norm = 0.0;
258 IndexType disp_dof_num(0),rot_dof_num(0),lm_dof_num(0),lm_stick_dof_num(0),lm_slip_dof_num(0);
261 auto& r_nodes_array = rModelPart.
Nodes();
265 std::size_t dof_id = 0;
266 double residual_dof_value = 0.0, dof_value = 0.0, dof_incr = 0.0;
268 const bool pure_slip = mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP);
271 const std::size_t number_active_dofs = rb.size();
275 [](
const VariableData& rCurrVar) ->
bool {
return true;};
277 [](
const VariableData& rCurrVar) ->
bool {
return ((rCurrVar == DISPLACEMENT_X) || (rCurrVar == DISPLACEMENT_Y) || (rCurrVar == DISPLACEMENT_Z));};
278 const auto* p_check_disp = (mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED)) ? &check_with_rot : &check_without_rot;
281 using ThirteenReduction =
CombinedReduction<SumReduction<double>,
SumReduction<double>,
SumReduction<double>,
SumReduction<double>,
SumReduction<double>,
SumReduction<double>,
SumReduction<double>,
SumReduction<double>,
SumReduction<IndexType>,
SumReduction<IndexType>,
SumReduction<IndexType>,
SumReduction<IndexType>,
SumReduction<IndexType>>;
282 std::tie(disp_residual_solution_norm,rot_residual_solution_norm,normal_lm_solution_norm,normal_lm_increase_norm,tangent_lm_slip_solution_norm,tangent_lm_slip_increase_norm, tangent_lm_stick_solution_norm,tangent_lm_stick_increase_norm,disp_dof_num,rot_dof_num,lm_dof_num, lm_slip_dof_num, lm_stick_dof_num) = block_for_each<ThirteenReduction>(rDofSet, AuxValues(), [
this,&number_active_dofs,p_check_disp,&pure_slip,&r_nodes_array,&rb,&rDx](
Dof<double>& rDof, AuxValues& aux_values) {
287 if (aux_values.dof_id < number_active_dofs) {
288 if (mActiveDofs[aux_values.dof_id] == 1) {
289 const auto& r_curr_var = rDof.GetVariable();
290 if (r_curr_var == VECTOR_LAGRANGE_MULTIPLIER_X || r_curr_var == VECTOR_LAGRANGE_MULTIPLIER_Y || r_curr_var == VECTOR_LAGRANGE_MULTIPLIER_Z) {
292 const auto it_node = r_nodes_array.find(rDof.Id());
294 aux_values.dof_value = rDof.GetSolutionStepValue(0);
295 aux_values.dof_incr = rDx[aux_values.dof_id];
297 const double mu = it_node->GetValue(FRICTION_COEFFICIENT);
298 if (mu < std::numeric_limits<double>::epsilon()) {
299 return std::make_tuple(0.0,0.0,std::pow(aux_values.dof_value, 2),std::pow(aux_values.dof_incr, 2),0.0,0.0,0.0,0.0,0,0,1,0,0);
301 const double normal = it_node->FastGetSolutionStepValue(NORMAL)[r_curr_var.GetComponentIndex()];
302 const double normal_dof_value = aux_values.dof_value * normal;
303 const double normal_dof_incr = aux_values.dof_incr * normal;
305 if (it_node->Is(SLIP) || pure_slip) {
306 return std::make_tuple(0.0,0.0,std::pow(normal_dof_value, 2),std::pow(normal_dof_incr, 2),std::pow(aux_values.dof_value - normal_dof_value, 2),std::pow(aux_values.dof_incr - normal_dof_incr, 2),0.0,0.0,0,0,1,1,0);
308 return std::make_tuple(0.0,0.0,std::pow(normal_dof_value, 2),std::pow(normal_dof_incr, 2),0.0,0.0,std::pow(aux_values.dof_value - normal_dof_value, 2),std::pow(aux_values.dof_incr - normal_dof_incr, 2),0,0,1,0,1);
311 } else if ((*p_check_disp)(r_curr_var)) {
312 aux_values.residual_dof_value = rb[aux_values.dof_id];
313 return std::make_tuple(std::pow(aux_values.residual_dof_value, 2),0.0,0.0,0.0,0.0,0.0,0.0,0.0,1,0,0,0,0);
315 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;
316 aux_values.residual_dof_value = rb[aux_values.dof_id];
317 return std::make_tuple(0.0,std::pow(aux_values.residual_dof_value, 2),0.0,0.0,0.0,0.0,0.0,0.0,0,1,0,0,0);
321 return std::make_tuple(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,0,0,0);
324 if(normal_lm_increase_norm <
Tolerance) normal_lm_increase_norm = 1.0;
325 if(tangent_lm_stick_increase_norm <
Tolerance) tangent_lm_stick_increase_norm = 1.0;
326 if(tangent_lm_slip_increase_norm <
Tolerance) tangent_lm_slip_increase_norm = 1.0;
327 KRATOS_ERROR_IF(mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ENSURE_CONTACT) && normal_lm_solution_norm <
Tolerance) <<
"ERROR::CONTACT LOST::ARE YOU SURE YOU ARE SUPPOSED TO HAVE CONTACT?" << std::endl;
329 mDispCurrentResidualNorm = disp_residual_solution_norm;
330 mRotCurrentResidualNorm = rot_residual_solution_norm;
332 const double normal_lm_ratio = std::sqrt(normal_lm_increase_norm/normal_lm_solution_norm);
333 const double tangent_lm_slip_ratio = tangent_lm_slip_solution_norm >
Tolerance ? std::sqrt(tangent_lm_slip_increase_norm/tangent_lm_slip_solution_norm) : 0.0;
334 const double tangent_lm_stick_ratio = tangent_lm_stick_solution_norm >
Tolerance ? std::sqrt(tangent_lm_stick_increase_norm/tangent_lm_stick_solution_norm) : 0.0;
336 const double normal_lm_abs = std::sqrt(normal_lm_increase_norm)/
static_cast<double>(lm_dof_num);
337 const double tangent_lm_stick_abs = lm_stick_dof_num > 0 ? std::sqrt(tangent_lm_stick_increase_norm)/
static_cast<double>(lm_stick_dof_num) : 0.0;
338 const double tangent_lm_slip_abs = lm_slip_dof_num > 0 ? std::sqrt(tangent_lm_slip_increase_norm)/
static_cast<double>(lm_slip_dof_num) : 0.0;
340 const double normal_tangent_stick_ratio = tangent_lm_stick_abs/normal_lm_abs;
341 const double normal_tangent_slip_ratio = tangent_lm_slip_abs/normal_lm_abs;
343 double residual_disp_ratio, residual_rot_ratio;
346 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::INITIAL_RESIDUAL_IS_SET)) {
347 mDispInitialResidualNorm = (disp_residual_solution_norm <
Tolerance) ? 1.0 : disp_residual_solution_norm;
348 residual_disp_ratio = 1.0;
349 if (mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
350 mRotInitialResidualNorm = (rot_residual_solution_norm <
Tolerance) ? 1.0 : rot_residual_solution_norm;
351 residual_rot_ratio = 1.0;
353 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::INITIAL_RESIDUAL_IS_SET,
true);
357 residual_disp_ratio = mDispCurrentResidualNorm/mDispInitialResidualNorm;
360 residual_rot_ratio = mRotCurrentResidualNorm/mRotInitialResidualNorm;
363 double residual_disp_abs = mDispCurrentResidualNorm/disp_dof_num;
364 double residual_rot_abs = mRotCurrentResidualNorm/rot_dof_num;
368 if (r_process_info.Has(TABLE_UTILITY)) {
369 std::cout.precision(4);
371 auto& r_table = p_table->GetTable();
372 if (mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
373 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP)) {
374 r_table << residual_disp_ratio << mDispRatioTolerance << residual_disp_abs << mDispAbsTolerance << residual_rot_ratio << mRotRatioTolerance << residual_rot_abs << mRotAbsTolerance << normal_lm_ratio << mLMNormalRatioTolerance << normal_lm_abs << mLMNormalAbsTolerance << tangent_lm_stick_ratio << mLMTangentStickRatioTolerance << tangent_lm_stick_abs << mLMTangentSlipAbsTolerance << tangent_lm_slip_ratio << mLMTangentSlipRatioTolerance << tangent_lm_slip_abs << mLMTangentStickAbsTolerance;
376 r_table << residual_disp_ratio << mDispRatioTolerance << residual_disp_abs << mDispAbsTolerance << residual_rot_ratio << mRotRatioTolerance << residual_rot_abs << mRotAbsTolerance << normal_lm_ratio << mLMNormalRatioTolerance << normal_lm_abs << mLMNormalAbsTolerance << tangent_lm_slip_ratio << mLMTangentSlipRatioTolerance << tangent_lm_slip_abs << mLMTangentSlipAbsTolerance;
379 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP)) {
380 r_table << residual_disp_ratio << mDispRatioTolerance << residual_disp_abs << mDispAbsTolerance << normal_lm_ratio << mLMNormalRatioTolerance << normal_lm_abs << mLMNormalAbsTolerance << tangent_lm_stick_ratio << mLMTangentStickRatioTolerance << tangent_lm_stick_abs << mLMTangentSlipAbsTolerance << tangent_lm_slip_ratio << mLMTangentSlipRatioTolerance << tangent_lm_slip_abs << mLMTangentStickAbsTolerance;
382 r_table << residual_disp_ratio << mDispRatioTolerance << residual_disp_abs << mDispAbsTolerance << normal_lm_ratio << mLMNormalRatioTolerance << normal_lm_abs << mLMNormalAbsTolerance << tangent_lm_slip_ratio << mLMTangentSlipRatioTolerance << tangent_lm_slip_abs << mLMTangentSlipAbsTolerance;
386 std::cout.precision(4);
387 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PRINTING_OUTPUT)) {
388 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
BOLDFONT(
"MIXED CONVERGENCE CHECK") <<
"\tSTEP: " << r_process_info[STEP] <<
"\tNL ITERATION: " << r_process_info[NL_ITERATION_NUMBER] << std::endl << std::scientific;
389 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
BOLDFONT(
"\tDISPLACEMENT: RATIO = ") << residual_disp_ratio <<
BOLDFONT(
" EXP.RATIO = ") << mDispRatioTolerance <<
BOLDFONT(
" ABS = ") << residual_disp_abs <<
BOLDFONT(
" EXP.ABS = ") << mDispAbsTolerance << std::endl;
390 if (mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
391 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
BOLDFONT(
"\tROTATION: RATIO = ") << residual_rot_ratio <<
BOLDFONT(
" EXP.RATIO = ") << mRotRatioTolerance <<
BOLDFONT(
" ABS = ") << residual_rot_abs <<
BOLDFONT(
" EXP.ABS = ") << mRotAbsTolerance << std::endl;
393 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
BOLDFONT(
"\tNORMAL LAGRANGE MUL: RATIO = ") << normal_lm_ratio <<
BOLDFONT(
" EXP.RATIO = ") << mLMNormalRatioTolerance <<
BOLDFONT(
" ABS = ") << normal_lm_abs <<
BOLDFONT(
" EXP.ABS = ") << mLMNormalAbsTolerance << std::endl;
394 KRATOS_INFO_IF(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria", mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP)) <<
BOLDFONT(
" STICK LAGRANGE MUL:\tRATIO = ") << tangent_lm_stick_ratio <<
BOLDFONT(
" EXP.RATIO = ") << mLMTangentStickRatioTolerance <<
BOLDFONT(
" ABS = ") << tangent_lm_stick_abs <<
BOLDFONT(
" EXP.ABS = ") << mLMTangentStickAbsTolerance << std::endl;
395 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
BOLDFONT(
" SLIP LAGRANGE MUL:\tRATIO = ") << tangent_lm_slip_ratio <<
BOLDFONT(
" EXP.RATIO = ") << mLMTangentSlipRatioTolerance <<
BOLDFONT(
" ABS = ") << tangent_lm_slip_abs <<
BOLDFONT(
" EXP.ABS = ") << mLMTangentSlipAbsTolerance << std::endl;
397 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
"MIXED CONVERGENCE CHECK" <<
"\tSTEP: " << r_process_info[STEP] <<
"\tNL ITERATION: " << r_process_info[NL_ITERATION_NUMBER] << std::endl << std::scientific;
398 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
"\tDISPLACEMENT: RATIO = " << residual_disp_ratio <<
" EXP.RATIO = " << mDispRatioTolerance <<
" ABS = " << residual_disp_abs <<
" EXP.ABS = " << mDispAbsTolerance << std::endl;
399 if (mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
400 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
"\tROTATION: RATIO = " << residual_rot_ratio <<
" EXP.RATIO = " << mRotRatioTolerance <<
" ABS = " << residual_rot_abs <<
" EXP.ABS = " << mRotAbsTolerance << std::endl;
402 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
"\tNORMAL LAGRANGE MUL: RATIO = " << normal_lm_ratio <<
" EXP.RATIO = " << mLMNormalRatioTolerance <<
" ABS = " << normal_lm_abs <<
" EXP.ABS = " << mLMNormalAbsTolerance << std::endl;
403 KRATOS_INFO_IF(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria", mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP)) <<
" STICK LAGRANGE MUL:\tRATIO = " << tangent_lm_stick_ratio <<
" EXP.RATIO = " << mLMTangentStickRatioTolerance <<
" ABS = " << tangent_lm_stick_abs <<
" EXP.ABS = " << mLMTangentStickAbsTolerance << std::endl;
404 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
" SLIP LAGRANGE MUL:\tRATIO = " << tangent_lm_slip_ratio <<
" EXP.RATIO = " << mLMTangentSlipRatioTolerance <<
" ABS = " << tangent_lm_slip_abs <<
" EXP.ABS = " << mLMTangentSlipAbsTolerance << std::endl;
410 r_process_info[CONVERGENCE_RATIO] = (residual_disp_ratio > normal_lm_ratio) ? residual_disp_ratio : normal_lm_ratio;
411 r_process_info[RESIDUAL_NORM] = (normal_lm_abs > mLMNormalAbsTolerance) ? normal_lm_abs : mLMNormalAbsTolerance;
414 const bool disp_converged = (residual_disp_ratio <= mDispRatioTolerance || residual_disp_abs <= mDispAbsTolerance);
415 const bool rot_converged = (mOptions.
Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED)) ? (residual_rot_ratio <= mRotRatioTolerance || residual_rot_abs <= mRotAbsTolerance) :
true;
416 const bool lm_converged = (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ENSURE_CONTACT) && normal_lm_solution_norm <
Tolerance) ?
true : (normal_lm_ratio <= mLMNormalRatioTolerance || normal_lm_abs <= mLMNormalAbsTolerance) && (tangent_lm_stick_ratio <= mLMTangentStickRatioTolerance || tangent_lm_stick_abs <= mLMTangentStickAbsTolerance || normal_tangent_stick_ratio <= mNormalTangentRatio) && (tangent_lm_slip_ratio <= mLMTangentSlipRatioTolerance || tangent_lm_slip_abs <= mLMTangentSlipAbsTolerance || normal_tangent_slip_ratio <= mNormalTangentRatio);
418 if ( disp_converged && rot_converged && lm_converged ) {
420 if (r_process_info.Has(TABLE_UTILITY)) {
422 auto& r_table = p_table->GetTable();
423 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PRINTING_OUTPUT))
426 r_table <<
"Achieved";
428 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PRINTING_OUTPUT))
429 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
BOLDFONT(
"\tConvergence") <<
" is " <<
BOLDFONT(
FGRN(
"achieved")) << std::endl;
431 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
"\tConvergence is achieved" << std::endl;
437 if (r_process_info.Has(TABLE_UTILITY)) {
439 auto& r_table = p_table->GetTable();
440 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PRINTING_OUTPUT))
443 r_table <<
"Not achieved";
445 if (mOptions.
IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PRINTING_OUTPUT))
446 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
BOLDFONT(
"\tConvergence") <<
" is " <<
BOLDFONT(
FRED(
" not achieved")) << std::endl;
448 KRATOS_INFO(
"DisplacementLagrangeMultiplierMixedFrictionalContactCriteria") <<
"\tConvergence is not achieved" << std::endl;
464 BaseType::mConvergenceCriteriaIsInitialized =
true;
471 if (r_process_info.
Has(TABLE_UTILITY) && mOptions.IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::TABLE_IS_INITIALIZED)) {
473 auto& r_table = p_table->GetTable();
474 r_table.AddColumn(
"DP RATIO", 10);
475 r_table.AddColumn(
"EXP. RAT", 10);
476 r_table.AddColumn(
"ABS", 10);
477 r_table.AddColumn(
"EXP. ABS", 10);
478 if (mOptions.Is(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED)) {
479 r_table.AddColumn(
"RT RATIO", 10);
480 r_table.AddColumn(
"EXP. RAT", 10);
481 r_table.AddColumn(
"ABS", 10);
482 r_table.AddColumn(
"EXP. ABS", 10);
484 r_table.AddColumn(
"N.LM RATIO", 10);
485 r_table.AddColumn(
"EXP. RAT", 10);
486 r_table.AddColumn(
"ABS", 10);
487 r_table.AddColumn(
"EXP. ABS", 10);
488 if (mOptions.IsNot(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP)) {
489 r_table.AddColumn(
"STI. RATIO", 10);
490 r_table.AddColumn(
"EXP. RAT", 10);
491 r_table.AddColumn(
"ABS", 10);
492 r_table.AddColumn(
"EXP. ABS", 10);
494 r_table.AddColumn(
"SLIP RATIO", 10);
495 r_table.AddColumn(
"EXP. RAT", 10);
496 r_table.AddColumn(
"ABS", 10);
497 r_table.AddColumn(
"EXP. ABS", 10);
498 r_table.AddColumn(
"CONVERGENCE", 15);
499 mOptions.
Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::TABLE_IS_INITIALIZED,
true);
520 mOptions.Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::INITIAL_RESIDUAL_IS_SET,
false);
543 BaseType::FinalizeNonLinearIteration(rModelPart, rDofSet, rA, rDx, rb);
547 r_process_info.
SetValue(ACTIVE_SET_COMPUTED,
false);
558 "name" : "displacement_lagrangemultiplier_mixed_frictional_contact_criteria",
559 "ensure_contact" : false,
561 "print_convergence_criterion" : false,
562 "residual_relative_tolerance" : 1.0e-4,
563 "residual_absolute_tolerance" : 1.0e-9,
564 "rotation_residual_relative_tolerance" : 1.0e-4,
565 "rotation_residual_absolute_tolerance" : 1.0e-9,
566 "contact_displacement_relative_tolerance" : 1.0e-4,
567 "contact_displacement_absolute_tolerance" : 1.0e-9,
568 "frictional_stick_contact_displacement_relative_tolerance" : 1.0e-4,
569 "frictional_stick_contact_residual_relative_tolerance" : 1.0e-9,
570 "frictional_slip_contact_displacement_relative_tolerance" : 1.0e-4,
571 "frictional_slip_contact_residual_relative_tolerance" : 1.0e-9,
572 "ratio_normal_tangent_threshold" : 1.0e-4
576 const Parameters base_default_parameters = BaseType::GetDefaultParameters();
578 return default_parameters;
587 return "displacement_lagrangemultiplier_mixed_frictional_contact_criteria";
603 std::string
Info()
const override
605 return "DisplacementLagrangeMultiplierMixedFrictionalContactCriteria";
643 BaseType::AssignSettings(ThisParameters);
646 mDispRatioTolerance = ThisParameters[
"residual_relative_tolerance"].
GetDouble();
647 mDispAbsTolerance = ThisParameters[
"residual_absolute_tolerance"].
GetDouble();
650 mRotRatioTolerance = ThisParameters[
"rotation_residual_relative_tolerance"].
GetDouble();
651 mRotAbsTolerance = ThisParameters[
"rotation_residual_absolute_tolerance"].
GetDouble();
654 mLMNormalRatioTolerance = ThisParameters[
"contact_displacement_relative_tolerance"].
GetDouble();
655 mLMNormalAbsTolerance = ThisParameters[
"contact_displacement_absolute_tolerance"].
GetDouble();
658 mLMTangentStickRatioTolerance = ThisParameters[
"frictional_stick_contact_displacement_relative_tolerance"].
GetDouble();
659 mLMTangentStickAbsTolerance = ThisParameters[
"frictional_stick_contact_residual_relative_tolerance"].
GetDouble();
660 mLMTangentSlipRatioTolerance = ThisParameters[
"frictional_slip_contact_displacement_relative_tolerance"].
GetDouble();
661 mLMTangentSlipAbsTolerance = ThisParameters[
"frictional_slip_contact_residual_relative_tolerance"].
GetDouble();
664 mNormalTangentRatio = ThisParameters[
"ratio_normal_tangent_threshold"].
GetDouble();
667 mOptions.Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ENSURE_CONTACT, ThisParameters[
"ensure_contact"].GetBool());
668 mOptions.Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PRINTING_OUTPUT, ThisParameters[
"print_convergence_criterion"].GetBool());
669 mOptions.Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::TABLE_IS_INITIALIZED,
false);
670 mOptions.Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::ROTATION_DOF_IS_CONSIDERED,
false);
671 mOptions.Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::PURE_SLIP, ThisParameters[
"pure_slip"].GetBool());
672 mOptions.Set(DisplacementLagrangeMultiplierMixedFrictionalContactCriteria::INITIAL_RESIDUAL_IS_SET,
false);
686 double mDispRatioTolerance;
687 double mDispAbsTolerance;
688 double mDispInitialResidualNorm;
689 double mDispCurrentResidualNorm;
691 double mRotRatioTolerance;
692 double mRotAbsTolerance;
693 double mRotInitialResidualNorm;
694 double mRotCurrentResidualNorm;
696 double mLMNormalRatioTolerance;
697 double mLMNormalAbsTolerance;
699 double mLMTangentStickRatioTolerance;
700 double mLMTangentStickAbsTolerance;
702 double mLMTangentSlipRatioTolerance;
703 double mLMTangentSlipAbsTolerance;
705 double mNormalTangentRatio;
707 std::vector<int> mActiveDofs;
716 template<
class TSparseSpace,
class TDenseSpace>
718 template<
class TSparseSpace,
class TDenseSpace>
720 template<
class TSparseSpace,
class TDenseSpace>
722 template<
class TSparseSpace,
class TDenseSpace>
724 template<
class TSparseSpace,
class TDenseSpace>
726 template<
class TSparseSpace,
class TDenseSpace>
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
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
void SetValue(const Variable< TDataType > &rThisVariable, TDataType const &rValue)
Sets the value for a given variable.
Definition: data_value_container.h:320
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
EquationIdType EquationId() const
Definition: dof.h:324
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
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
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
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_INFO(label)
Definition: logger.h:250
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
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