https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ContactAction Class Reference

Action class for creating constraints, kernels, and user objects necessary for mechanical contact. More...

#include <ContactAction.h>

Inheritance diagram for ContactAction:
[legend]

Classes

struct  MortarInfo
 

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 ContactAction (const InputParameters &params)
 
virtual void act () override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType input_rm_type) override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void timedAct ()
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseApp & getMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParameters & parameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraph & perfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static MooseEnum getModelEnum ()
 Get contact model.
 
static MooseEnum getFormulationEnum ()
 Get contact formulation.
 
static MooseEnum getSystemEnum ()
 Get contact system.
 
static MooseEnum getSmoothingEnum ()
 Get smoothing type.
 
static MooseEnum getProximityMethod ()
 Get proximity method for automatic pairing.
 
static InputParameters commonParameters ()
 Define parameters used by multiple contact objects.
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string unique_action_name_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

std::vector< std::pair< BoundaryName, BoundaryName > > _boundary_pairs
 Primary/Secondary boundary name pairs for mechanical contact.
 
std::vector< BoundaryName > _automatic_pairing_boundaries
 List of all possible boundaries for contact for automatic pairing (optional)
 
const ContactModel _model
 Contact model type enum.
 
const ContactFormulation _formulation
 Contact formulation.
 
const ContactLMSpace _lm_space
 Finite element space to use for action-generated mortar Lagrange multiplier variables.
 
bool _use_dual
 Whether to use the dual Mortar approach.
 
const bool _generate_mortar_mesh
 Whether to generate the mortar mesh (useful in a restart simulation e.g.).
 
const bool _mortar_dynamics
 Whether mortar dynamic contact constraints are to be used.
 
std::map< std::pair< BoundaryName, BoundaryName >, SubdomainName > _primary_surface_blocks
 Surface mesh blocks used as the primary side of mortar contact, by contact pair.
 
std::map< std::pair< BoundaryName, BoundaryName >, const MortarInfo > _bnd_pair_to_mortar_info
 Map from boundary pair to mortar user object name.
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse & _awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp & _app
 
Factory & _factory
 
ActionFactory & _action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters & _pars
 
MooseApp & _pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Private Member Functions

void addMortarContact ()
 Generate mesh and other Moose objects for Mortar contact.
 
void addNodeFaceContact ()
 Generate constraints for node to face contact.
 
void addContactPressureAuxKernel ()
 Add single contact pressure auxiliary kernel for various contact action objects.
 
void removeRepeatedPairs ()
 Remove repeated contact pairs from _boundary_pairs.
 
std::string automaticPairingGeneratorName () const
 Name of the AutomaticContactPairingGenerator appended by this action.
 
void appendAutomaticPairingGenerator ()
 Append the AutomaticContactPairingGenerator that detects contact pairs among _automatic_pairing_boundaries and, for mortar contact, creates their lower-dimensional blocks.
 
void getAutomaticContactPairs ()
 Fill _boundary_pairs from the contact pairs mesh meta-data of the appended generator.
 
std::string pairSuffix (const std::pair< BoundaryName, BoundaryName > &pair) const
 Returns a name suffix encoding the boundary pair for multi-pair mortar setups, or an empty string when there is only one pair (preserving single-pair name backwards compat).
 
std::string primarySubdomainName (const std::pair< BoundaryName, BoundaryName > &pair) const
 Returns the primary lower-dimensional subdomain name of a contact pair: the generated block or the user-provided primary surface block.
 
bool addRelationshipManager (Moose::RelationshipManagerType input_rm_type, const InputParameters &moose_object_pars, std::string rm_name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback rm_input_parameter_func, Moose::RMSystemType sys_type=Moose::RMSystemType::NONE)
 
bool suppressInfo () const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValue & getMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

const ParallelParamObject & _parent
 
MooseApp & _meta_data_app
 
const MooseObject *const _meta_data_object
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 

Detailed Description

Action class for creating constraints, kernels, and user objects necessary for mechanical contact.

Definition at line 32 of file ContactAction.h.

Constructor & Destructor Documentation

◆ ContactAction()

ContactAction::ContactAction ( const InputParameters &  params)

Definition at line 363 of file ContactAction.C.

364 : Action(params),
365 _boundary_pairs(getParam<BoundaryName, BoundaryName>("primary", "secondary")),
366 _model(getParam<MooseEnum>("model").getEnum<ContactModel>()),
367 _formulation(getParam<MooseEnum>("formulation").getEnum<ContactFormulation>()),
368 _lm_space(getParam<MooseEnum>("lm_space").getEnum<ContactLMSpace>()),
369 _generate_mortar_mesh(getParam<bool>("generate_mortar_mesh")),
370 _mortar_dynamics(getParam<bool>("mortar_dynamics"))
371{
372 const auto & surface_blocks = getParam<std::vector<SubdomainName>>("primary_surface_blocks");
373 if (!surface_blocks.empty())
374 {
375 if (_formulation != ContactFormulation::MORTAR &&
376 _formulation != ContactFormulation::MORTAR_PENALTY)
377 paramError("primary_surface_blocks",
378 "Primary surface blocks are only used by mortar formulations. Node-face "
379 "formulations use primary surface elements on the 'primary' nodeset without "
380 "this parameter.");
381 if (surface_blocks.size() != _boundary_pairs.size())
382 paramError("primary_surface_blocks",
383 "One primary surface block must be given for each primary and secondary pair.");
384 for (const auto i : index_range(_boundary_pairs))
385 _primary_surface_blocks.emplace(_boundary_pairs[i], surface_blocks[i]);
386 }
387
388 // Check for automatic selection of contact pairs.
389 if (getParam<std::vector<BoundaryName>>("automatic_pairing_boundaries").size() > 1)
391 getParam<std::vector<BoundaryName>>("automatic_pairing_boundaries");
392
393 if (_automatic_pairing_boundaries.size() > 0 && !isParamValid("automatic_pairing_distance"))
394 paramError("automatic_pairing_distance",
395 "For automatic selection of contact pairs (for particular geometries) in contact "
396 "action, 'automatic_pairing_distance' needs to be provided.");
397
398 if (_automatic_pairing_boundaries.size() > 0 && !isParamValid("automatic_pairing_method"))
399 paramError("automatic_pairing_distance",
400 "For automatic selection of contact pairs (for particular geometries) in contact "
401 "action, 'automatic_pairing_method' needs to be provided.");
402
403 if (_automatic_pairing_boundaries.size() > 0 && _boundary_pairs.size() != 0)
404 paramError("automatic_pairing_boundaries",
405 "If a boundary list is provided, primary and secondary surfaces will be identified "
406 "automatically. Therefore, one cannot provide an automatic pairing boundary list "
407 "and primary/secondary lists.");
408 else if (_automatic_pairing_boundaries.size() == 0 && _boundary_pairs.size() == 0)
409 paramError("primary",
410 "'primary' and 'secondary' surfaces or a list of boundaries for automatic pair "
411 "generation need to be provided.");
412
413 // End of checks for automatic selection of contact pairs.
414
415 if ((_formulation == ContactFormulation::MORTAR ||
416 _formulation == ContactFormulation::MORTAR_PENALTY) &&
417 params.isParamSetByUser("ghost_whole_interface"))
418 paramError("ghost_whole_interface",
419 "The 'ghost_whole_interface' parameter is only supported for node-face contact "
420 "formulations. Mortar contact always geometrically and algebraically ghosts the "
421 "interface.");
422
423 if (_formulation == ContactFormulation::TANGENTIAL_PENALTY && _model != ContactModel::COULOMB)
424 paramError("formulation",
425 "The 'tangential_penalty' formulation can only be used with the 'coulomb' model");
426
427 if (_formulation == ContactFormulation::MORTAR_PENALTY)
428 {
429 // Use dual basis functions for contact traction interpolation
430 if (isParamValid("use_dual"))
431 _use_dual = getParam<bool>("use_dual");
432 else
433 _use_dual = true;
434
435 if (_model == ContactModel::GLUED)
436 paramError("model", "The 'mortar_penalty' formulation does not support glued contact");
437
438 if (getParam<bool>("mortar_dynamics"))
439 paramError("mortar_dynamics",
440 "The 'mortar_penalty' formulation does not support implicit dynamic simulations");
441
442 if (getParam<bool>("use_petrov_galerkin"))
443 paramError("use_petrov_galerkin",
444 "The 'mortar_penalty' formulation does not support usage of the Petrov-Galerkin "
445 "flag. The default (use_dual = true) behavior is such that contact tractions are "
446 "interpolated with dual bases whereas mortar or weighted contact quantities are "
447 "interpolated with Lagrange shape functions.");
448 }
449
450 if (_formulation == ContactFormulation::MORTAR)
451 {
452 if (_model == ContactModel::GLUED)
453 paramError("model", "The 'mortar' formulation does not support glued contact (yet)");
454
455 // use dual basis function for Lagrange multipliers?
456 if (isParamValid("use_dual"))
457 _use_dual = getParam<bool>("use_dual");
458 else
459 _use_dual = true;
460
461 if (!getParam<bool>("mortar_dynamics"))
462 {
463 if (params.isParamSetByUser("newmark_beta"))
464 paramError("newmark_beta", "newmark_beta can only be used with the mortar_dynamics option");
465
466 if (params.isParamSetByUser("newmark_gamma"))
467 paramError("newmark_gamma",
468 "newmark_gamma can only be used with the mortar_dynamics option");
469 }
470
471 if (isParamSetByUser("penalty"))
472 paramError("penalty",
473 "The 'penalty' parameter is not used for the 'mortar' formulation which instead "
474 "uses Lagrange multipliers");
475
476 if (isParamSetByUser("friction_projection_degree") && _model != ContactModel::COULOMB)
477 paramError("friction_projection_degree",
478 "'friction_projection_degree' is only valid for Coulomb friction mortar "
479 "contact.");
480 }
481 else
482 {
483 if (params.isParamSetByUser("correct_edge_dropping"))
485 "correct_edge_dropping",
486 "The 'correct_edge_dropping' option can only be used with the 'mortar' formulation "
487 "(weighted)");
488 else if (params.isParamSetByUser("use_nodal_scaling"))
489 paramError("use_nodal_scaling",
490 "The 'use_nodal_scaling' option can only be used with the 'mortar' formulation "
491 "(weighted)");
492 else if (params.isParamSetByUser("triangulation") &&
493 _formulation != ContactFormulation::MORTAR_PENALTY)
494 paramError("triangulation",
495 "The 'triangulation' option can only be used with mortar-based formulations.");
496 else if (params.isParamSetByUser("triangulate_triangles") &&
497 _formulation != ContactFormulation::MORTAR_PENALTY)
498 paramError("triangulate_triangles",
499 "The 'triangulate_triangles' option can only be used with mortar-based "
500 "formulations.");
501 else if (params.isParamSetByUser("minimum_projection_angle") &&
502 _formulation != ContactFormulation::MORTAR_PENALTY)
503 paramError("minimum_projection_angle",
504 "The 'minimum_projection_angle' option can only be used with mortar-based "
505 "formulations.");
506 else if (params.isParamSetByUser("mortar_3d_subpatch_plane") &&
507 _formulation != ContactFormulation::MORTAR_PENALTY)
508 paramError("mortar_3d_subpatch_plane",
509 "The 'mortar_3d_subpatch_plane' option can only be used with mortar-based "
510 "formulations.");
511 else if (params.isParamSetByUser("mortar_3d_qp_mapping") &&
512 _formulation != ContactFormulation::MORTAR_PENALTY)
513 paramError("mortar_3d_qp_mapping",
514 "The 'mortar_3d_qp_mapping' option can only be used with mortar-based "
515 "formulations.");
516 else if (params.isParamSetByUser("use_dual") &&
517 _formulation != ContactFormulation::MORTAR_PENALTY)
518 paramError("use_dual",
519 "The 'use_dual' option can only be used with the 'mortar' formulation");
520 else if (params.isParamSetByUser("c_normal"))
521 paramError("c_normal",
522 "The 'c_normal' option can only be used with the 'mortar' formulation");
523 else if (params.isParamSetByUser("c_tangential"))
524 paramError("c_tangential",
525 "The 'c_tangential' option can only be used with the 'mortar' formulation");
526 else if (params.isParamSetByUser("mortar_dynamics"))
527 paramError("mortar_dynamics",
528 "The 'mortar_dynamics' constraint option can only be used with the 'mortar' "
529 "formulation and in dynamic simulations using Newmark-beta");
530 else if (params.isParamSetByUser("segment_quadrature"))
531 paramError("segment_quadrature",
532 "The 'segment_quadrature' option can only be used with the "
533 "'mortar' formulation.");
534 else if (params.isParamSetByUser("lm_space"))
535 paramError("lm_space",
536 "The 'lm_space' option can only be used with the 'mortar' formulation.");
537 }
538
539 if (_formulation == ContactFormulation::RANFS)
540 {
541 if (isParamValid("secondary_gap_offset"))
542 paramError("secondary_gap_offset",
543 "The 'secondary_gap_offset' option can only be used with the "
544 "'MechanicalContactConstraint'");
545 if (isParamValid("mapped_primary_gap_offset"))
546 paramError("mapped_primary_gap_offset",
547 "The 'mapped_primary_gap_offset' option can only be used with the "
548 "'MechanicalContactConstraint'");
549 }
550 else if (getParam<bool>("ping_pong_protection"))
551 paramError("ping_pong_protection",
552 "The 'ping_pong_protection' option can only be used with the 'ranfs' formulation");
553
554 // Remove repeated pairs from input file.
556}
bool _use_dual
Whether to use the dual Mortar approach.
const bool _mortar_dynamics
Whether mortar dynamic contact constraints are to be used.
const ContactModel _model
Contact model type enum.
const ContactFormulation _formulation
Contact formulation.
void removeRepeatedPairs()
Remove repeated contact pairs from _boundary_pairs.
std::vector< BoundaryName > _automatic_pairing_boundaries
List of all possible boundaries for contact for automatic pairing (optional)
const bool _generate_mortar_mesh
Whether to generate the mortar mesh (useful in a restart simulation e.g.).
std::vector< std::pair< BoundaryName, BoundaryName > > _boundary_pairs
Primary/Secondary boundary name pairs for mechanical contact.
const ContactLMSpace _lm_space
Finite element space to use for action-generated mortar Lagrange multiplier variables.
std::map< std::pair< BoundaryName, BoundaryName >, SubdomainName > _primary_surface_blocks
Surface mesh blocks used as the primary side of mortar contact, by contact pair.
bool isParamSetByUser(const std::string &name) const
void paramError(const std::string &param, Args... args) const
bool isParamSetByUser(const std::string &name) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
auto index_range(const T &sizable)

Member Function Documentation

◆ act()

void ContactAction::act ( )
overridevirtual

Implements Action.

Definition at line 600 of file ContactAction.C.

601{
602 // proform problem checks/corrections once during the first feasible task
603 if (_current_task == "add_contact_aux_variable")
604 {
605 if (!_problem->getDisplacedProblem())
607 "Contact requires updated coordinates. Use the 'displacements = ...' parameter in the "
608 "Mesh block.");
609
610 // It is risky to apply this optimization to contact problems
611 // since the problem configuration may be changed during Jacobian
612 // evaluation. We therefore turn it off for all contact problems so that
613 // PETSc-3.8.4 or higher will have the same behavior as PETSc-3.8.3.
614 if (!_problem->isSNESMFReuseBaseSetbyUser())
615 _problem->setSNESMFReuseBase(false, false);
616 }
617
618 if (_automatic_pairing_boundaries.size() > 0)
619 {
620 if (_current_task == "append_mesh_generator")
622 else if (_current_task == "post_mesh_prepared")
624 }
625
626 if (_formulation == ContactFormulation::MORTAR ||
627 _formulation == ContactFormulation::MORTAR_PENALTY)
629 else
631
632 if (_current_task == "add_aux_kernel")
633 {
634 if (!_problem->getDisplacedProblem())
635 mooseError("Contact requires updated coordinates. Use the 'displacements = ...' line in the "
636 "Mesh block.");
637
638 // Create auxiliary kernels for each contact pairs
639 for (const auto & contact_pair : _boundary_pairs)
640 {
641 const auto & [primary_name, secondary_name] = contact_pair;
642 if ((_formulation != ContactFormulation::MORTAR) &&
643 (_formulation != ContactFormulation::MORTAR_PENALTY))
644 {
645 InputParameters params = _factory.getValidParams("PenetrationAux");
647 {"secondary_gap_offset", "mapped_primary_gap_offset", "order"});
648
649 std::vector<VariableName> displacements =
650 getParam<std::vector<VariableName>>("displacements");
651 const auto order = _problem->systemBaseNonlinear(/*nl_sys_num=*/0)
652 .system()
653 .variable_type(displacements[0])
654 .order.get_order();
655
656 params.set<MooseEnum>("order") = Utility::enum_to_string<Order>(OrderWrapper{order});
657 params.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL, EXEC_LINEAR};
658 params.set<std::vector<BoundaryName>>("boundary") = {secondary_name};
659 params.set<BoundaryName>("paired_boundary") = primary_name;
660 params.set<AuxVariableName>("variable") = "penetration";
661 if (isParamValid("secondary_gap_offset"))
662 params.set<std::vector<VariableName>>("secondary_gap_offset") = {
663 getParam<VariableName>("secondary_gap_offset")};
664 if (isParamValid("mapped_primary_gap_offset"))
665 params.set<std::vector<VariableName>>("mapped_primary_gap_offset") = {
666 getParam<VariableName>("mapped_primary_gap_offset")};
667 params.set<bool>("use_displaced_mesh") = true;
668 std::string name = _name + "_contact_" + Moose::stringify(contact_auxkernel_counter++);
669
670 _problem->addAuxKernel("PenetrationAux", name, params);
671 }
672 else
673 {
674 const auto type = "MortarUserObjectAux";
676 params.set<std::vector<BoundaryName>>("boundary") = {secondary_name};
677 params.set<AuxVariableName>("variable") = "gap";
678 params.set<bool>("use_displaced_mesh") = true; // Unnecessary as this object only operates
679 // on nodes, but we'll do it for consistency
680 params.set<MooseEnum>("contact_quantity") = "normal_gap";
681 const auto & [primary_id, secondary_id, uo_name] =
682 libmesh_map_find(_bnd_pair_to_mortar_info, contact_pair);
683 params.set<UserObjectName>("user_object") = uo_name;
684 std::string name = _name + "_contact_gap_" + std::to_string(primary_id) + "_" +
685 std::to_string(secondary_id);
686
687 _problem->addAuxKernel(type, name, params);
688 }
689 }
690
692
693 const unsigned int ndisp = getParam<std::vector<VariableName>>("displacements").size();
694
695 // Add MortarFrictionalPressureVectorAux
696 if (_formulation == ContactFormulation::MORTAR && _model == ContactModel::COULOMB && ndisp > 2)
697 {
698 std::string action_name = MooseUtils::shortName(name());
699 for (const auto & [primary_boundary, secondary_boundary] : _boundary_pairs)
700 {
701 const std::string suffix = pairSuffix({primary_boundary, secondary_boundary});
702 InputParameters params = _factory.getValidParams("MortarFrictionalPressureVectorAux");
703
704 params.set<BoundaryName>("primary_boundary") = primary_boundary;
705 params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
706 params.set<std::vector<BoundaryName>>("boundary") = {secondary_boundary};
707 params.set<ExecFlagEnum>("execute_on", true) = {EXEC_NONLINEAR};
708 params.set<std::vector<VariableName>>("tangent_one") = {action_name + "_tangential_lm" +
709 suffix};
710 params.set<std::vector<VariableName>>("tangent_two") = {action_name + "_tangential_3d_lm" +
711 suffix};
712
713 std::vector<std::string> disp_components({"x", "y", "z"});
714 unsigned component_index = 0;
715
716 // Loop over three displacements
717 for (const auto & disp_component : disp_components)
718 {
719 params.set<AuxVariableName>("variable") = _name + "_tangent_" + disp_component;
720 params.set<unsigned int>("component") = component_index;
721
722 std::string name = _name + "_mortar_frictional_pressure_" + disp_component + "_" +
724
725 _problem->addAuxKernel("MortarFrictionalPressureVectorAux", name, params);
726 component_index++;
727 }
728 }
729 }
730 }
731
732 if (_current_task == "add_contact_aux_variable")
733 {
734 std::vector<VariableName> displacements = getParam<std::vector<VariableName>>("displacements");
735 const auto order = _problem->systemBaseNonlinear(/*nl_sys_num=*/0)
736 .system()
737 .variable_type(displacements[0])
738 .order.get_order();
739 const auto mortar_lm_order =
740 _lm_space == ContactLMSpace::LINEAR ? static_cast<int>(FIRST) : order;
741 std::unique_ptr<InputParameters> current_params;
742 const auto create_aux_var_params =
743 [this, order, mortar_lm_order, &current_params]() -> InputParameters &
744 {
745 current_params = std::make_unique<InputParameters>(_factory.getValidParams("MooseVariable"));
746 // Node/face and mortar-penalty contact aux variables continue to follow the displacement
747 // order. Mortar LM contact aux variables live on the same contact surface as the generated LM
748 // field, so they use the selected generated LM space.
749 const auto aux_order = _formulation == ContactFormulation::MORTAR ? mortar_lm_order : order;
750 current_params->set<MooseEnum>("order") =
751 Utility::enum_to_string<Order>(OrderWrapper{aux_order});
752 current_params->set<MooseEnum>("family") = "LAGRANGE";
753 return *current_params;
754 };
755
756 if ((_formulation != ContactFormulation::MORTAR) &&
757 (_formulation != ContactFormulation::MORTAR_PENALTY))
758 {
759 // Add penetration aux variable
760 _problem->addAuxVariable("MooseVariable", "penetration", create_aux_var_params());
761 // Add nodal area aux variable
762 _problem->addAuxVariable("MooseVariable", "nodal_area", create_aux_var_params());
763 }
764 else
765 _problem->addAuxVariable("MooseVariable", "gap", create_aux_var_params());
766
767 // Add contact pressure aux variable
768 _problem->addAuxVariable("MooseVariable", "contact_pressure", create_aux_var_params());
769
770 const unsigned int ndisp = getParam<std::vector<VariableName>>("displacements").size();
771
772 // Add MortarFrictionalPressureVectorAux variables
773 if (_formulation == ContactFormulation::MORTAR && _model == ContactModel::COULOMB && ndisp > 2)
774 {
775 {
776 std::vector<std::string> disp_components({"x", "y", "z"});
777 // Loop over three displacements
778 for (const auto & disp_component : disp_components)
779 {
780 auto var_params = _factory.getValidParams("MooseVariable");
781 var_params.set<MooseEnum>("order") =
782 Utility::enum_to_string<Order>(OrderWrapper{mortar_lm_order});
783 var_params.set<MooseEnum>("family") = "LAGRANGE";
784
785 _problem->addAuxVariable(
786 "MooseVariable", _name + "_tangent_" + disp_component, var_params);
787 }
788 }
789 }
790 }
791
792 if (_current_task == "add_user_object" && (_formulation != ContactFormulation::MORTAR) &&
793 (_formulation != ContactFormulation::MORTAR_PENALTY))
794 {
795 auto var_params = _factory.getValidParams("NodalArea");
796
797 // Get secondary_boundary_vector from possibly updated set from the
798 // ContactAction constructor cleanup
799 const auto actions = _awh.getActions<ContactAction>();
800
801 std::vector<BoundaryName> secondary_boundary_vector;
802 for (const auto * const action : actions)
803 for (const auto j : index_range(action->_boundary_pairs))
804 secondary_boundary_vector.push_back(action->_boundary_pairs[j].second);
805
806 var_params.set<std::vector<BoundaryName>>("boundary") = secondary_boundary_vector;
807 var_params.set<std::vector<VariableName>>("variable") = {"nodal_area"};
808
809 mooseAssert(_problem, "Problem pointer is NULL");
810 var_params.set<ExecFlagEnum>("execute_on", true) = {EXEC_INITIAL, EXEC_TIMESTEP_BEGIN};
811 var_params.set<bool>("use_displaced_mesh") = true;
812
813 _problem->addUserObject("NodalArea",
814 "nodal_area_object_" + Moose::stringify(contact_userobject_counter++),
815 var_params);
816 }
817}
static unsigned int contact_userobject_counter
static unsigned int contact_mortar_auxkernel_counter
static unsigned int contact_auxkernel_counter
const ExecFlagType EXEC_TIMESTEP_BEGIN
const ExecFlagType EXEC_INITIAL
const ExecFlagType EXEC_LINEAR
const ExecFlagType EXEC_NONLINEAR
for(PetscInt i=0;i< nvars;++i)
std::vector< const T * > getActions()
std::shared_ptr< FEProblemBase > & _problem
const std::string & _current_task
ActionWarehouse & _awh
Action class for creating constraints, kernels, and user objects necessary for mechanical contact.
void addNodeFaceContact()
Generate constraints for node to face contact.
void appendAutomaticPairingGenerator()
Append the AutomaticContactPairingGenerator that detects contact pairs among _automatic_pairing_bound...
std::map< std::pair< BoundaryName, BoundaryName >, const MortarInfo > _bnd_pair_to_mortar_info
Map from boundary pair to mortar user object name.
void addContactPressureAuxKernel()
Add single contact pressure auxiliary kernel for various contact action objects.
std::string pairSuffix(const std::pair< BoundaryName, BoundaryName > &pair) const
Returns a name suffix encoding the boundary pair for multi-pair mortar setups, or an empty string whe...
void addMortarContact()
Generate mesh and other Moose objects for Mortar contact.
void getAutomaticContactPairs()
Fill _boundary_pairs from the contact pairs mesh meta-data of the appended generator.
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
const InputParameters & parameters() const
const std::string & type() const
const std::string & name() const
void mooseError(Args &&... args) const
const std::string & _name
Factory & _factory
std::string shortName(const std::string &name)
std::string stringify(const T &t)

◆ addContactPressureAuxKernel()

void ContactAction::addContactPressureAuxKernel ( )
private

Add single contact pressure auxiliary kernel for various contact action objects.

Definition at line 820 of file ContactAction.C.

821{
822 // Increment counter for contact action objects
824
825 if ((_formulation != ContactFormulation::MORTAR) &&
826 (_formulation != ContactFormulation::MORTAR_PENALTY))
827 {
828 // Add ContactPressureAux: Only one object for all contact pairs
829 const auto actions = _awh.getActions<ContactAction>();
830
831 // Add auxiliary kernel if we are the last contact action object.
832 if (contact_action_counter == actions.size())
833 {
834 std::vector<BoundaryName> boundary_vector;
835 std::vector<BoundaryName> pair_boundary_vector;
836
837 for (const auto * const action : actions)
838 for (const auto j : index_range(action->_boundary_pairs))
839 {
840 boundary_vector.push_back(action->_boundary_pairs[j].second);
841 pair_boundary_vector.push_back(action->_boundary_pairs[j].first);
842 }
843
844 InputParameters params = _factory.getValidParams("ContactPressureAux");
845 params.applyParameters(parameters(), {"order"});
846
847 std::vector<VariableName> displacements =
848 getParam<std::vector<VariableName>>("displacements");
849 const auto order = _problem->systemBaseNonlinear(/*nl_sys_num=*/0)
850 .system()
851 .variable_type(displacements[0])
852 .order.get_order();
853
854 params.set<MooseEnum>("order") = Utility::enum_to_string<Order>(OrderWrapper{order});
855 params.set<std::vector<BoundaryName>>("boundary") = boundary_vector;
856 params.set<std::vector<BoundaryName>>("paired_boundary") = pair_boundary_vector;
857 params.set<AuxVariableName>("variable") = "contact_pressure";
858 params.addRequiredCoupledVar("nodal_area", "The nodal area");
859 params.set<std::vector<VariableName>>("nodal_area") = {"nodal_area"};
860 params.set<bool>("use_displaced_mesh") = true;
861
862 std::string name = _name + "_contact_pressure";
863 params.set<ExecFlagEnum>("execute_on",
865 _problem->addAuxKernel("ContactPressureAux", name, params);
866 }
867 }
868 else
869 for (const auto & contact_pair : _boundary_pairs)
870 {
871 const auto & [_, secondary_name] = contact_pair;
872 const auto type = "MortarUserObjectAux";
874 params.set<std::vector<BoundaryName>>("boundary") = {secondary_name};
875 params.set<AuxVariableName>("variable") = "contact_pressure";
876 params.set<bool>("use_displaced_mesh") = true; // Unecessary as this object only operates on
877 // nodes, but we'll do it for consistency
878 params.set<MooseEnum>("contact_quantity") = "normal_pressure";
879 const auto & [primary_id, secondary_id, uo_name] =
880 libmesh_map_find(_bnd_pair_to_mortar_info, contact_pair);
881 params.set<UserObjectName>("user_object") = uo_name;
882 const std::string name = _name + "_contact_pressure" + std::to_string(primary_id) + "_" +
883 std::to_string(secondary_id);
884
885 _problem->addAuxKernel(type, name, params);
886 }
887}
static unsigned int contact_action_counter
const ExecFlagType EXEC_TIMESTEP_END
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)

Referenced by act().

◆ addMortarContact()

void ContactAction::addMortarContact ( )
private

Generate mesh and other Moose objects for Mortar contact.

Definition at line 948 of file ContactAction.C.

949{
950 std::string action_name = MooseUtils::shortName(name());
951
952 std::vector<VariableName> displacements = getParam<std::vector<VariableName>>("displacements");
953 const unsigned int ndisp = displacements.size();
954
955 // Add the lagrange multiplier on the secondary subdomain.
956 const auto addLagrangeMultiplier = [this, &displacements](const std::string & secondary_subdomain,
957 const std::string & variable_name,
958 const Real scaling_factor,
959 const bool add_aux_lm,
960 const bool penalty_traction) //
961 {
962 InputParameters params = _factory.getValidParams("MooseVariableBase");
963
964 // Allow the user to select "weighted" constraints and standard bases (use_dual = false) or
965 // "legacy" constraints and dual bases (use_dual = true). Unless it's for testing purposes,
966 // this combination isn't recommended
967 if (!add_aux_lm || penalty_traction)
968 params.set<bool>("use_dual") = _use_dual;
969
970 mooseAssert(_problem->systemBaseNonlinear(/*nl_sys_num=*/0).hasVariable(displacements[0]),
971 "Displacement variable is missing");
972 const auto primal_type =
973 _problem->systemBaseNonlinear(/*nl_sys_num=*/0).system().variable_type(displacements[0]);
974
975 // The lm_space option is only valid for the mortar Lagrange multiplier formulation. Mortar
976 // penalty traction variables continue to use the displacement order.
977 const int lm_order =
978 _formulation == ContactFormulation::MORTAR && _lm_space == ContactLMSpace::LINEAR
979 ? static_cast<int>(FIRST)
980 : primal_type.order.get_order();
981
982 if (primal_type.family == LAGRANGE)
983 {
984 params.set<MooseEnum>("family") = Utility::enum_to_string<FEFamily>(primal_type.family);
985 params.set<MooseEnum>("order") = Utility::enum_to_string<Order>(OrderWrapper{lm_order});
986 }
987 else
988 mooseError("Invalid bases for mortar contact.");
989
990 params.set<std::vector<SubdomainName>>("block") = {secondary_subdomain};
991 if (!(add_aux_lm || penalty_traction))
992 params.set<std::vector<Real>>("scaling") = {scaling_factor};
993
994 auto fe_type = AddVariableAction::feType(params);
995 auto var_type = AddVariableAction::variableType(fe_type);
996 if (add_aux_lm || penalty_traction)
997 _problem->addAuxVariable(var_type, variable_name, params);
998 else
999 _problem->addVariable(var_type, variable_name, params);
1000 };
1001
1002 if (_current_task == "append_mesh_generator")
1003 {
1004 // Don't do mesh generators when recovering or when the user has requested for us not to
1005 // (presumably because the lower-dimensional blocks are already in the mesh due to manual
1006 // addition or because we are restarting). Automatically detected pairs get their
1007 // lower-dimensional blocks from the generator appended in appendAutomaticPairingGenerator()
1010 {
1011 for (const auto & [primary_boundary, secondary_boundary] : _boundary_pairs)
1012 {
1013 const std::string suffix = pairSuffix({primary_boundary, secondary_boundary});
1014 const std::string primary_subdomain_name = action_name + "_primary_subdomain" + suffix;
1015 const std::string secondary_subdomain_name = action_name + "_secondary_subdomain" + suffix;
1016
1017 const MeshGeneratorName primary_name = primary_subdomain_name + "_generator";
1018 const MeshGeneratorName secondary_name = secondary_subdomain_name + "_generator";
1019
1020 auto primary_params = _factory.getValidParams("LowerDBlockFromSidesetGenerator");
1021 auto secondary_params = _factory.getValidParams("LowerDBlockFromSidesetGenerator");
1022
1023 primary_params.set<SubdomainName>("new_block_name") = primary_subdomain_name;
1024 secondary_params.set<SubdomainName>("new_block_name") = secondary_subdomain_name;
1025
1026 primary_params.set<std::vector<BoundaryName>>("sidesets") = {primary_boundary};
1027 secondary_params.set<std::vector<BoundaryName>>("sidesets") = {secondary_boundary};
1028
1029 if (_primary_surface_blocks.empty())
1030 _app.appendMeshGenerator("LowerDBlockFromSidesetGenerator", primary_name, primary_params);
1032 "LowerDBlockFromSidesetGenerator", secondary_name, secondary_params);
1033 }
1034 }
1035 }
1036
1037 if (_current_task == "add_mortar_variable" && _formulation == ContactFormulation::MORTAR)
1038 {
1039 for (const auto & contact_pair : _boundary_pairs)
1040 {
1041 const std::string suffix = pairSuffix(contact_pair);
1042 const std::string secondary_subdomain_name = action_name + "_secondary_subdomain" + suffix;
1043 const std::string normal_lagrange_multiplier_name = action_name + "_normal_lm" + suffix;
1044 const std::string tangential_lagrange_multiplier_name =
1045 action_name + "_tangential_lm" + suffix;
1046 const std::string tangential_lagrange_multiplier_3d_name =
1047 action_name + "_tangential_3d_lm" + suffix;
1048 const std::string auxiliary_lagrange_multiplier_name = action_name + "_aux_lm" + suffix;
1049
1050 addLagrangeMultiplier(secondary_subdomain_name,
1051 normal_lagrange_multiplier_name,
1052 getParam<Real>("normal_lm_scaling"),
1053 false,
1054 false);
1055
1056 if (_model == ContactModel::COULOMB)
1057 {
1058 addLagrangeMultiplier(secondary_subdomain_name,
1059 tangential_lagrange_multiplier_name,
1060 getParam<Real>("tangential_lm_scaling"),
1061 false,
1062 false);
1063 if (ndisp > 2)
1064 addLagrangeMultiplier(secondary_subdomain_name,
1065 tangential_lagrange_multiplier_3d_name,
1066 getParam<Real>("tangential_lm_scaling"),
1067 false,
1068 false);
1069 }
1070
1071 if (getParam<bool>("use_petrov_galerkin"))
1072 addLagrangeMultiplier(
1073 secondary_subdomain_name, auxiliary_lagrange_multiplier_name, 1.0, true, false);
1074 }
1075 }
1076 else if (_current_task == "add_mortar_variable" &&
1077 _formulation == ContactFormulation::MORTAR_PENALTY)
1078 {
1079 for (const auto & contact_pair : _boundary_pairs)
1080 {
1081 const std::string suffix = pairSuffix(contact_pair);
1082 const std::string secondary_subdomain_name = action_name + "_secondary_subdomain" + suffix;
1083 const std::string auxiliary_lagrange_multiplier_name = action_name + "_aux_lm" + suffix;
1084
1085 if (_use_dual)
1086 addLagrangeMultiplier(
1087 secondary_subdomain_name, auxiliary_lagrange_multiplier_name, 1.0, false, true);
1088 }
1089 }
1090
1091 if (_current_task == "add_user_object")
1092 {
1093 // check if the correct problem class is selected if AL parameters are provided
1094 if (_formulation == ContactFormulation::MORTAR_PENALTY &&
1096 {
1097 const std::vector<std::string> params = {"penalty_multiplier",
1098 "penalty_multiplier_friction",
1099 "al_penetration_tolerance",
1100 "al_incremental_slip_tolerance",
1101 "al_frictional_force_tolerance"};
1102 for (const auto & param : params)
1103 if (parameters().isParamSetByUser(param))
1104 paramError(param,
1105 "Augmented Lagrange parameter was specified, but the selected problem type "
1106 "does not support Augmented Lagrange iterations.");
1107 }
1108
1109 for (const auto & [primary_boundary, secondary_boundary] : _boundary_pairs)
1110 {
1111 const std::string suffix = pairSuffix({primary_boundary, secondary_boundary});
1112 const std::string primary_subdomain_name =
1113 primarySubdomainName({primary_boundary, secondary_boundary});
1114 const std::string secondary_subdomain_name = action_name + "_secondary_subdomain" + suffix;
1115 const std::string normal_lagrange_multiplier_name = action_name + "_normal_lm" + suffix;
1116 const std::string tangential_lagrange_multiplier_name =
1117 action_name + "_tangential_lm" + suffix;
1118 const std::string tangential_lagrange_multiplier_3d_name =
1119 action_name + "_tangential_3d_lm" + suffix;
1120 const std::string auxiliary_lagrange_multiplier_name = action_name + "_aux_lm" + suffix;
1121
1122 const auto register_mortar_uo_name =
1123 [this, &suffix](const auto & bnd_pair, const auto & uo_prefix)
1124 {
1125 const auto & [primary_name, secondary_name] = bnd_pair;
1126 const auto primary_id = _mesh->getBoundaryID(primary_name);
1127 const auto secondary_id = _mesh->getBoundaryID(secondary_name);
1128 const auto uo_name = uo_prefix + name() + suffix;
1129 _bnd_pair_to_mortar_info.emplace(bnd_pair, MortarInfo{primary_id, secondary_id, uo_name});
1130 return uo_name;
1131 };
1132
1133 if (_model != ContactModel::COULOMB && _formulation == ContactFormulation::MORTAR)
1134 {
1135 auto uo_params = _factory.getValidParams("LMWeightedGapUserObject");
1136
1137 uo_params.set<BoundaryName>("primary_boundary") = primary_boundary;
1138 uo_params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
1139 uo_params.set<SubdomainName>("primary_subdomain") = primary_subdomain_name;
1140 uo_params.set<SubdomainName>("secondary_subdomain") = secondary_subdomain_name;
1141 uo_params.set<std::vector<VariableName>>("disp_x") = {displacements[0]};
1142 uo_params.set<std::vector<VariableName>>("disp_y") = {displacements[1]};
1143 if (ndisp > 2)
1144 uo_params.set<std::vector<VariableName>>("disp_z") = {displacements[2]};
1145 uo_params.set<bool>("use_displaced_mesh") = true;
1146 uo_params.set<std::vector<VariableName>>("lm_variable") = {normal_lagrange_multiplier_name};
1147 uo_params.applySpecificParameters(parameters(),
1148 {"correct_edge_dropping",
1149 "use_nodal_scaling",
1150 "triangulation",
1151 "triangulate_triangles",
1152 "minimum_projection_angle",
1153 "mortar_3d_subpatch_plane",
1154 "mortar_3d_qp_mapping",
1155 "use_petrov_galerkin",
1156 "debug_mesh"});
1157 if (getParam<bool>("use_petrov_galerkin"))
1158 uo_params.set<std::vector<VariableName>>("aux_lm") = {auxiliary_lagrange_multiplier_name};
1159
1160 _problem->addUserObject(
1161 "LMWeightedGapUserObject",
1162 register_mortar_uo_name(std::make_pair(primary_boundary, secondary_boundary),
1163 "lm_weightedgap_object_"),
1164 uo_params);
1165 }
1166 else if (_model == ContactModel::COULOMB && _formulation == ContactFormulation::MORTAR)
1167 {
1168 auto uo_params = _factory.getValidParams("LMWeightedVelocitiesUserObject");
1169 uo_params.set<BoundaryName>("primary_boundary") = primary_boundary;
1170 uo_params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
1171 uo_params.set<SubdomainName>("primary_subdomain") = primary_subdomain_name;
1172 uo_params.set<SubdomainName>("secondary_subdomain") = secondary_subdomain_name;
1173 uo_params.set<std::vector<VariableName>>("disp_x") = {displacements[0]};
1174 uo_params.set<std::vector<VariableName>>("disp_y") = {displacements[1]};
1175 if (ndisp > 2)
1176 uo_params.set<std::vector<VariableName>>("disp_z") = {displacements[2]};
1177
1178 uo_params.set<VariableName>("secondary_variable") = displacements[0];
1179 uo_params.set<bool>("use_displaced_mesh") = true;
1180 uo_params.set<std::vector<VariableName>>("lm_variable_normal") = {
1181 normal_lagrange_multiplier_name};
1182 uo_params.set<std::vector<VariableName>>("lm_variable_tangential_one") = {
1183 tangential_lagrange_multiplier_name};
1184 if (ndisp > 2)
1185 uo_params.set<std::vector<VariableName>>("lm_variable_tangential_two") = {
1186 tangential_lagrange_multiplier_3d_name};
1187 uo_params.applySpecificParameters(parameters(),
1188 {"correct_edge_dropping",
1189 "use_nodal_scaling",
1190 "triangulation",
1191 "triangulate_triangles",
1192 "minimum_projection_angle",
1193 "mortar_3d_subpatch_plane",
1194 "mortar_3d_qp_mapping",
1195 "use_petrov_galerkin",
1196 "debug_mesh"});
1197 if (getParam<bool>("use_petrov_galerkin"))
1198 uo_params.set<std::vector<VariableName>>("aux_lm") = {auxiliary_lagrange_multiplier_name};
1199
1200 _problem->addUserObject(
1201 "LMWeightedVelocitiesUserObject",
1202 register_mortar_uo_name(std::make_pair(primary_boundary, secondary_boundary),
1203 "lm_weightedvelocities_object_"),
1204 uo_params);
1205 }
1206
1207 if (_model != ContactModel::COULOMB && _formulation == ContactFormulation::MORTAR_PENALTY)
1208 {
1209 auto uo_params = _factory.getValidParams("PenaltyWeightedGapUserObject");
1210
1211 uo_params.set<BoundaryName>("primary_boundary") = primary_boundary;
1212 uo_params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
1213 uo_params.set<SubdomainName>("primary_subdomain") = primary_subdomain_name;
1214 uo_params.set<SubdomainName>("secondary_subdomain") = secondary_subdomain_name;
1215 uo_params.set<std::vector<VariableName>>("disp_x") = {displacements[0]};
1216 uo_params.set<std::vector<VariableName>>("disp_y") = {displacements[1]};
1217
1218 // AL parameters
1219 uo_params.applySpecificParameters(parameters(),
1220 {"correct_edge_dropping",
1221 "triangulation",
1222 "triangulate_triangles",
1223 "minimum_projection_angle",
1224 "mortar_3d_subpatch_plane",
1225 "mortar_3d_qp_mapping",
1226 "penalty",
1227 "debug_mesh",
1228 "max_penalty_multiplier",
1229 "adaptivity_penalty_normal"});
1230
1231 if (isParamValid("al_penetration_tolerance"))
1232 uo_params.set<Real>("penetration_tolerance") = getParam<Real>("al_penetration_tolerance");
1233 if (isParamValid("penalty_multiplier"))
1234 uo_params.set<Real>("penalty_multiplier") = getParam<Real>("penalty_multiplier");
1235 // In the contact action, we force the physical value of the normal gap, which also
1236 // normalizes the penalty factor with the "area" around the node
1237 uo_params.set<bool>("use_physical_gap") = true;
1238
1239 if (_use_dual)
1240 uo_params.set<std::vector<VariableName>>("aux_lm") = {auxiliary_lagrange_multiplier_name};
1241
1242 if (ndisp > 2)
1243 uo_params.set<std::vector<VariableName>>("disp_z") = {displacements[2]};
1244 uo_params.set<bool>("use_displaced_mesh") = true;
1245
1246 _problem->addUserObject(
1247 "PenaltyWeightedGapUserObject",
1248 register_mortar_uo_name(std::make_pair(primary_boundary, secondary_boundary),
1249 "penalty_weightedgap_object_"),
1250 uo_params);
1251 _problem->haveADObjects(true);
1252 }
1253 else if (_model == ContactModel::COULOMB &&
1254 _formulation == ContactFormulation::MORTAR_PENALTY)
1255 {
1256 auto uo_params = _factory.getValidParams("PenaltyFrictionUserObject");
1257 uo_params.set<BoundaryName>("primary_boundary") = primary_boundary;
1258 uo_params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
1259 uo_params.set<SubdomainName>("primary_subdomain") = primary_subdomain_name;
1260 uo_params.set<SubdomainName>("secondary_subdomain") = secondary_subdomain_name;
1261 uo_params.set<std::vector<VariableName>>("disp_x") = {displacements[0]};
1262 uo_params.set<bool>("correct_edge_dropping") = getParam<bool>("correct_edge_dropping");
1263 uo_params.set<std::vector<VariableName>>("disp_y") = {displacements[1]};
1264 if (ndisp > 2)
1265 uo_params.set<std::vector<VariableName>>("disp_z") = {displacements[2]};
1266
1267 uo_params.set<VariableName>("secondary_variable") = displacements[0];
1268 uo_params.set<bool>("use_displaced_mesh") = true;
1269 uo_params.set<Real>("friction_coefficient") = getParam<Real>("friction_coefficient");
1270 uo_params.set<Real>("penalty") = getParam<Real>("penalty");
1271 uo_params.set<Real>("penalty_friction") = getParam<Real>("penalty_friction");
1272
1273 // AL parameters
1274 uo_params.set<Real>("max_penalty_multiplier") = getParam<Real>("max_penalty_multiplier");
1275 uo_params.set<MooseEnum>("adaptivity_penalty_normal") =
1276 getParam<MooseEnum>("adaptivity_penalty_normal");
1277 uo_params.set<MooseEnum>("adaptivity_penalty_friction") =
1278 getParam<MooseEnum>("adaptivity_penalty_friction");
1279 if (isParamValid("al_penetration_tolerance"))
1280 uo_params.set<Real>("penetration_tolerance") = getParam<Real>("al_penetration_tolerance");
1281 if (isParamValid("penalty_multiplier"))
1282 uo_params.set<Real>("penalty_multiplier") = getParam<Real>("penalty_multiplier");
1283 if (isParamValid("penalty_multiplier_friction"))
1284 uo_params.set<Real>("penalty_multiplier_friction") =
1285 getParam<Real>("penalty_multiplier_friction");
1286
1287 if (isParamValid("al_incremental_slip_tolerance"))
1288 uo_params.set<Real>("slip_tolerance") = getParam<Real>("al_incremental_slip_tolerance");
1289 // In the contact action, we force the physical value of the normal gap, which also
1290 // normalizes the penalty factor with the "area" around the node
1291 uo_params.set<bool>("use_physical_gap") = true;
1292
1293 if (_use_dual)
1294 uo_params.set<std::vector<VariableName>>("aux_lm") = {auxiliary_lagrange_multiplier_name};
1295
1296 uo_params.applySpecificParameters(parameters(),
1297 {"triangulation",
1298 "triangulate_triangles",
1299 "minimum_projection_angle",
1300 "mortar_3d_subpatch_plane",
1301 "mortar_3d_qp_mapping",
1302 "friction_coefficient",
1303 "penalty",
1304 "penalty_friction"});
1305
1306 _problem->addUserObject(
1307 "PenaltyFrictionUserObject",
1308 register_mortar_uo_name(std::make_pair(primary_boundary, secondary_boundary),
1309 "penalty_friction_object_"),
1310 uo_params);
1311 _problem->haveADObjects(true);
1312 }
1313 }
1314 }
1315
1316 if (_current_task == "add_constraint")
1317 {
1318 for (const auto & contact_pair : _boundary_pairs)
1319 {
1320 const BoundaryName & primary_boundary = contact_pair.first;
1321 const BoundaryName & secondary_boundary = contact_pair.second;
1322 const std::string suffix = pairSuffix(contact_pair);
1323 const std::string primary_subdomain_name = primarySubdomainName(contact_pair);
1324 const std::string secondary_subdomain_name = action_name + "_secondary_subdomain" + suffix;
1325 const std::string normal_lagrange_multiplier_name = action_name + "_normal_lm" + suffix;
1326 const std::string tangential_lagrange_multiplier_name =
1327 action_name + "_tangential_lm" + suffix;
1328 const std::string tangential_lagrange_multiplier_3d_name =
1329 action_name + "_tangential_3d_lm" + suffix;
1330
1331 // Prepare problem for enforcement with Lagrange multipliers
1332 if (_model != ContactModel::COULOMB && _formulation == ContactFormulation::MORTAR)
1333 {
1334 std::string mortar_constraint_name;
1335
1336 if (!_mortar_dynamics)
1337 mortar_constraint_name = "ComputeWeightedGapLMMechanicalContact";
1338 else
1339 mortar_constraint_name = "ComputeDynamicWeightedGapLMMechanicalContact";
1340
1341 InputParameters params = _factory.getValidParams(mortar_constraint_name);
1342 if (_mortar_dynamics)
1344 parameters(), {"newmark_beta", "newmark_gamma", "capture_tolerance", "wear_depth"});
1345
1346 else // We need user objects for quasistatic constraints
1347 params.set<UserObjectName>("weighted_gap_uo") =
1348 "lm_weightedgap_object_" + name() + suffix;
1349
1350 params.set<BoundaryName>("primary_boundary") = primary_boundary;
1351 params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
1352 params.set<SubdomainName>("primary_subdomain") = primary_subdomain_name;
1353 params.set<SubdomainName>("secondary_subdomain") = secondary_subdomain_name;
1354 params.set<NonlinearVariableName>("variable") = normal_lagrange_multiplier_name;
1355 params.set<std::vector<VariableName>>("disp_x") = {displacements[0]};
1356 params.set<Real>("c") = getParam<Real>("c_normal");
1357
1358 if (ndisp > 1)
1359 params.set<std::vector<VariableName>>("disp_y") = {displacements[1]};
1360 if (ndisp > 2)
1361 params.set<std::vector<VariableName>>("disp_z") = {displacements[2]};
1362
1363 params.set<bool>("use_displaced_mesh") = true;
1364
1366 {"correct_edge_dropping",
1367 "triangulation",
1368 "triangulate_triangles",
1369 "minimum_projection_angle",
1370 "mortar_3d_subpatch_plane",
1371 "mortar_3d_qp_mapping",
1372 "normalize_c",
1373 "extra_vector_tags",
1374 "absolute_value_vector_tags",
1375 "debug_mesh"});
1376
1377 _problem->addConstraint(
1378 mortar_constraint_name, action_name + "_normal_lm_weighted_gap" + suffix, params);
1379 _problem->haveADObjects(true);
1380 }
1381 // Add the tangential and normal Lagrange's multiplier constraints on the secondary boundary.
1382 else if (_model == ContactModel::COULOMB && _formulation == ContactFormulation::MORTAR)
1383 {
1384 std::string mortar_constraint_name;
1385
1386 if (!_mortar_dynamics)
1387 mortar_constraint_name = "ComputeFrictionalForceLMMechanicalContact";
1388 else
1389 mortar_constraint_name = "ComputeDynamicFrictionalForceLMMechanicalContact";
1390
1391 InputParameters params = _factory.getValidParams(mortar_constraint_name);
1392 if (_mortar_dynamics)
1394 parameters(), {"newmark_beta", "newmark_gamma", "capture_tolerance", "wear_depth"});
1395 else
1396 { // We need user objects for quasistatic constraints
1397 params.set<UserObjectName>("weighted_gap_uo") =
1398 "lm_weightedvelocities_object_" + name() + suffix;
1399 params.set<UserObjectName>("weighted_velocities_uo") =
1400 "lm_weightedvelocities_object_" + name() + suffix;
1401 }
1402
1403 params.set<bool>("correct_edge_dropping") = getParam<bool>("correct_edge_dropping");
1404 params.set<BoundaryName>("primary_boundary") = primary_boundary;
1405 params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
1406 params.set<SubdomainName>("primary_subdomain") = primary_subdomain_name;
1407 params.set<SubdomainName>("secondary_subdomain") = secondary_subdomain_name;
1408 params.set<bool>("use_displaced_mesh") = true;
1409 params.set<Real>("c_t") = getParam<Real>("c_tangential");
1410 params.set<Real>("c") = getParam<Real>("c_normal");
1411 params.set<bool>("normalize_c") = getParam<bool>("normalize_c");
1412 params.set<bool>("compute_primal_residuals") = false;
1413
1414 params.set<MooseEnum>("segment_quadrature") = getParam<MooseEnum>("segment_quadrature");
1415
1416 params.set<std::vector<VariableName>>("disp_x") = {displacements[0]};
1417
1418 if (ndisp > 1)
1419 params.set<std::vector<VariableName>>("disp_y") = {displacements[1]};
1420 if (ndisp > 2)
1421 params.set<std::vector<VariableName>>("disp_z") = {displacements[2]};
1422
1423 params.set<NonlinearVariableName>("variable") = normal_lagrange_multiplier_name;
1424 params.set<std::vector<VariableName>>("friction_lm") = {
1425 tangential_lagrange_multiplier_name};
1426
1427 if (ndisp > 2)
1428 params.set<std::vector<VariableName>>("friction_lm_dir") = {
1429 tangential_lagrange_multiplier_3d_name};
1430
1431 params.set<Real>("mu") = getParam<Real>("friction_coefficient");
1432 params.set<MooseEnum>("friction_projection_degree") =
1433 getParam<MooseEnum>("friction_projection_degree");
1435 {"triangulation",
1436 "triangulate_triangles",
1437 "minimum_projection_angle",
1438 "mortar_3d_subpatch_plane",
1439 "mortar_3d_qp_mapping",
1440 "extra_vector_tags",
1441 "absolute_value_vector_tags",
1442 "debug_mesh"});
1443
1444 _problem->addConstraint(
1445 mortar_constraint_name, action_name + "_tangential_lm" + suffix, params);
1446 _problem->haveADObjects(true);
1447 }
1448
1449 const auto addMechanicalContactConstraints =
1450 [this,
1451 &primary_boundary,
1452 &secondary_boundary,
1453 &suffix,
1454 &primary_subdomain_name,
1455 &secondary_subdomain_name,
1456 &displacements](const std::string & variable_name,
1457 const std::string & constraint_prefix,
1458 const std::string & constraint_type,
1459 const bool is_additional_frictional_constraint,
1460 const bool is_normal_constraint)
1461 {
1462 InputParameters params = _factory.getValidParams(constraint_type);
1463
1464 params.set<bool>("correct_edge_dropping") = getParam<bool>("correct_edge_dropping");
1465 params.set<BoundaryName>("primary_boundary") = primary_boundary;
1466 params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
1467 params.set<SubdomainName>("primary_subdomain") = primary_subdomain_name;
1468 params.set<SubdomainName>("secondary_subdomain") = secondary_subdomain_name;
1469
1470 if (_formulation == ContactFormulation::MORTAR)
1471 params.set<NonlinearVariableName>("variable") = variable_name;
1472
1473 params.set<MooseEnum>("segment_quadrature") = getParam<MooseEnum>("segment_quadrature");
1474 params.set<bool>("use_displaced_mesh") = true;
1475 params.set<bool>("compute_lm_residuals") = false;
1476
1477 // Additional displacement residual for frictional problem
1478 // The second frictional LM acts on a perpendicular direction.
1479 if (is_additional_frictional_constraint)
1480 params.set<MooseEnum>("direction") = "direction_2";
1482 {"triangulation",
1483 "triangulate_triangles",
1484 "minimum_projection_angle",
1485 "mortar_3d_subpatch_plane",
1486 "mortar_3d_qp_mapping",
1487 "extra_vector_tags",
1488 "absolute_value_vector_tags",
1489 "debug_mesh"});
1490
1491 for (const auto i : index_range(displacements))
1492 {
1493 std::string constraint_name = constraint_prefix + Moose::stringify(i);
1494
1495 params.set<VariableName>("secondary_variable") = displacements[i];
1496 params.set<MooseEnum>("component") = i;
1497
1498 if (is_normal_constraint && _model != ContactModel::COULOMB &&
1499 _formulation == ContactFormulation::MORTAR)
1500 params.set<UserObjectName>("weighted_gap_uo") =
1501 "lm_weightedgap_object_" + name() + suffix;
1502 else if (is_normal_constraint && _model == ContactModel::COULOMB &&
1503 _formulation == ContactFormulation::MORTAR)
1504 params.set<UserObjectName>("weighted_gap_uo") =
1505 "lm_weightedvelocities_object_" + name() + suffix;
1506 else if (_formulation == ContactFormulation::MORTAR)
1507 params.set<UserObjectName>("weighted_velocities_uo") =
1508 "lm_weightedvelocities_object_" + name() + suffix;
1509 else if (is_normal_constraint && _model != ContactModel::COULOMB &&
1510 _formulation == ContactFormulation::MORTAR_PENALTY)
1511 params.set<UserObjectName>("weighted_gap_uo") =
1512 "penalty_weightedgap_object_" + name() + suffix;
1513 else if (is_normal_constraint && _model == ContactModel::COULOMB &&
1514 _formulation == ContactFormulation::MORTAR_PENALTY)
1515 params.set<UserObjectName>("weighted_gap_uo") =
1516 "penalty_friction_object_" + name() + suffix;
1517 else if (_formulation == ContactFormulation::MORTAR_PENALTY)
1518 params.set<UserObjectName>("weighted_velocities_uo") =
1519 "penalty_friction_object_" + name() + suffix;
1520
1521 _problem->addConstraint(constraint_type, constraint_name, params);
1522 }
1523 _problem->haveADObjects(true);
1524 };
1525
1526 // Add mortar mechanical contact constraint objects for primal variables
1527 addMechanicalContactConstraints(normal_lagrange_multiplier_name,
1528 action_name + "_normal_constraint" + suffix + "_",
1529 "NormalMortarMechanicalContact",
1530 /* is_additional_frictional_constraint = */ false,
1531 /* is_normal_constraint = */ true);
1532
1533 if (_model == ContactModel::COULOMB)
1534 {
1535 addMechanicalContactConstraints(tangential_lagrange_multiplier_name,
1536 action_name + "_tangential_constraint" + suffix + "_",
1537 "TangentialMortarMechanicalContact",
1538 /* is_additional_frictional_constraint = */ false,
1539 /* is_normal_constraint = */ false);
1540 if (ndisp > 2)
1541 addMechanicalContactConstraints(tangential_lagrange_multiplier_3d_name,
1542 action_name + "_tangential_constraint_3d" + suffix + "_",
1543 "TangentialMortarMechanicalContact",
1544 /* is_additional_frictional_constraint = */ true,
1545 /* is_normal_constraint = */ false);
1546 }
1547 }
1548 }
1549}
std::shared_ptr< MooseMesh > & _mesh
MooseApp & _app
static libMesh::FEType feType(const InputParameters &params)
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
Class to provide an interface for parameters and routines required to check convergence for the augme...
std::string primarySubdomainName(const std::pair< BoundaryName, BoundaryName > &pair) const
Returns the primary lower-dimensional subdomain name of a contact pair: the generated block or the us...
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
bool isUltimateMaster() const
const MeshGenerator & appendMeshGenerator(const std::string &type, const std::string &name, InputParameters params)
bool isRecovering() const
bool useMasterMesh() const
if(subdm)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by act().

◆ addNodeFaceContact()

void ContactAction::addNodeFaceContact ( )
private

Generate constraints for node to face contact.

Definition at line 1552 of file ContactAction.C.

1553{
1554 if (_current_task != "add_constraint")
1555 return;
1556
1557 std::string action_name = MooseUtils::shortName(name());
1558 std::vector<VariableName> displacements = getParam<std::vector<VariableName>>("displacements");
1559 const unsigned int ndisp = displacements.size();
1560
1561 std::string constraint_type;
1562
1563 if (_formulation == ContactFormulation::RANFS)
1564 constraint_type = "RANFSNormalMechanicalContact";
1565 else
1566 constraint_type = "MechanicalContactConstraint";
1567
1568 InputParameters params = _factory.getValidParams(constraint_type);
1569
1570 params.applyParameters(parameters(),
1571 {"displacements",
1572 "secondary_gap_offset",
1573 "mapped_primary_gap_offset",
1574 "primary",
1575 "secondary"});
1576
1577 const auto order = _problem->systemBaseNonlinear(/*nl_sys_num=*/0)
1578 .system()
1579 .variable_type(displacements[0])
1580 .order.get_order();
1581
1582 params.set<std::vector<VariableName>>("displacements") = displacements;
1583 params.set<bool>("use_displaced_mesh") = true;
1584 params.set<MooseEnum>("order") = Utility::enum_to_string<Order>(OrderWrapper{order});
1585
1586 for (const auto & contact_pair : _boundary_pairs)
1587 {
1588 if (_formulation != ContactFormulation::RANFS)
1589 {
1590 params.set<std::vector<VariableName>>("nodal_area") = {"nodal_area"};
1591 params.set<BoundaryName>("boundary") = contact_pair.first;
1592 if (isParamValid("secondary_gap_offset"))
1593 params.set<std::vector<VariableName>>("secondary_gap_offset") = {
1594 getParam<VariableName>("secondary_gap_offset")};
1595 if (isParamValid("mapped_primary_gap_offset"))
1596 params.set<std::vector<VariableName>>("mapped_primary_gap_offset") = {
1597 getParam<VariableName>("mapped_primary_gap_offset")};
1598 }
1599
1600 for (unsigned int i = 0; i < ndisp; ++i)
1601 {
1602 std::string name = action_name + "_constraint_" + Moose::stringify(contact_pair, "_") + "_" +
1604
1605 if (_formulation == ContactFormulation::RANFS)
1606 params.set<MooseEnum>("component") = i;
1607 else
1608 params.set<unsigned int>("component") = i;
1609
1610 params.set<BoundaryName>("primary") = contact_pair.first;
1611 params.set<BoundaryName>("secondary") = contact_pair.second;
1612 params.set<NonlinearVariableName>("variable") = displacements[i];
1613 params.set<std::vector<VariableName>>("primary_variable") = {displacements[i]};
1615 {"extra_vector_tags", "absolute_value_vector_tags"});
1616 _problem->addConstraint(constraint_type, name, params);
1617 }
1618 }
1619}

Referenced by act().

◆ addRelationshipManagers() [1/3]

void ContactAction::addRelationshipManagers ( Moose::RelationshipManagerType  input_rm_type)
overridevirtual

Reimplemented from Action.

Definition at line 890 of file ContactAction.C.

891{
892 if (_formulation == ContactFormulation::MORTAR ||
893 _formulation == ContactFormulation::MORTAR_PENALTY)
894 {
895 std::string action_name = MooseUtils::shortName(name());
896 for (const auto & [primary_boundary, secondary_boundary] : _boundary_pairs)
897 {
898 const std::string suffix = pairSuffix({primary_boundary, secondary_boundary});
899 auto params = MortarConstraintBase::validParams();
900 params.set<bool>("use_displaced_mesh") = true;
901 params.set<BoundaryName>("primary_boundary") = primary_boundary;
902 params.set<BoundaryName>("secondary_boundary") = secondary_boundary;
903 params.set<SubdomainName>("primary_subdomain") =
904 primarySubdomainName({primary_boundary, secondary_boundary});
905 params.set<SubdomainName>("secondary_subdomain") =
906 action_name + "_secondary_subdomain" + suffix;
907 params.set<bool>("use_petrov_galerkin") = getParam<bool>("use_petrov_galerkin");
908 params.set<Real>("minimum_projection_angle") = getParam<Real>("minimum_projection_angle");
909 params.set<MooseEnum>("mortar_3d_subpatch_plane") =
910 getParam<MooseEnum>("mortar_3d_subpatch_plane");
911 params.set<bool>("ghost_point_neighbors") = true;
912 addRelationshipManagers(input_rm_type, params);
913 }
914 }
915 else
916 {
917 const std::string constraint_type = _formulation == ContactFormulation::RANFS
918 ? "RANFSNormalMechanicalContact"
919 : "MechanicalContactConstraint";
920
921 for (const auto & contact_pair : _boundary_pairs)
922 {
923 auto params = _factory.getValidParams(constraint_type);
924 params.set<bool>("use_displaced_mesh") = true;
925 params.set<bool>("ghost_whole_interface") = getParam<bool>("ghost_whole_interface");
926 params.set<BoundaryName>("primary") = contact_pair.first;
927 params.set<BoundaryName>("secondary") = contact_pair.second;
928 addRelationshipManagers(input_rm_type, params);
929 }
930 }
931}
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
static InputParameters validParams()

Referenced by addRelationshipManagers().

◆ addRelationshipManagers() [2/3]

virtual void Action::addRelationshipManagers ( Moose::RelationshipManagerType  when_type)
virtual

Reimplemented from Action.

◆ addRelationshipManagers() [3/3]

bool Action::addRelationshipManagers ( Moose::RelationshipManagerType  when_type,
const InputParameters &  moose_object_pars 
)

◆ appendAutomaticPairingGenerator()

void ContactAction::appendAutomaticPairingGenerator ( )
private

Append the AutomaticContactPairingGenerator that detects contact pairs among _automatic_pairing_boundaries and, for mortar contact, creates their lower-dimensional blocks.

Definition at line 1628 of file ContactAction.C.

1629{
1630 // A sub-app cloning its parent mesh runs no mesh generators, so there would be no generator to
1631 // detect the pairs
1632 if (_app.useMasterMesh())
1633 paramError("automatic_pairing_boundaries",
1634 "Automatic contact pairing is not supported when cloning the parent app mesh.");
1635 if (_app.getMeshGeneratorNames().empty())
1636 paramError("automatic_pairing_boundaries",
1637 "Automatic contact pairing requires the mesh to be built by mesh generators. Use a "
1638 "FileMeshGenerator in the [Mesh] block to read a mesh file.");
1639
1640 // The generator is appended even when recovering. Generation is then skipped, but constructing
1641 // the generator declares the contact pairs mesh meta-data, which is restored from the checkpoint
1642 auto params = _factory.getValidParams("AutomaticContactPairingGenerator");
1643 params.set<std::vector<BoundaryName>>("automatic_pairing_boundaries") =
1645 params.set<Real>("automatic_pairing_distance") = getParam<Real>("automatic_pairing_distance");
1646 params.set<MooseEnum>("automatic_pairing_method") =
1647 getParam<MooseEnum>("automatic_pairing_method");
1648 params.set<std::string>("prefix") = MooseUtils::shortName(name());
1649 params.set<bool>("create_lower_d_blocks") =
1650 (_formulation == ContactFormulation::MORTAR ||
1651 _formulation == ContactFormulation::MORTAR_PENALTY) &&
1654 "AutomaticContactPairingGenerator", automaticPairingGeneratorName(), params);
1655}
std::string automaticPairingGeneratorName() const
Name of the AutomaticContactPairingGenerator appended by this action.
std::vector< std::string > getMeshGeneratorNames() const

Referenced by act().

◆ automaticPairingGeneratorName()

std::string ContactAction::automaticPairingGeneratorName ( ) const
private

Name of the AutomaticContactPairingGenerator appended by this action.

Definition at line 1622 of file ContactAction.C.

1623{
1624 return MooseUtils::shortName(name()) + "_auto_pairing_generator";
1625}

Referenced by appendAutomaticPairingGenerator(), and getAutomaticContactPairs().

◆ commonParameters()

InputParameters ContactAction::commonParameters ( )
static

Define parameters used by multiple contact objects.

Returns
InputParameters object populated with common parameters

Definition at line 1739 of file ContactAction.C.

1740{
1742
1743 params.addParam<MooseEnum>("normal_smoothing_method",
1745 "Method to use to smooth normals");
1746 params.addParam<Real>(
1747 "normal_smoothing_distance",
1748 "Distance from edge in parametric coordinates over which to smooth contact normal");
1749
1750 params.addParam<MooseEnum>(
1751 "formulation", ContactAction::getFormulationEnum(), "The contact formulation");
1752
1753 params.addParam<MooseEnum>("model", ContactAction::getModelEnum(), "The contact model to use");
1754
1755 return params;
1756}
InputParameters emptyInputParameters()
static MooseEnum getFormulationEnum()
Get contact formulation.
static MooseEnum getModelEnum()
Get contact model.
static MooseEnum getSmoothingEnum()
Get smoothing type.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)

Referenced by validParams(), and MechanicalContactConstraint::validParams().

◆ getAutomaticContactPairs()

void ContactAction::getAutomaticContactPairs ( )
private

Fill _boundary_pairs from the contact pairs mesh meta-data of the appended generator.

Definition at line 1658 of file ContactAction.C.

1659{
1660 const auto & pairs = getMeshProperty<AutomaticContactPairingGenerator::ContactPairs>(
1662 _boundary_pairs.assign(pairs.begin(), pairs.end());
1663
1664 mooseInfo("The following boundary pairs were detected automatically by the contact action:");
1665 for (const auto & [primary, secondary] : _boundary_pairs)
1666 mooseInfoRepeated("Primary boundary: ", primary, " and secondary boundary: ", secondary, ".");
1667}
void mooseInfoRepeated(Args &&... args)
static constexpr auto contact_pairs_property
Name of the mesh meta-data holding the detected contact pairs.
void mooseInfo(Args &&... args) const

Referenced by act().

◆ getFormulationEnum()

MooseEnum ContactAction::getFormulationEnum ( )
static

Get contact formulation.

Returns
enum

Definition at line 1682 of file ContactAction.C.

1683{
1684 auto formulations = MooseEnum(getContactFormulationOptions(), "kinematic");
1685
1686 formulations.addDocumentation(
1687 "ranfs",
1688 "Reduced Active Nonlinear Function Set scheme for node-on-face contact. Provides exact "
1689 "enforcement without Lagrange multipliers or penalty terms.");
1690 formulations.addDocumentation(
1691 "kinematic",
1692 "Kinematic contact constraint enforcement transfers the internal forces at secondary nodes "
1693 "to the corresponding primary face for node-on-face contact. Provides exact "
1694 "enforcement without Lagrange multipliers or penalty terms.");
1695 formulations.addDocumentation(
1696 "penalty",
1697 "Node-on-face penalty based contact constraint enforcement. Interpenetration is penalized. "
1698 "Enforcement depends on the penalty magnitude. High penalties can introduce ill conditioning "
1699 "of the system.");
1700 formulations.addDocumentation("augmented_lagrange",
1701 "Node-on-face augmented Lagrange penalty based contact constraint "
1702 "enforcement. Interpenetration is enforced up to a user specified "
1703 "tolerance, ill-conditioning is generally avoided. Requires an "
1704 "Augmented Lagrange Problem class to be used in the simulation.");
1705 formulations.addDocumentation(
1706 "tangential_penalty",
1707 "Node-on-face penalty based frictional contact constraint enforcement. Interpenetration and "
1708 "slip distance for sticking nodes are penalized. Enforcement depends on the penalty "
1709 "magnitudes. High penalties can introduce ill conditioning of the system.");
1710 formulations.addDocumentation(
1711 "mortar",
1712 "Mortar based contact constraint enforcement using Lagrange multipliers. Provides exact "
1713 "enforcement and a variationally consistent formulation. Lagrange multipliers introduce a "
1714 "saddle point character in the system matrix which can have a negative impact on scalability "
1715 "with iterative solvers");
1716 formulations.addDocumentation(
1717 "mortar_penalty",
1718 "Mortar and penalty based contact constraint enforcement. When using an Augmented Lagrange "
1719 "Problem class this provides normal (and tangential) contact constratint enforced up to a "
1720 "user specified tolerances. Without AL the enforcement depends on the penalty magnitudes. "
1721 "High penalties can introduce ill conditioning of the system.");
1722
1723 return formulations;
1724}

Referenced by commonParameters().

◆ getModelEnum()

MooseEnum ContactAction::getModelEnum ( )
static

Get contact model.

Returns
enum

Definition at line 1670 of file ContactAction.C.

1671{
1672 return MooseEnum(getContactModelOptions(), "frictionless");
1673}

Referenced by commonParameters(), and validParams().

◆ getProximityMethod()

MooseEnum ContactAction::getProximityMethod ( )
static

Get proximity method for automatic pairing.

Returns
enum

Definition at line 1676 of file ContactAction.C.

1677{
1678 return MooseEnum(getProximityMethodOptions());
1679}

Referenced by validParams().

◆ getSmoothingEnum()

MooseEnum ContactAction::getSmoothingEnum ( )
static

Get smoothing type.

Returns
enum

Definition at line 1733 of file ContactAction.C.

1734{
1735 return MooseEnum("edge_based nodal_normal_based", "");
1736}

Referenced by commonParameters().

◆ getSystemEnum()

MooseEnum ContactAction::getSystemEnum ( )
static

Get contact system.

Returns
enum

Definition at line 1727 of file ContactAction.C.

1728{
1729 return MooseEnum("Constraint", "Constraint");
1730}

◆ pairSuffix()

std::string ContactAction::pairSuffix ( const std::pair< BoundaryName, BoundaryName > &  pair) const
private

Returns a name suffix encoding the boundary pair for multi-pair mortar setups, or an empty string when there is only one pair (preserving single-pair name backwards compat).

Definition at line 934 of file ContactAction.C.

935{
937}
static std::string pairSuffix(const std::pair< BoundaryName, BoundaryName > &pair)
Name suffix identifying a (primary, secondary) boundary pair, used to build unique object names when ...

Referenced by act(), addMortarContact(), addRelationshipManagers(), and primarySubdomainName().

◆ primarySubdomainName()

std::string ContactAction::primarySubdomainName ( const std::pair< BoundaryName, BoundaryName > &  pair) const
private

Returns the primary lower-dimensional subdomain name of a contact pair: the generated block or the user-provided primary surface block.

Definition at line 940 of file ContactAction.C.

941{
942 if (!_primary_surface_blocks.empty())
943 return libmesh_map_find(_primary_surface_blocks, pair);
944 return MooseUtils::shortName(name()) + "_primary_subdomain" + pairSuffix(pair);
945}

Referenced by addMortarContact(), and addRelationshipManagers().

◆ removeRepeatedPairs()

void ContactAction::removeRepeatedPairs ( )
private

Remove repeated contact pairs from _boundary_pairs.

Definition at line 559 of file ContactAction.C.

560{
561 if (_boundary_pairs.size() == 0 && _automatic_pairing_boundaries.size() == 0)
563 "primary",
564 "Number of contact pairs in the contact action is zero. Please revise your input file.");
565
566 // Remove repeated interactions
567 std::vector<std::pair<BoundaryName, BoundaryName>> lean_boundary_pairs;
568
569 for (const auto & [primary, secondary] : _boundary_pairs)
570 {
571 // Structured bindings are not capturable (primary_copy, secondary_copy)
572 auto it = std::find_if(lean_boundary_pairs.begin(),
573 lean_boundary_pairs.end(),
574 [&, primary_copy = primary, secondary_copy = secondary](
575 const std::pair<BoundaryName, BoundaryName> & lean_pair)
576 {
577 const bool match_one = lean_pair.second == secondary_copy &&
578 lean_pair.first == primary_copy;
579 const bool match_two = lean_pair.second == primary_copy &&
580 lean_pair.first == secondary_copy;
581 const bool exist = match_one || match_two;
582 return exist;
583 });
584
585 if (it == lean_boundary_pairs.end())
586 lean_boundary_pairs.emplace_back(primary, secondary);
587 else
588 mooseInfo("Contact pair ",
589 primary,
590 "--",
591 secondary,
592 " has been removed from the contact interaction list due to "
593 "duplicates in the input file.");
594 }
595
596 _boundary_pairs = lean_boundary_pairs;
597}

Referenced by ContactAction().

◆ validParams()

InputParameters ContactAction::validParams ( )
static

Definition at line 58 of file ContactAction.C.

59{
62
63 params.addParam<std::vector<BoundaryName>>(
64 "primary", "The list of boundary IDs referring to primary sidesets");
65 params.addParam<std::vector<BoundaryName>>(
66 "secondary", "The list of boundary IDs referring to secondary sidesets");
67 params.addParam<std::vector<SubdomainName>>(
68 "primary_surface_blocks",
69 {},
70 "Surface mesh blocks, one per contact pair, used as the primary side of mortar contact "
71 "instead of a lower-dimensional block generated from the 'primary' boundary. Such a block "
72 "has no interior parent, e.g. a rigid surface mesh, and the corresponding 'primary' entry "
73 "must be a nodeset on its nodes.");
74 params.addParam<std::vector<BoundaryName>>(
75 "automatic_pairing_boundaries",
76 {},
77 "List of boundary IDs for sidesets that are automatically paired with any other boundary in "
78 "this list having a centroid-to-centroid distance less than the value specified in the "
79 "'automatic_pairing_distance' parameter. ");
81 "automatic_pairing_distance",
82 "automatic_pairing_distance>=0",
83 "The maximum distance the centroids of the boundaries provided in the "
84 "'automatic_pairing_boundaries' parameter can be to generate a contact pair automatically. "
85 "Due to numerical error in the determination of the centroids, it is encouraged that "
86 "the user adds a tolerance to this distance (e.g. extra 10%) to make sure no suitable "
87 "contact pair is missed. If the 'automatic_pairing_method = NODE' option is chosen instead, "
88 "this distance is recommended to be set to at least twice the minimum distance between "
89 "nodes of boundaries to be paired.");
90 params.addDeprecatedParam<MeshGeneratorName>(
91 "mesh",
92 "The mesh generator for mortar method",
93 "This parameter is not used anymore and can simply be removed");
94 params.addParam<VariableName>("secondary_gap_offset",
95 "Offset to gap distance from secondary side");
96 params.addParam<VariableName>("mapped_primary_gap_offset",
97 "Offset to gap distance mapped from primary side");
98 params.addParam<std::vector<VariableName>>(
99 "displacements",
100 {},
101 "The displacements appropriate for the simulation geometry and coordinate system");
102 params.addParam<Real>(
103 "penalty",
104 1e8,
105 "The penalty to apply. This can vary depending on the stiffness of your materials");
106 params.addParam<Real>(
107 "penalty_friction",
108 1e8,
109 "The penalty factor to apply in mortar penalty frictional constraints. It is applied to the "
110 "tangential accumulated slip to build the frictional force");
112 "penalty_multiplier",
113 1.0,
114 "penalty_multiplier > 0",
115 "The growth factor for the penalty applied at the end of each augmented "
116 "Lagrange update iteration (a value larger than one, e.g., 10, tends to speed up "
117 "convergence.)");
119 "penalty_multiplier_friction",
120 1.0,
121 "penalty_multiplier_friction > 0",
122 "The penalty growth factor between augmented Lagrange "
123 "iterations for penalizing relative slip distance if the node is under stick conditions.(a "
124 "value larger than one, e.g., 10, tends to speed up convergence.)");
125 params.addParam<Real>("friction_coefficient", 0, "The friction coefficient");
126 params.addParam<Real>("tension_release",
127 0.0,
128 "Tension release threshold. A node in contact "
129 "will not be released if its tensile load is below "
130 "this value. No tension release if negative.");
131 params.addParam<MooseEnum>("model", ContactAction::getModelEnum(), "The contact model to use");
132 params.addParam<Real>("tangential_tolerance",
133 "Tangential distance to extend edges of contact surfaces");
134 params.addParam<Real>("capture_tolerance",
135 0.0,
136 "Normal distance from surface within which nodes are captured. This "
137 "parameter is used for node-face and mortar formulations.");
138 params.addParam<Real>(
139 "normal_smoothing_distance",
140 "Distance from edge in parametric coordinates over which to smooth contact normal");
141
142 params.addParam<bool>("normalize_penalty",
143 false,
144 "Whether to normalize the penalty parameter with the nodal area.");
145 params.addParam<bool>(
146 "primary_secondary_jacobian",
147 true,
148 "Whether to include Jacobian entries coupling primary and secondary nodes.");
149 params.addParam<bool>(
150 "ghost_whole_interface",
151 false,
152 "Whether to geometrically and algebraically ghost the entire primary side of the interface "
153 "for node-face contact constraints.");
154 params.addParam<Real>("al_penetration_tolerance",
155 "The tolerance of the penetration for augmented Lagrangian method.");
156 params.addParam<Real>("al_incremental_slip_tolerance",
157 "The tolerance of the incremental slip for augmented Lagrangian method.");
159 "max_penalty_multiplier",
160 1.0e3,
161 "max_penalty_multiplier >= 1.0",
162 "Maximum multiplier applied to penalty factors when adaptivity is used in an augmented "
163 "Lagrange setting. The penalty factor supplied by the user is used as a reference to "
164 "determine its maximum. If this multiplier is too large, the condition number of the system "
165 "to be solved may be negatively impacted.");
166 MooseEnum adaptivity_penalty_normal("SIMPLE BUSSETTA", "SIMPLE");
167 adaptivity_penalty_normal.addDocumentation(
168 "SIMPLE", "Keep multiplying by the penalty multiplier between AL iterations");
169 adaptivity_penalty_normal.addDocumentation(
170 "BUSSETTA",
171 "Modify the penalty using an algorithm from Bussetta et al, 2012, Comput Mech 49:259-275 "
172 "between AL iterations.");
173 params.addParam<MooseEnum>(
174 "adaptivity_penalty_normal",
175 adaptivity_penalty_normal,
176 "The augmented Lagrange update strategy used on the normal penalty coefficient.");
177 MooseEnum adaptivity_penalty_friction("SIMPLE FRICTION_LIMIT", "FRICTION_LIMIT");
178 adaptivity_penalty_friction.addDocumentation(
179 "SIMPLE", "Keep multiplying by the frictional penalty multiplier between AL iterations");
180 adaptivity_penalty_friction.addDocumentation(
181 "FRICTION_LIMIT",
182 "This strategy will be guided by the Coulomb limit and be less reliant on the initial "
183 "penalty factor provided by the user.");
184 params.addParam<MooseEnum>(
185 "adaptivity_penalty_friction",
186 adaptivity_penalty_friction,
187 "The augmented Lagrange update strategy used on the frictional penalty coefficient.");
188 params.addParam<Real>("al_frictional_force_tolerance",
189 "The tolerance of the frictional force for augmented Lagrangian method.");
190 params.addParam<Real>(
191 "c_normal",
192 1e6,
193 "Parameter for balancing the size of the gap and contact pressure for a mortar formulation. "
194 "This purely numerical "
195 "parameter affects convergence behavior and, in general, should be larger for stiffer "
196 "materials. It is recommended that the user tries out various orders of magnitude for this "
197 "parameter if the default value generates poor contact convergence.");
198 params.addParam<Real>(
199 "c_tangential", 1, "Numerical parameter for nonlinear mortar frictional constraints");
200 MooseEnum friction_projection_degree("ONE TWO", "TWO");
201 friction_projection_degree.addDocumentation(
202 "ONE", "Use the degree-one Alart-Curnier friction residual.");
203 friction_projection_degree.addDocumentation(
204 "TWO", "Use the degree-two Hueber-Stadler-Wohlmuth friction residual.");
205 params.addParam<MooseEnum>("friction_projection_degree",
206 friction_projection_degree,
207 "Degree of the friction-residual projection; see "
208 "MortarContactUtils.h. Only valid for Coulomb friction mortar "
209 "contact.");
210 params.addParam<bool>("ping_pong_protection",
211 false,
212 "Whether to protect against ping-ponging, e.g. the oscillation of the "
213 "secondary node between two "
214 "different primary faces, by tying the secondary node to the "
215 "edge between the involved primary faces");
216 params.addParam<Real>(
217 "normal_lm_scaling",
218 1.,
219 "Scaling factor to apply to the normal LM variable for a mortar formulation");
220 params.addParam<Real>(
221 "tangential_lm_scaling",
222 1.,
223 "Scaling factor to apply to the tangential LM variable for a mortar formulation");
224 MooseEnum lm_space(getContactLMSpaceOptions(), "MATCH_DISPLACEMENT");
225 lm_space.addDocumentation(
226 "MATCH_DISPLACEMENT",
227 "Use the same finite element order as the displacement variables for generated mortar "
228 "Lagrange multiplier variables.");
229 lm_space.addDocumentation(
230 "LINEAR",
231 "Use first-order LAGRANGE generated mortar Lagrange multiplier variables, independent "
232 "of the displacement variable order.");
233 params.addParam<MooseEnum>(
234 "lm_space",
235 lm_space,
236 "Finite element space for mortar Lagrange multiplier variables generated by the "
237 "contact action. This parameter only applies to the 'mortar' contact formulation.");
238 params.addParam<bool>(
239 "normalize_c",
240 false,
241 "Whether to normalize c by weighting function norm for mortar contact. When unnormalized "
242 "the value of c effectively depends on element size since in the constraint we compare nodal "
243 "Lagrange Multiplier values to integrated gap values (LM nodal value is independent of "
244 "element size, where integrated values are dependent on element size).");
245 params.addClassDescription("Sets up all objects needed for mechanical contact enforcement");
246 params.addParam<bool>(
247 "use_dual",
248 "Whether to use the dual mortar approach within a mortar formulation. It is defaulted to "
249 "true for "
250 "weighted quantity approach, and to false for the legacy approach. To avoid instabilities "
251 "in the solution and obtain the full benefits of a variational enforcement,"
252 "use of dual mortar with weighted constraints is strongly recommended. This "
253 "input is only intended for advanced users.");
254 params.addParam<bool>(
255 "correct_edge_dropping",
256 false,
257 "Whether to enable correct edge dropping treatment for mortar constraints. When disabled "
258 "any Lagrange Multiplier degree of freedom on a secondary element without full primary "
259 "contributions will be set (strongly) to 0.");
260 params.addParam<bool>(
261 "use_nodal_scaling",
262 false,
263 "Whether to apply the node-based Lagrange-multiplier scaling of Popp et al. (2013) to "
264 "improve the conditioning of the linear system when secondary elements are only partially "
265 "covered (edge dropping). See the documentation for the current limitations.");
267 params.addParam<bool>(
268 "generate_mortar_mesh",
269 true,
270 "Whether to generate the mortar mesh from the action. Typically this will be the case, but "
271 "one may also want to reuse an existing lower-dimensional mesh prior to a restart.");
272 params.addParam<MooseEnum>("automatic_pairing_method",
274 "The proximity method used for automatic pairing of boundaries.");
275 params.addParam<bool>(
276 "mortar_dynamics",
277 false,
278 "Whether to use constraints that account for the persistency condition, giving rise to "
279 "smoother normal contact pressure evolution. This flag should only be set to yes for dynamic "
280 "simulations using the Newmark-beta numerical integrator");
281 params.addParam<Real>(
282 "newmark_beta",
283 0.25,
284 "Newmark-beta beta parameter for its inclusion in the weighted gap update formula");
285 params.addParam<Real>(
286 "newmark_gamma",
287 0.5,
288 "Newmark-beta gamma parameter for its inclusion in the weighted gap update formula");
289 params.addCoupledVar("wear_depth",
290 "The name of the mortar auxiliary variable that is used to modify the "
291 "weighted gap definition");
292 params.addParam<std::vector<TagName>>(
293 "extra_vector_tags",
294 "The tag names for extra vectors that residual data should be saved into");
295 params.addParam<std::vector<TagName>>(
296 "absolute_value_vector_tags",
297 "The tags for the vectors this residual object should fill with the "
298 "absolute value of the residual contribution");
299 params.addParam<bool>(
300 "use_petrov_galerkin",
301 false,
302 "Whether to use the Petrov-Galerkin approach for the mortar-based constraints. If set to "
303 "true, we use the standard basis as the test function and dual basis as "
304 "the shape function for the interpolation of the Lagrange multiplier variable.");
305 params.addParam<bool>(
306 "debug_mesh",
307 false,
308 "Whether we are going to enable mortar segment mesh debug information. An exodus"
309 "file will be generated if the user sets this flag to true");
310 const auto mortar_constraint_params = MortarConstraintBase::validParams();
311 params.transferParam<MooseEnum>(mortar_constraint_params, "segment_quadrature");
312 params.transferParam<Real>(mortar_constraint_params, "minimum_projection_angle");
313 params.transferParam<MooseEnum>(mortar_constraint_params, "mortar_3d_subpatch_plane");
314 params.transferParam<MooseEnum>(mortar_constraint_params, "mortar_3d_qp_mapping");
315
316 // Contact surface definition
317 params.addParamNamesToGroup("primary secondary primary_surface_blocks displacements",
318 "Contact Surface Definition");
319 // Automatic pairing
320 params.addParamNamesToGroup(
321 "automatic_pairing_boundaries automatic_pairing_distance automatic_pairing_method",
322 "Automatic Contact Pair Generation");
323 // Contact formulation and model
324 params.addParamNamesToGroup("formulation model", "Contact Formulation");
325 // Penalty parameters
326 params.addParamNamesToGroup(
327 "penalty penalty_friction penalty_multiplier penalty_multiplier_friction "
328 "max_penalty_multiplier normalize_penalty",
329 "Penalty Parameters");
330 // Augmented Lagrange settings
331 params.addParamNamesToGroup(
332 "al_penetration_tolerance al_incremental_slip_tolerance al_frictional_force_tolerance "
333 "adaptivity_penalty_normal adaptivity_penalty_friction",
334 "Augmented Lagrange");
335 // Friction
336 params.addParamNamesToGroup("friction_coefficient tension_release friction_projection_degree",
337 "Friction");
338 // Mortar-specific parameters
339 params.addParamNamesToGroup("c_normal c_tangential normal_lm_scaling tangential_lm_scaling "
340 "lm_space "
341 "use_dual correct_edge_dropping normalize_c use_petrov_galerkin "
342 "use_nodal_scaling "
343 "generate_mortar_mesh segment_quadrature minimum_projection_angle "
344 "mortar_3d_subpatch_plane mortar_3d_qp_mapping wear_depth debug_mesh",
345 "Mortar");
346 // Mortar dynamics (Newmark-beta)
347 params.addParamNamesToGroup("mortar_dynamics newmark_beta newmark_gamma", "Mortar Dynamics");
348 // Gap and tolerance settings
349 params.addParamNamesToGroup(
350 "secondary_gap_offset mapped_primary_gap_offset capture_tolerance "
351 "tangential_tolerance normal_smoothing_distance normal_smoothing_method",
352 "Gap and Tolerance");
353 // Jacobian and solver options
354 params.addParamNamesToGroup("primary_secondary_jacobian ping_pong_protection", "Solver Options");
355 // Interface ghosting
356 params.addParamNamesToGroup("ghost_whole_interface", "Interface Ghosting");
357 // Residual vector tags
358 params.addParamNamesToGroup("extra_vector_tags absolute_value_vector_tags", "Residual Tags");
359
360 return params;
361}
static InputParameters validParams()
static MooseEnum getProximityMethod()
Get proximity method for automatic pairing.
static InputParameters commonParameters()
Define parameters used by multiple contact objects.
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
static InputParameters triangulationParams()

Member Data Documentation

◆ _automatic_pairing_boundaries

std::vector<BoundaryName> ContactAction::_automatic_pairing_boundaries
protected

List of all possible boundaries for contact for automatic pairing (optional)

Definition at line 85 of file ContactAction.h.

Referenced by act(), addMortarContact(), appendAutomaticPairingGenerator(), ContactAction(), and removeRepeatedPairs().

◆ _bnd_pair_to_mortar_info

std::map<std::pair<BoundaryName, BoundaryName>, const MortarInfo> ContactAction::_bnd_pair_to_mortar_info
protected

Map from boundary pair to mortar user object name.

Definition at line 116 of file ContactAction.h.

Referenced by act(), addContactPressureAuxKernel(), and addMortarContact().

◆ _boundary_pairs

std::vector<std::pair<BoundaryName, BoundaryName> > ContactAction::_boundary_pairs
protected

Primary/Secondary boundary name pairs for mechanical contact.

Definition at line 82 of file ContactAction.h.

Referenced by act(), addContactPressureAuxKernel(), addMortarContact(), addNodeFaceContact(), addRelationshipManagers(), ContactAction(), getAutomaticContactPairs(), pairSuffix(), and removeRepeatedPairs().

◆ _formulation

const ContactFormulation ContactAction::_formulation
protected

◆ _generate_mortar_mesh

const bool ContactAction::_generate_mortar_mesh
protected

Whether to generate the mortar mesh (useful in a restart simulation e.g.).

Definition at line 100 of file ContactAction.h.

Referenced by addMortarContact(), and appendAutomaticPairingGenerator().

◆ _lm_space

const ContactLMSpace ContactAction::_lm_space
protected

Finite element space to use for action-generated mortar Lagrange multiplier variables.

Definition at line 94 of file ContactAction.h.

Referenced by act(), and addMortarContact().

◆ _model

const ContactModel ContactAction::_model
protected

Contact model type enum.

Definition at line 88 of file ContactAction.h.

Referenced by act(), addMortarContact(), and ContactAction().

◆ _mortar_dynamics

const bool ContactAction::_mortar_dynamics
protected

Whether mortar dynamic contact constraints are to be used.

Definition at line 103 of file ContactAction.h.

Referenced by addMortarContact().

◆ _primary_surface_blocks

std::map<std::pair<BoundaryName, BoundaryName>, SubdomainName> ContactAction::_primary_surface_blocks
protected

Surface mesh blocks used as the primary side of mortar contact, by contact pair.

Definition at line 106 of file ContactAction.h.

Referenced by addMortarContact(), ContactAction(), and primarySubdomainName().

◆ _use_dual

bool ContactAction::_use_dual
protected

Whether to use the dual Mortar approach.

Definition at line 97 of file ContactAction.h.

Referenced by addMortarContact(), and ContactAction().


The documentation for this class was generated from the following files: