https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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 "local_tangential_jump_1 local_tangential_jump_2 local_tangential_jump_effective "
20 "cohesive_traction_normal cohesive_traction_tangential_magnitude "
21 "cohesive_traction_tangential_1 cohesive_traction_tangential_2 "
22 "cohesive_traction_effective");
23
26{
29 "Populates an auxiliary variable with mortar cohesive zone model quantities.");
31 "cohesive_zone_quantity",
33 "The desired cohesive zone model quantity to output as an auxiliary variable.");
34 params.addRequiredParam<UserObjectName>("user_object",
35 "The mortar cohesive zone modeling user object to get "
36 "values from. Note that the user object "
37 "must implement the corresponding getter function.");
38 params.set<ExecFlagEnum>("execute_on") = {EXEC_TIMESTEP_END};
39 params.suppressParameter<ExecFlagEnum>("execute_on");
40 return params;
41}
42
44 : AuxKernel(parameters),
45 _cohesive_zone_quantity(
46 getParam<MooseEnum>("cohesive_zone_quantity").getEnum<CohesiveQuantityEnum>()),
47 _user_object(getUserObject<UserObject>("user_object")),
48 _cohesive_zone_uo(dynamic_cast<const BilinearMixedModeCohesiveZoneModel *>(&_user_object)),
49 _outputs(
51 {"BilinearMixedModeCohesiveZoneModel",
55 {"BilinearMixedModeCohesiveZoneModel",
59 {"BilinearMixedModeCohesiveZoneModel",
63 {"BilinearMixedModeCohesiveZoneModel",
67 {"BilinearMixedModeCohesiveZoneModel",
71 {"BilinearMixedModeCohesiveZoneModel",
75 {"BilinearMixedModeCohesiveZoneModel",
77 [&]()
80 {"BilinearMixedModeCohesiveZoneModel",
84 {"BilinearMixedModeCohesiveZoneModel",
86 [&]()
89 {"BilinearMixedModeCohesiveZoneModel",
93 {"BilinearMixedModeCohesiveZoneModel",
97 {"BilinearMixedModeCohesiveZoneModel",
100{
101 if (!isNodal())
102 mooseError("This auxiliary kernel requires nodal variables to obtain contact pressure values");
103
104 // error check
105 const auto it = _outputs.find(_cohesive_zone_quantity);
106 if (it == _outputs.end())
107 mooseError("Internal error: Contact quantity request in PressureMortarUserObjectAux is not "
108 "recognized.");
109 if (!std::get<1>(it->second))
110 paramError("user_object",
111 "The '",
112 _cohesive_zone_quantities.getNames()[static_cast<int>(it->first)],
113 "' quantity is only provided by a '",
114 std::get<0>(it->second),
115 "' or derived object.");
116}
117
118Real
120{
121 // execute functional to retrieve selected quantity
122 return std::get<2>(_outputs[_cohesive_zone_quantity])();
123}
registerMooseObject("ContactApp", CohesiveZoneMortarUserObjectAux)
void mooseError(Args &&... args)
const ExecFlagType EXEC_TIMESTEP_END
const Node *const & _current_node
static InputParameters validParams()
User object that computes bilinear mixed mode traction separation law.
Real getLocalDisplacementTangentialOne(const Node *const node) const
Real getCohesiveDamage(const Node *const node) const
Real getLocalDisplacementTangential(const Node *const node) const
Real getCohesiveTractionTangentialMagnitude(const Node *const node) const
Real getLocalDisplacementTangentialEffective(const Node *const node) const
Real getCohesiveTractionTangentialTwo(const Node *const node) const
Real getCohesiveTractionNormal(const Node *const node) const
Real getModeMixityRatio(const Node *const node) const
Real getLocalDisplacementNormal(const Node *const node) const
Real getCohesiveTractionTangentialOne(const Node *const node) const
Real getCohesiveTractionEffective(const Node *const node) const
Real getLocalDisplacementTangentialTwo(const Node *const node) const
Auxiliary kernel to output mortar cohesive zone model quantities of interest.
static const MooseEnum _cohesive_zone_quantities
Available cohesive zone model quantities.
const BilinearMixedModeCohesiveZoneModel * _cohesive_zone_uo
Cast pointers to specific UOs.
std::map< CohesiveQuantityEnum, std::tuple< std::string, const void *, std::function< Real(void)> > > _outputs
Definition of the output quantities and.
CohesiveQuantityEnum
What type of cohesive zone quantity we are querying.
const CohesiveQuantityEnum _cohesive_zone_quantity
What penalty mortar contact quantity we'd like to output.
CohesiveZoneMortarUserObjectAux(const InputParameters &parameters)
void suppressParameter(const std::string &name)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real