https://mooseframework.inl.gov
CohesiveZoneMortarUserObjectAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
12 // supported user objects
14 
16 
18  "mode_mixity_ratio cohesive_damage local_normal_jump local_tangential_jump");
19 
22 {
24  params.addClassDescription(
25  "Populates an auxiliary variable with mortar cohesive zone model quantities.");
27  "cohesive_zone_quantity",
29  "The desired cohesive zone model quantity to output as an auxiliary variable.");
30  params.addRequiredParam<UserObjectName>("user_object",
31  "The mortar cohesive zone modeling user object to get "
32  "values from. Note that the user object "
33  "must implement the corresponding getter function.");
34  params.set<ExecFlagEnum>("execute_on") = {EXEC_TIMESTEP_END};
35  params.suppressParameter<ExecFlagEnum>("execute_on");
36  return params;
37 }
38 
40  : AuxKernel(parameters),
41  _cohesive_zone_quantity(
42  getParam<MooseEnum>("cohesive_zone_quantity").getEnum<CohesiveQuantityEnum>()),
43  _user_object(getUserObject<UserObject>("user_object")),
44  _cohesive_zone_uo(dynamic_cast<const BilinearMixedModeCohesiveZoneModel *>(&_user_object)),
46  {"BilinearMixedModeCohesiveZoneModel",
50  {"BilinearMixedModeCohesiveZoneModel",
54  {"BilinearMixedModeCohesiveZoneModel",
58  {"BilinearMixedModeCohesiveZoneModel", _cohesive_zone_uo, [&]() {
60  }}}})
61 {
62  if (!isNodal())
63  mooseError("This auxiliary kernel requires nodal variables to obtain contact pressure values");
64 
65  // error check
66  const auto it = _outputs.find(_cohesive_zone_quantity);
67  if (it == _outputs.end())
68  mooseError("Internal error: Contact quantity request in PressureMortarUserObjectAux is not "
69  "recognized.");
70  if (!std::get<1>(it->second))
71  paramError("user_object",
72  "The '",
73  _cohesive_zone_quantities.getNames()[static_cast<int>(it->first)],
74  "' quantity is only provided by a '",
75  std::get<0>(it->second),
76  "' or derived object.");
77 }
78 
79 Real
81 {
82  // execute functional to retrieve selected quantity
83  return std::get<2>(_outputs[_cohesive_zone_quantity])();
84 }
Real getModeMixityRatio(const Node *const node) const
void mooseError(Args &&... args)
static const MooseEnum _cohesive_zone_quantities
Available cohesive zone model quantities.
const Node *const & _current_node
T & set(const std::string &name, bool quiet_mode=false)
const ExecFlagType EXEC_TIMESTEP_END
Real getCohesiveDamage(const Node *const node) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void suppressParameter(const std::string &name)
Real getLocalDisplacementTangential(const Node *const node) const
CohesiveZoneMortarUserObjectAux(const InputParameters &parameters)
const CohesiveQuantityEnum _cohesive_zone_quantity
What penalty mortar contact quantity we&#39;d like to output.
Auxiliary kernel to output mortar cohesive zone model quantities of interest.
const BilinearMixedModeCohesiveZoneModel * _cohesive_zone_uo
Cast pointers to specific UOs.
CohesiveQuantityEnum
What type of cohesive zone quantity we are querying.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< CohesiveQuantityEnum, std::tuple< std::string, const void *, std::function< Real(void)> > > _outputs
Definition of the output quantities and.
User object that interface pressure resulting from a simple traction separation law.
registerMooseObject("ContactApp", CohesiveZoneMortarUserObjectAux)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Real getLocalDisplacementNormal(const Node *const node) const