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

#include <CohesiveZoneAction.h>

Inheritance diagram for CohesiveZoneAction:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 CohesiveZoneAction (const InputParameters &params)
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType input_rm_type) override
 
void act () override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 Method adding the proper relationship manager.
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 Method adding the proper relationship manager.
 
void timedAct ()
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () 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 InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (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
 
PerfGraphperfGraph ()
 
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 void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static MultiMooseEnum outputPropertiesType ()
 output methods
 
static MultiMooseEnum materialOutputOrders ()
 
static MultiMooseEnum materialOutputFamilies ()
 

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
 
static const std::map< std::string, std::string > _real_vector_cartesian_component_table
 table data for output generation
 
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _vector_direction_table
 
static const std::vector< char > _component_table = {'x', 'y', 'z'}
 

Protected Types

enum class  Strain { Small , Finite }
 strain formulation More...
 

Protected Member Functions

void actOutputGeneration ()
 
void actOutputMatProp ()
 
void addRequiredCZMInterfaceKernels ()
 adds the required interfacekernels based on the selected strain formulation
 
void addRequiredCZMInterfaceMaterials ()
 adds the required interface materials based on the selected strain formulation
 
void verifyOrderAndFamilyOutputs ()
 verifies order and family of output variables
 
void prepareSaveInInputs (std::vector< AuxVariableName > &, std::string &, const std::vector< AuxVariableName > &, const std::vector< AuxVariableName > &, const int &) const
 method to prepare save_in and diag_save_in inputs for the interface kernel
 
void chekMultipleActionParameters ()
 method checking multiple CohesiveZoneAction block inputs
 
template<typename T , typename T2 >
bool setupOutput (std::string out, T table, T2 setup)
 
std::string addBaseName (const std::string &name) const
 simple method for adding the base name to a variable
 
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 TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (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< VariableName > _displacements
 the disaplcements varaible names
 
const unsigned int _ndisp
 number of displacement components
 
const bool _use_AD
 whether to use AD kernels and materials
 
const std::string _base_name
 Base name of the material system.
 
const std::vector< BoundaryName > _boundary
 Base name of the material system.
 
enum CohesiveZoneAction::Strain _strain
 
std::vector< std::string > _generate_output
 output materials to generate scalar traction/jump vector quantities
 
MultiMooseEnum _material_output_order
 
MultiMooseEnum _material_output_family
 
std::set< BoundaryName > _boundary_name_union
 set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks
 
std::set< Strain_strain_formulation_union
 set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks
 
const bool _verbose
 display info
 
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
 
std::vector< AuxVariableName > _save_in_primary
 residual debugging
 
std::vector< AuxVariableName > _diag_save_in_primary
 
std::vector< AuxVariableName > _save_in_secondary
 
std::vector< AuxVariableName > _diag_save_in_secondary
 
std::string _czm_kernel_name
 kernel's and materials's names
 
std::string _disp_jump_provider_name
 
std::string _equilibrium_traction_calculator_name
 

Private Member Functions

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)
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValuegetMeshPropertyInternal (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

Definition at line 14 of file CohesiveZoneAction.h.

Member Enumeration Documentation

◆ Strain

enum class CohesiveZoneAction::Strain
strongprotected

strain formulation

Enumerator
Small 
Finite 

Definition at line 68 of file CohesiveZoneAction.h.

69 {
70 Small,
71 Finite
72 } _strain;
enum CohesiveZoneAction::Strain _strain

Constructor & Destructor Documentation

◆ CohesiveZoneAction()

CohesiveZoneAction::CohesiveZoneAction ( const InputParameters params)

Definition at line 35 of file CohesiveZoneAction.C.

36 : CohesiveZoneActionBase(params),
37 _displacements(getParam<std::vector<VariableName>>("displacements")),
38 _ndisp(_displacements.size()),
39 _use_AD(getParam<bool>("use_automatic_differentiation")),
40 _base_name(isParamValid("base_name") && !getParam<std::string>("base_name").empty()
41 ? getParam<std::string>("base_name")
42 : ""),
43 _boundary(getParam<std::vector<BoundaryName>>("boundary")),
44 _strain(getParam<MooseEnum>("strain").getEnum<Strain>()),
45 _save_in_primary(getParam<std::vector<AuxVariableName>>("save_in_primary")),
46 _diag_save_in_primary(getParam<std::vector<AuxVariableName>>("diag_save_in_primary")),
47 _save_in_secondary(getParam<std::vector<AuxVariableName>>("save_in_secondary")),
48 _diag_save_in_secondary(getParam<std::vector<AuxVariableName>>("diag_save_in_secondary")),
49 _material_output_order(getParam<MultiMooseEnum>("material_output_order")),
50 _material_output_family(getParam<MultiMooseEnum>("material_output_family")),
51 _verbose(getParam<bool>("verbose"))
52{
53 // We can't enforce consistency between the number of displacement variables and the mesh
54 // dimension. Hence we only check we have a reasonable number of displacement variables
55 if (_ndisp > 3 || _ndisp < 1)
56 mooseError("the CZM Action requires 1, 2 or 3 displacement variables.");
57
58 switch (_strain)
59 {
60 case Strain::Small:
61 {
63 _use_AD ? "ADCZMInterfaceKernelSmallStrain" : "CZMInterfaceKernelSmallStrain";
64 _disp_jump_provider_name = _use_AD ? "ADCZMComputeDisplacementJumpSmallStrain"
65 : "CZMComputeDisplacementJumpSmallStrain";
67 _use_AD ? "ADCZMComputeGlobalTractionSmallStrain" : "CZMComputeGlobalTractionSmallStrain";
68 break;
69 }
70 case Strain::Finite:
71 {
73 _use_AD ? "ADCZMInterfaceKernelTotalLagrangian" : "CZMInterfaceKernelTotalLagrangian";
74 _disp_jump_provider_name = _use_AD ? "ADCZMComputeDisplacementJumpTotalLagrangian"
75 : "CZMComputeDisplacementJumpTotalLagrangian";
76 _equilibrium_traction_calculator_name = _use_AD ? "ADCZMComputeGlobalTractionTotalLagrangian"
77 : "CZMComputeGlobalTractionTotalLagrangian";
78 break;
79 }
80 default:
81 mooseError("CohesiveZoneAction Error: Invalid kinematic parameter. Allowed values are: "
82 "SmallStrain or TotalLagrangian");
83 }
84
85 if (_save_in_primary.size() != 0 && _save_in_primary.size() != _ndisp)
87 "Number of save_in_primary variables should equal to the number of displacement variables ",
88 _ndisp);
89 if (_diag_save_in_primary.size() != 0 && _diag_save_in_primary.size() != _ndisp)
91 "Number of diag_save_in_primary variables should equal to the number of displacement "
92 "variables ",
93 _ndisp);
94 if (_save_in_secondary.size() != 0 && _save_in_secondary.size() != _ndisp)
95 mooseError("Number of save_in_secondary variables should equal to the number of displacement "
96 "variables ",
97 _ndisp);
98
99 if (_diag_save_in_secondary.size() != 0 && _diag_save_in_secondary.size() != _ndisp)
101 "Number of diag_save_in_secondary variables should equal to the number of displacement "
102 "variables ",
103 _ndisp);
104
105 // convert output variable names to lower case
106 for (const auto & out : getParam<MultiMooseEnum>("generate_output"))
107 {
108 std::string lower(out);
109 std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
110 _generate_output.push_back(lower);
111 }
112
113 if (!_generate_output.empty())
115}
const unsigned int _ndisp
number of displacement components
std::vector< AuxVariableName > _diag_save_in_secondary
std::vector< std::string > _generate_output
output materials to generate scalar traction/jump vector quantities
std::vector< AuxVariableName > _save_in_primary
residual debugging
const bool _use_AD
whether to use AD kernels and materials
std::vector< VariableName > _displacements
the disaplcements varaible names
std::vector< AuxVariableName > _diag_save_in_primary
const std::string _base_name
Base name of the material system.
Strain
strain formulation
const bool _verbose
display info
std::string _equilibrium_traction_calculator_name
std::vector< AuxVariableName > _save_in_secondary
std::string _disp_jump_provider_name
MultiMooseEnum _material_output_order
MultiMooseEnum _material_output_family
std::string _czm_kernel_name
kernel's and materials's names
void verifyOrderAndFamilyOutputs()
verifies order and family of output variables
const std::vector< BoundaryName > _boundary
Base name of the material system.
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const

Member Function Documentation

◆ act()

void CohesiveZoneAction::act ( )
overridevirtual

Implements Action.

Definition at line 176 of file CohesiveZoneAction.C.

177{
178 // Enforce consistency
179 if (_ndisp != _mesh->dimension())
180 paramError("displacements", "Number of displacements must match problem dimension.");
181
183
184 if (_current_task == "add_interface_kernel")
186 else if (_current_task == "add_master_action_material")
188
189 // optional, add required outputs
191}
std::shared_ptr< MooseMesh > & _mesh
const std::string & _current_task
void addRequiredCZMInterfaceMaterials()
adds the required interface materials based on the selected strain formulation
void chekMultipleActionParameters()
method checking multiple CohesiveZoneAction block inputs
void addRequiredCZMInterfaceKernels()
adds the required interfacekernels based on the selected strain formulation
void paramError(const std::string &param, Args... args) const

◆ actOutputGeneration()

void CohesiveZoneAction::actOutputGeneration ( )
protected

Definition at line 274 of file CohesiveZoneAction.C.

275{
276 if (_current_task == "add_material")
278
279 // Add variables (optional)
280 if (_current_task == "add_aux_variable")
281 {
282 unsigned int index = 0;
283 for (auto out : _generate_output)
284 {
285 const auto & order = _material_output_order[index];
286 const auto & family = _material_output_family[index];
287
288 std::string type = (order == "CONSTANT" && family == "MONOMIAL")
289 ? "MooseVariableConstMonomial"
290 : "MooseVariable";
291
292 // Create output helper aux variables
293 auto params = _factory.getValidParams(type);
294 params.set<MooseEnum>("order") = order;
295 params.set<MooseEnum>("family") = family;
296 if (family == "MONOMIAL")
297 _problem->addAuxVariable(type, addBaseName(out), params);
298 else
299 _problem->addVariable(type, addBaseName(out), params);
300
301 index++;
302 }
303 }
304
305 // Add output AuxKernels
306 else if (_current_task == "add_aux_kernel")
307 {
308 const std::string material_output_aux_name = _use_AD ? "ADMaterialRealAux" : "MaterialRealAux";
309 // Loop through output aux variables
310 unsigned int index = 0;
311 for (auto out : _generate_output)
312 {
313 if (_material_output_family[index] == "MONOMIAL")
314 {
315 InputParameters params = _factory.getValidParams(material_output_aux_name);
316 params.set<MaterialPropertyName>("property") = addBaseName(out);
317 params.set<AuxVariableName>("variable") = addBaseName(out);
318 params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
319 params.set<std::vector<BoundaryName>>("boundary") = _boundary;
320 params.set<bool>("check_boundary_restricted") = false;
321 _problem->addAuxKernel(material_output_aux_name, addBaseName(out) + '_' + name(), params);
322 }
323 index++;
324 }
325 }
326}
std::shared_ptr< FEProblemBase > & _problem
std::string addBaseName(const std::string &name) const
simple method for adding the base name to a variable
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
const std::string & type() const
const std::string & name() const
Factory & _factory

Referenced by act().

◆ actOutputMatProp()

void CohesiveZoneAction::actOutputMatProp ( )
protected

Definition at line 329 of file CohesiveZoneAction.C.

330{
331 if (_current_task == "add_material")
332 {
333 // Add output Materials
334 for (auto out : _generate_output)
335 {
337
338 // RealVectorCartesianComponent
339 if (
340 [&]()
341 {
342 for (const auto & vq : _real_vector_cartesian_component_table)
343 for (unsigned int a = 0; a < 3; ++a)
344 if (vq.first + '_' + _component_table[a] == out)
345 {
346 auto type = _use_AD ? "ADCZMRealVectorCartesianComponent"
347 : "CZMRealVectorCartesianComponent";
348 params = _factory.getValidParams(type);
349 params.set<std::string>("real_vector_value") = vq.second;
350 params.set<unsigned int>("index") = a;
351 params.set<std::vector<BoundaryName>>("boundary") = _boundary;
352 params.set<MaterialPropertyName>("property_name") = addBaseName(out);
353 params.set<std::string>("base_name") = _base_name;
354 _problem->addInterfaceMaterial(type, addBaseName(out) + '_' + name(), params);
355 return true;
356 }
357 return false;
358 }())
359 continue;
360
361 // CZMRealVectorScalar
362 if (setupOutput(out,
364 [&](std::string prop_name, std::string direction)
365 {
366 auto type = _use_AD ? "ADCZMRealVectorScalar" : "CZMRealVectorScalar";
367 params = _factory.getValidParams(type);
368 params.set<std::string>("real_vector_value") = prop_name;
369 params.set<MooseEnum>("direction") = direction;
370 params.set<MaterialPropertyName>("property_name") = addBaseName(out);
371 params.set<std::vector<BoundaryName>>("boundary") = _boundary;
372 params.set<std::string>("base_name") = _base_name;
373 _problem->addInterfaceMaterial(
374 type, addBaseName(out) + '_' + name(), params);
375 }))
376 continue;
377
378 mooseError("CZM Master: unable to add output Material");
379 }
380 }
381}
InputParameters emptyInputParameters()
for(PetscInt i=0;i< nvars;++i)
void ErrorVector unsigned int
static const std::vector< char > _component_table
static const std::map< std::string, std::string > _real_vector_cartesian_component_table
table data for output generation
static const std::map< std::string, std::pair< std::string, std::vector< std::string > > > _vector_direction_table
bool setupOutput(std::string out, T table, T2 setup)

Referenced by actOutputGeneration().

◆ addBaseName()

std::string CohesiveZoneAction::addBaseName ( const std::string &  name) const
inlineprotected

simple method for adding the base name to a variable

Definition at line 103 of file CohesiveZoneAction.h.

104 {
105 return _base_name.empty() ? name : _base_name + "_" + name;
106 }

Referenced by actOutputGeneration(), and actOutputMatProp().

◆ addRelationshipManagers() [1/3]

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

Reimplemented from Action.

Definition at line 194 of file CohesiveZoneAction.C.

195{
197 addRelationshipManagers(input_rm_type, ips);
198}
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override

Referenced by addRelationshipManagers().

◆ addRelationshipManagers() [2/3]

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

Method adding the proper relationship manager.

Reimplemented from Action.

◆ addRelationshipManagers() [3/3]

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

Method adding the proper relationship manager.

◆ addRequiredCZMInterfaceKernels()

void CohesiveZoneAction::addRequiredCZMInterfaceKernels ( )
protected

adds the required interfacekernels based on the selected strain formulation

Definition at line 118 of file CohesiveZoneAction.C.

119{
120 for (unsigned int i = 0; i < _ndisp; ++i)
121 {
122 // Create unique kernel name for each displacement component
123 std::string unique_kernel_name = _czm_kernel_name + "_" + _name + "_" + Moose::stringify(i);
124
126
127 paramsk.set<unsigned int>("component") = i;
128 paramsk.set<NonlinearVariableName>("variable") = _displacements[i];
129 paramsk.set<std::vector<VariableName>>("neighbor_var") = {_displacements[i]};
130 paramsk.set<std::vector<VariableName>>("displacements") = _displacements;
131 paramsk.set<std::vector<BoundaryName>>("boundary") = _boundary;
132 paramsk.set<std::string>("base_name") = _base_name;
133
134 std::string save_in_side;
135 std::vector<AuxVariableName> save_in_var_names;
136 if (_save_in_primary.size() == _ndisp || _save_in_secondary.size() == _ndisp)
137 {
138 prepareSaveInInputs(save_in_var_names, save_in_side, _save_in_primary, _save_in_secondary, i);
139 paramsk.set<std::vector<AuxVariableName>>("save_in") = save_in_var_names;
140 paramsk.set<MultiMooseEnum>("save_in_var_side") = save_in_side;
141 }
143 {
145 save_in_var_names, save_in_side, _diag_save_in_primary, _diag_save_in_secondary, i);
146 paramsk.set<std::vector<AuxVariableName>>("diag_save_in") = save_in_var_names;
147 paramsk.set<MultiMooseEnum>("diag_save_in_var_side") = save_in_side;
148 }
149 _problem->addInterfaceKernel(_czm_kernel_name, unique_kernel_name, paramsk);
150 }
151}
void prepareSaveInInputs(std::vector< AuxVariableName > &, std::string &, const std::vector< AuxVariableName > &, const std::vector< AuxVariableName > &, const int &) const
method to prepare save_in and diag_save_in inputs for the interface kernel
const std::string & _name
std::string stringify(const T &t)

Referenced by act().

◆ addRequiredCZMInterfaceMaterials()

void CohesiveZoneAction::addRequiredCZMInterfaceMaterials ( )
protected

adds the required interface materials based on the selected strain formulation

Definition at line 154 of file CohesiveZoneAction.C.

155{
156 // Create unique material name for the "CZMComputeDisplacementJump" object
157 std::string unique_material_name = _disp_jump_provider_name + "_" + _name;
159 paramsm.set<std::vector<BoundaryName>>("boundary") = _boundary;
160
161 paramsm.set<std::vector<VariableName>>("displacements") = _displacements;
162 paramsm.set<std::string>("base_name") = _base_name;
163 _problem->addInterfaceMaterial(_disp_jump_provider_name, unique_material_name, paramsm);
164
165 // Create unique material name for the "CZMComputeGlobalTraction" object
166 unique_material_name = _equilibrium_traction_calculator_name + "_" + _name;
168 paramsm.set<std::vector<BoundaryName>>("boundary") = _boundary;
169
170 paramsm.set<std::string>("base_name") = _base_name;
171 _problem->addInterfaceMaterial(
172 _equilibrium_traction_calculator_name, unique_material_name, paramsm);
173}

Referenced by act().

◆ chekMultipleActionParameters()

void CohesiveZoneAction::chekMultipleActionParameters ( )
protected

method checking multiple CohesiveZoneAction block inputs

Definition at line 384 of file CohesiveZoneAction.C.

385{
386
387 // Gather info about all other master actions when we add variables
388 if (_current_task == "validate_coordinate_systems")
389 {
390 auto actions = _awh.getActions<CohesiveZoneAction>();
391 for (const auto & action : actions)
392 {
393 const auto size_before = _boundary_name_union.size();
394 const auto added_size = action->_boundary.size();
395 _boundary_name_union.insert(action->_boundary.begin(), action->_boundary.end());
396 const auto size_after = _boundary_name_union.size();
397 if (size_after != size_before + added_size)
398 mooseError("The boundary restrictions in the CohesiveZoneAction actions must be "
399 "non-overlapping.");
400 }
401
402 for (const auto & action : actions)
403 {
404 // check for different strain definitions
405 _strain_formulation_union.insert(action->_strain);
406 const auto size_after = _strain_formulation_union.size();
407
408 if (size_after != 1)
409 mooseError("All blocks of the CohesiveZoneAction should have the same strain formulation");
410 }
411 }
412}
std::vector< const T * > getActions()
ActionWarehouse & _awh
std::set< BoundaryName > _boundary_name_union
set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks
std::set< Strain > _strain_formulation_union
set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks

Referenced by act().

◆ materialOutputFamilies()

MultiMooseEnum CohesiveZoneActionBase::materialOutputFamilies ( )
staticinherited

Definition at line 164 of file CohesiveZoneActionBase.C.

165{
166 return MultiMooseEnum("MONOMIAL");
167}

Referenced by CohesiveZoneActionBase::validParams().

◆ materialOutputOrders()

MultiMooseEnum CohesiveZoneActionBase::materialOutputOrders ( )
staticinherited

Definition at line 156 of file CohesiveZoneActionBase.C.

157{
159
160 return MultiMooseEnum(orders);
161}
static MooseEnum getAuxVariableOrders()
std::string getRawNames() const

Referenced by CohesiveZoneActionBase::validParams().

◆ outputPropertiesType()

MultiMooseEnum CohesiveZoneActionBase::outputPropertiesType ( )
staticinherited

output methods

Definition at line 141 of file CohesiveZoneActionBase.C.

142{
143 std::string options = "";
145 for (unsigned int a = 0; a < 3; ++a)
146 options += (options == "" ? "" : " ") + vc.first + '_' + _component_table[a];
147
148 for (auto & vi : _vector_direction_table)
149 for (auto & t : vi.second.second)
150 options += " " + vi.first + "_" + t;
151
152 return MultiMooseEnum(options, "", true);
153}

Referenced by CohesiveZoneActionBase::validParams().

◆ prepareSaveInInputs()

void CohesiveZoneAction::prepareSaveInInputs ( std::vector< AuxVariableName > &  save_in_names,
std::string &  save_in_side,
const std::vector< AuxVariableName > &  var_name_primary,
const std::vector< AuxVariableName > &  var_name_secondary,
const int i 
) const
protected

method to prepare save_in and diag_save_in inputs for the interface kernel

Definition at line 201 of file CohesiveZoneAction.C.

206{
207 save_in_names.clear();
208 save_in_side.clear();
209 if (var_name_primary.size() == _ndisp)
210 {
211 save_in_names.push_back(var_name_primary[i]);
212 save_in_side += "m";
213 if (var_name_secondary.size() == _ndisp)
214 save_in_side += " ";
215 }
216 if (var_name_secondary.size() == _ndisp)
217 {
218 save_in_names.push_back(var_name_secondary[i]);
219 save_in_side += "s";
220 }
221}

Referenced by addRequiredCZMInterfaceKernels().

◆ setupOutput()

template<typename T , typename T2 >
bool CohesiveZoneAction::setupOutput ( std::string  out,
T  table,
T2  setup 
)
protected

Definition at line 111 of file CohesiveZoneAction.h.

112{
113 for (const auto & t1 : table)
114 {
115 // find the officially supported properties
116 for (const auto & t2 : t1.second.second)
117 if (t1.first + '_' + t2 == out)
118 {
119 const auto it = _real_vector_cartesian_component_table.find(t2);
121 {
122 setup(it->second, t1.second.first);
123 return true;
124 }
125 else
126 mooseError("Internal error. The permitted vector shortcuts must be keys in the "
127 "'_real_vector_cartesian_component_table'.");
128 }
129
130 // check for custom properties
131 auto prefix = t1.first + '_';
132 if (out.substr(0, prefix.length()) == prefix)
133 {
134 setup(out.substr(prefix.length()), t1.second.first);
135 return true;
136 }
137 }
138
139 return false;
140}
void setup(EquationSystems &systems, Mesh &mesh, GetPot &args)
if(subdm)
OStreamProxy out(std::cout)

Referenced by actOutputMatProp().

◆ validParams()

InputParameters CohesiveZoneAction::validParams ( )
static

Definition at line 25 of file CohesiveZoneAction.C.

26{
28 params.addClassDescription("Action to create an instance of the cohesive zone model kernel for "
29 "each displacement component");
30 params.addRequiredParam<std::vector<BoundaryName>>(
31 "boundary", "The list of boundary IDs from the mesh where the cohesive zone will be applied");
32 return params;
33}
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

◆ verifyOrderAndFamilyOutputs()

void CohesiveZoneAction::verifyOrderAndFamilyOutputs ( )
protected

verifies order and family of output variables

Definition at line 224 of file CohesiveZoneAction.C.

225{
226 // Ensure material output order and family vectors are same size as generate output
227
228 // check number of supplied orders and families
230 paramError("material_output_order",
231 "The number of orders assigned to material outputs must be: 0 to be assigned "
232 "CONSTANT; 1 to assign all outputs the same value, or the same size as the number "
233 "of generate outputs listed.");
234
235 if (_material_output_family.size() > 1 &&
237 paramError("material_output_family",
238 "The number of families assigned to material outputs must be: 0 to be assigned "
239 "MONOMIAL; 1 to assign all outputs the same value, or the same size as the number "
240 "of generate outputs listed.");
241
242 // if no value was provided, chose the default CONSTANT
243 if (_material_output_order.size() == 0)
245
246 // For only one order, make all orders the same magnitude
247 if (_material_output_order.size() == 1)
249 std::vector<std::string>(_generate_output.size(), _material_output_order[0]);
250
251 if (_verbose)
252 Moose::out << COLOR_CYAN << "*** Automatic applied material output orders ***"
253 << "\n"
254 << _name << ": " << Moose::stringify(_material_output_order) << "\n"
255 << COLOR_DEFAULT;
256
257 // if no value was provided, chose the default MONOMIAL
258 if (_material_output_family.size() == 0)
260
261 // For only one family, make all families that value
262 if (_material_output_family.size() == 1)
264 std::vector<std::string>(_generate_output.size(), _material_output_family[0]);
265
266 if (_verbose)
267 Moose::out << COLOR_CYAN << "*** Automatic applied material output families ***"
268 << "\n"
269 << _name << ": " << Moose::stringify(_material_output_family) << "\n"
270 << COLOR_DEFAULT;
271}
void setAdditionalValue(const std::string &names)
unsigned int size() const

Referenced by CohesiveZoneAction().

Member Data Documentation

◆ _base_name

const std::string CohesiveZoneAction::_base_name
protected

Base name of the material system.

Definition at line 62 of file CohesiveZoneAction.h.

Referenced by actOutputMatProp(), addBaseName(), addRequiredCZMInterfaceKernels(), and addRequiredCZMInterfaceMaterials().

◆ _boundary

const std::vector<BoundaryName> CohesiveZoneAction::_boundary
protected

◆ _boundary_name_union

std::set<BoundaryName> CohesiveZoneAction::_boundary_name_union
protected

set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks

Definition at line 94 of file CohesiveZoneAction.h.

Referenced by chekMultipleActionParameters().

◆ _component_table

const std::vector< char > CohesiveZoneActionBase::_component_table = {'x', 'y', 'z'}
staticinherited

◆ _czm_kernel_name

std::string CohesiveZoneAction::_czm_kernel_name
protected

kernel's and materials's names

Definition at line 83 of file CohesiveZoneAction.h.

Referenced by addRelationshipManagers(), addRequiredCZMInterfaceKernels(), and CohesiveZoneAction().

◆ _diag_save_in_primary

std::vector<AuxVariableName> CohesiveZoneAction::_diag_save_in_primary
protected

Definition at line 76 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceKernels(), and CohesiveZoneAction().

◆ _diag_save_in_secondary

std::vector<AuxVariableName> CohesiveZoneAction::_diag_save_in_secondary
protected

Definition at line 78 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceKernels(), and CohesiveZoneAction().

◆ _disp_jump_provider_name

std::string CohesiveZoneAction::_disp_jump_provider_name
protected

Definition at line 84 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceMaterials(), and CohesiveZoneAction().

◆ _displacements

std::vector<VariableName> CohesiveZoneAction::_displacements
protected

the disaplcements varaible names

Definition at line 53 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceKernels(), and addRequiredCZMInterfaceMaterials().

◆ _equilibrium_traction_calculator_name

std::string CohesiveZoneAction::_equilibrium_traction_calculator_name
protected

Definition at line 85 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceMaterials(), and CohesiveZoneAction().

◆ _generate_output

std::vector<std::string> CohesiveZoneAction::_generate_output
protected

output materials to generate scalar traction/jump vector quantities

Definition at line 89 of file CohesiveZoneAction.h.

Referenced by actOutputGeneration(), actOutputMatProp(), CohesiveZoneAction(), and verifyOrderAndFamilyOutputs().

◆ _material_output_family

MultiMooseEnum CohesiveZoneAction::_material_output_family
protected

Definition at line 91 of file CohesiveZoneAction.h.

Referenced by actOutputGeneration(), and verifyOrderAndFamilyOutputs().

◆ _material_output_order

MultiMooseEnum CohesiveZoneAction::_material_output_order
protected

Definition at line 90 of file CohesiveZoneAction.h.

Referenced by actOutputGeneration(), and verifyOrderAndFamilyOutputs().

◆ _ndisp

const unsigned int CohesiveZoneAction::_ndisp
protected

number of displacement components

Definition at line 56 of file CohesiveZoneAction.h.

Referenced by act(), addRequiredCZMInterfaceKernels(), CohesiveZoneAction(), and prepareSaveInInputs().

◆ _real_vector_cartesian_component_table

const std::map< std::string, std::string > CohesiveZoneActionBase::_real_vector_cartesian_component_table
staticinherited
Initial value:
= {
{"traction", "traction_global"},
{"jump", "displacement_jump_global"},
{"pk1_traction", "PK1traction"}}

table data for output generation

Definition at line 20 of file CohesiveZoneActionBase.h.

Referenced by actOutputMatProp(), CohesiveZoneActionBase::outputPropertiesType(), and setupOutput().

◆ _save_in_primary

std::vector<AuxVariableName> CohesiveZoneAction::_save_in_primary
protected

residual debugging

Definition at line 75 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceKernels(), and CohesiveZoneAction().

◆ _save_in_secondary

std::vector<AuxVariableName> CohesiveZoneAction::_save_in_secondary
protected

Definition at line 77 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceKernels(), and CohesiveZoneAction().

◆ _strain

enum CohesiveZoneAction::Strain CohesiveZoneAction::_strain
protected

Referenced by CohesiveZoneAction().

◆ _strain_formulation_union

std::set<Strain> CohesiveZoneAction::_strain_formulation_union
protected

set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks

Definition at line 97 of file CohesiveZoneAction.h.

Referenced by chekMultipleActionParameters().

◆ _use_AD

const bool CohesiveZoneAction::_use_AD
protected

whether to use AD kernels and materials

Definition at line 59 of file CohesiveZoneAction.h.

Referenced by actOutputGeneration(), actOutputMatProp(), and CohesiveZoneAction().

◆ _vector_direction_table

const std::map< std::string, std::pair< std::string, std::vector< std::string > > > CohesiveZoneActionBase::_vector_direction_table
staticinherited
Initial value:
= {
{"normal", {"Normal", {"traction", "jump"}}},
{"tangent", {"Tangent", {"traction", "jump"}}}}

Definition at line 28 of file CohesiveZoneActionBase.h.

Referenced by actOutputMatProp(), and CohesiveZoneActionBase::outputPropertiesType().

◆ _verbose

const bool CohesiveZoneAction::_verbose
protected

display info

Definition at line 100 of file CohesiveZoneAction.h.

Referenced by verifyOrderAndFamilyOutputs().


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