https://mooseframework.inl.gov
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 | 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. More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 Method adding the proper relationship manager. More...
 
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
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () 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
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (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
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) 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 MultiMooseEnum outputPropertiesType ()
 output methods More...
 
static MultiMooseEnum materialOutputOrders ()
 
static MultiMooseEnum materialOutputFamilies ()
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

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 More...
 
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  Strain { Strain::Small, Strain::Finite }
 strain formulation More...
 

Protected Member Functions

void actOutputGeneration ()
 
void actOutputMatProp ()
 
void addRequiredCZMInterfaceKernels ()
 adds the required interfacekernels based on the selected strain formulation More...
 
void addRequiredCZMInterfaceMaterials ()
 adds the required interface materials based on the selected strain formulation More...
 
void verifyOrderAndFamilyOutputs ()
 verifies order and family of output variables More...
 
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 More...
 
void chekMultipleActionParameters ()
 method checking multiple CohesiveZoneAction block inputs More...
 
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 More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
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
 

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 More...
 
const unsigned int _ndisp
 number of displacement components More...
 
const bool _use_AD
 whether to use AD kernels and materials More...
 
const std::string _base_name
 Base name of the material system. More...
 
const std::vector< BoundaryName > _boundary
 Base name of the material system. More...
 
enum CohesiveZoneAction::Strain _strain
 
std::vector< std::string > _generate_output
 output materials to generate scalar traction/jump vector quantities More...
 
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 More...
 
std::set< Strain_strain_formulation_union
 set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks More...
 
const bool _verbose
 display info More...
 
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
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 
std::vector< AuxVariableName > _save_in_master
 residual debugging More...
 
std::vector< AuxVariableName > _diag_save_in_master
 
std::vector< AuxVariableName > _save_in_slave
 
std::vector< AuxVariableName > _diag_save_in_slave
 
std::string _czm_kernel_name
 kernel's and materials's names More...
 
std::string _disp_jump_provider_name
 
std::string _equilibrium_traction_calculator_name
 

Detailed Description

Definition at line 14 of file CohesiveZoneAction.h.

Member Enumeration Documentation

◆ Strain

enum 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_master(getParam<std::vector<AuxVariableName>>("save_in_master")),
46  _diag_save_in_master(getParam<std::vector<AuxVariableName>>("diag_save_in_master")),
47  _save_in_slave(getParam<std::vector<AuxVariableName>>("save_in_slave")),
48  _diag_save_in_slave(getParam<std::vector<AuxVariableName>>("diag_save_in_slave")),
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_master.size() != 0 && _save_in_master.size() != _ndisp)
86  mooseError(
87  "Number of save_in_master variables should equal to the number of displacement variables ",
88  _ndisp);
89  if (_diag_save_in_master.size() != 0 && _diag_save_in_master.size() != _ndisp)
90  mooseError("Number of diag_save_in_master variables should equal to the number of displacement "
91  "variables ",
92  _ndisp);
93  if (_save_in_slave.size() != 0 && _save_in_slave.size() != _ndisp)
94  mooseError(
95  "Number of save_in_slave variables should equal to the number of displacement variables ",
96  _ndisp);
97 
98  if (_diag_save_in_slave.size() != 0 && _diag_save_in_slave.size() != _ndisp)
99  mooseError("Number of diag_save_in_slave variables should equal to the number of displacement "
100  "variables ",
101  _ndisp);
102 
103  // convert output variable names to lower case
104  for (const auto & out : getParam<MultiMooseEnum>("generate_output"))
105  {
106  std::string lower(out);
107  std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
108  _generate_output.push_back(lower);
109  }
110 
111  if (!_generate_output.empty())
113 }
std::vector< AuxVariableName > _diag_save_in_master
std::string _equilibrium_traction_calculator_name
MultiMooseEnum _material_output_family
std::vector< AuxVariableName > _save_in_master
residual debugging
std::string _disp_jump_provider_name
std::vector< std::string > _generate_output
output materials to generate scalar traction/jump vector quantities
bool isParamValid(const std::string &name) const
const std::string _base_name
Base name of the material system.
std::vector< AuxVariableName > _diag_save_in_slave
MultiMooseEnum _material_output_order
const bool _verbose
display info
CohesiveZoneActionBase(const InputParameters &params)
std::vector< VariableName > _displacements
the disaplcements varaible names
const T & getParam(const std::string &name) const
const unsigned int _ndisp
number of displacement components
std::vector< AuxVariableName > _save_in_slave
void verifyOrderAndFamilyOutputs()
verifies order and family of output variables
void mooseError(Args &&... args) const
std::string _czm_kernel_name
kernel&#39;s and materials&#39;s names
const bool _use_AD
whether to use AD kernels and materials
enum CohesiveZoneAction::Strain _strain
const std::vector< BoundaryName > _boundary
Base name of the material system.

Member Function Documentation

◆ act()

void CohesiveZoneAction::act ( )
overridevirtual

Implements Action.

Definition at line 174 of file CohesiveZoneAction.C.

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

◆ actOutputGeneration()

void CohesiveZoneAction::actOutputGeneration ( )
protected

Definition at line 272 of file CohesiveZoneAction.C.

Referenced by act().

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

◆ actOutputMatProp()

void CohesiveZoneAction::actOutputMatProp ( )
protected

Definition at line 327 of file CohesiveZoneAction.C.

Referenced by actOutputGeneration().

328 {
329  if (_current_task == "add_material")
330  {
331  // Add output Materials
332  for (auto out : _generate_output)
333  {
335 
336  // RealVectorCartesianComponent
337  if (
338  [&]()
339  {
340  for (const auto & vq : _real_vector_cartesian_component_table)
341  for (unsigned int a = 0; a < 3; ++a)
342  if (vq.first + '_' + _component_table[a] == out)
343  {
344  auto type = _use_AD ? "ADCZMRealVectorCartesianComponent"
345  : "CZMRealVectorCartesianComponent";
346  params = _factory.getValidParams(type);
347  params.set<std::string>("real_vector_value") = vq.second;
348  params.set<unsigned int>("index") = a;
349  params.set<std::vector<BoundaryName>>("boundary") = _boundary;
350  params.set<MaterialPropertyName>("property_name") = addBaseName(out);
351  params.set<std::string>("base_name") = _base_name;
352  _problem->addInterfaceMaterial(type, addBaseName(out) + '_' + name(), params);
353  return true;
354  }
355  return false;
356  }())
357  continue;
358 
359  // CZMRealVectorScalar
360  if (setupOutput(out,
362  [&](std::string prop_name, std::string direction)
363  {
364  auto type = _use_AD ? "ADCZMRealVectorScalar" : "CZMRealVectorScalar";
365  params = _factory.getValidParams(type);
366  params.set<std::string>("real_vector_value") = prop_name;
367  params.set<MooseEnum>("direction") = direction;
368  params.set<MaterialPropertyName>("property_name") = addBaseName(out);
369  params.set<std::vector<BoundaryName>>("boundary") = _boundary;
370  params.set<std::string>("base_name") = _base_name;
371  _problem->addInterfaceMaterial(
372  type, addBaseName(out) + '_' + name(), params);
373  }))
374  continue;
375 
376  mooseError("CZM Master: unable to add output Material");
377  }
378  }
379 }
static const std::vector< char > _component_table
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
virtual const std::string & name() const
InputParameters emptyInputParameters()
std::vector< std::string > _generate_output
output materials to generate scalar traction/jump vector quantities
const std::string _base_name
Base name of the material system.
Factory & _factory
static const std::map< std::string, std::string > _real_vector_cartesian_component_table
table data for output generation
const std::string & type() const
const std::string & _current_task
std::string addBaseName(const std::string &name) const
simple method for adding the base name to a variable
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const bool _use_AD
whether to use AD kernels and materials
const std::vector< BoundaryName > _boundary
Base name of the material system.
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)

◆ 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.

Referenced by actOutputGeneration(), and actOutputMatProp().

104  {
105  return _base_name.empty() ? name : _base_name + "_" + name;
106  }
virtual const std::string & name() const
const std::string _base_name
Base name of the material system.

◆ addRelationshipManagers() [1/3]

virtual void Action::addRelationshipManagers

Method adding the proper relationship manager.

◆ addRelationshipManagers() [2/3]

bool Action::addRelationshipManagers

Method adding the proper relationship manager.

◆ addRelationshipManagers() [3/3]

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

Reimplemented from Action.

Definition at line 192 of file CohesiveZoneAction.C.

193 {
195  addRelationshipManagers(input_rm_type, ips);
196 }
InputParameters getValidParams(const std::string &name) const
Factory & _factory
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
std::string _czm_kernel_name
kernel&#39;s and materials&#39;s names

◆ addRequiredCZMInterfaceKernels()

void CohesiveZoneAction::addRequiredCZMInterfaceKernels ( )
protected

adds the required interfacekernels based on the selected strain formulation

Definition at line 116 of file CohesiveZoneAction.C.

Referenced by act().

117 {
118  for (unsigned int i = 0; i < _ndisp; ++i)
119  {
120  // Create unique kernel name for each displacement component
121  std::string unique_kernel_name = _czm_kernel_name + "_" + _name + "_" + Moose::stringify(i);
122 
124 
125  paramsk.set<unsigned int>("component") = i;
126  paramsk.set<NonlinearVariableName>("variable") = _displacements[i];
127  paramsk.set<std::vector<VariableName>>("neighbor_var") = {_displacements[i]};
128  paramsk.set<std::vector<VariableName>>("displacements") = _displacements;
129  paramsk.set<std::vector<BoundaryName>>("boundary") = _boundary;
130  paramsk.set<std::string>("base_name") = _base_name;
131 
132  std::string save_in_side;
133  std::vector<AuxVariableName> save_in_var_names;
134  if (_save_in_master.size() == _ndisp || _save_in_slave.size() == _ndisp)
135  {
136  prepareSaveInInputs(save_in_var_names, save_in_side, _save_in_master, _save_in_slave, i);
137  paramsk.set<std::vector<AuxVariableName>>("save_in") = save_in_var_names;
138  paramsk.set<MultiMooseEnum>("save_in_var_side") = save_in_side;
139  }
140  if (_diag_save_in_master.size() == _ndisp || _diag_save_in_slave.size() == _ndisp)
141  {
143  save_in_var_names, save_in_side, _diag_save_in_master, _diag_save_in_slave, i);
144  paramsk.set<std::vector<AuxVariableName>>("diag_save_in") = save_in_var_names;
145  paramsk.set<MultiMooseEnum>("diag_save_in_var_side") = save_in_side;
146  }
147  _problem->addInterfaceKernel(_czm_kernel_name, unique_kernel_name, paramsk);
148  }
149 }
std::vector< AuxVariableName > _diag_save_in_master
std::vector< AuxVariableName > _save_in_master
residual debugging
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
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 _base_name
Base name of the material system.
Factory & _factory
std::vector< AuxVariableName > _diag_save_in_slave
std::vector< VariableName > _displacements
the disaplcements varaible names
const unsigned int _ndisp
number of displacement components
std::string stringify(const T &t)
const std::string _name
std::vector< AuxVariableName > _save_in_slave
std::shared_ptr< FEProblemBase > & _problem
std::string _czm_kernel_name
kernel&#39;s and materials&#39;s names
const std::vector< BoundaryName > _boundary
Base name of the material system.

◆ addRequiredCZMInterfaceMaterials()

void CohesiveZoneAction::addRequiredCZMInterfaceMaterials ( )
protected

adds the required interface materials based on the selected strain formulation

Definition at line 152 of file CohesiveZoneAction.C.

Referenced by act().

153 {
154  // Create unique material name for the "CZMComputeDisplacementJump" object
155  std::string unique_material_name = _disp_jump_provider_name + "_" + _name;
157  paramsm.set<std::vector<BoundaryName>>("boundary") = _boundary;
158  ;
159  paramsm.set<std::vector<VariableName>>("displacements") = _displacements;
160  paramsm.set<std::string>("base_name") = _base_name;
161  _problem->addInterfaceMaterial(_disp_jump_provider_name, unique_material_name, paramsm);
162 
163  // Create unique material name for the "CZMComputeGlobalTraction" object
164  unique_material_name = _equilibrium_traction_calculator_name + "_" + _name;
166  paramsm.set<std::vector<BoundaryName>>("boundary") = _boundary;
167  ;
168  paramsm.set<std::string>("base_name") = _base_name;
169  _problem->addInterfaceMaterial(
170  _equilibrium_traction_calculator_name, unique_material_name, paramsm);
171 }
std::string _equilibrium_traction_calculator_name
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::string _disp_jump_provider_name
const std::string _base_name
Base name of the material system.
Factory & _factory
std::vector< VariableName > _displacements
the disaplcements varaible names
const std::string _name
std::shared_ptr< FEProblemBase > & _problem
const std::vector< BoundaryName > _boundary
Base name of the material system.

◆ chekMultipleActionParameters()

void CohesiveZoneAction::chekMultipleActionParameters ( )
protected

method checking multiple CohesiveZoneAction block inputs

Definition at line 382 of file CohesiveZoneAction.C.

Referenced by act().

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

◆ materialOutputFamilies()

MultiMooseEnum CohesiveZoneActionBase::materialOutputFamilies ( )
staticinherited

Definition at line 164 of file CohesiveZoneActionBase.C.

Referenced by CohesiveZoneActionBase::validParams().

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

◆ materialOutputOrders()

MultiMooseEnum CohesiveZoneActionBase::materialOutputOrders ( )
staticinherited

Definition at line 156 of file CohesiveZoneActionBase.C.

Referenced by CohesiveZoneActionBase::validParams().

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

◆ outputPropertiesType()

MultiMooseEnum CohesiveZoneActionBase::outputPropertiesType ( )
staticinherited

output methods

Definition at line 141 of file CohesiveZoneActionBase.C.

Referenced by CohesiveZoneActionBase::validParams().

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 }
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

◆ prepareSaveInInputs()

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

method to prepare save_in and diag_save_in inputs for the interface kernel

Definition at line 199 of file CohesiveZoneAction.C.

Referenced by addRequiredCZMInterfaceKernels().

204 {
205  save_in_names.clear();
206  save_in_side.clear();
207  if (var_name_master.size() == _ndisp)
208  {
209  save_in_names.push_back(var_name_master[i]);
210  save_in_side += "m";
211  if (var_name_slave.size() == _ndisp)
212  save_in_side += " ";
213  }
214  if (var_name_slave.size() == _ndisp)
215  {
216  save_in_names.push_back(var_name_slave[i]);
217  save_in_side += "s";
218  }
219 }
const unsigned int _ndisp
number of displacement components

◆ setupOutput()

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

Definition at line 111 of file CohesiveZoneAction.h.

Referenced by actOutputMatProp().

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 }
static const std::map< std::string, std::string > _real_vector_cartesian_component_table
table data for output generation
OStreamProxy out
void setup(EquationSystems &systems, Mesh &mesh, GetPot &args)
void mooseError(Args &&... args) const

◆ 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 222 of file CohesiveZoneAction.C.

Referenced by CohesiveZoneAction().

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

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

Base name of the material system.

Definition at line 65 of file CohesiveZoneAction.h.

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

◆ _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_master

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

Definition at line 76 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceKernels(), and CohesiveZoneAction().

◆ _diag_save_in_slave

std::vector<AuxVariableName> CohesiveZoneAction::_diag_save_in_slave
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 28 of file CohesiveZoneActionBase.h.

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

◆ _save_in_master

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

residual debugging

Definition at line 75 of file CohesiveZoneAction.h.

Referenced by addRequiredCZMInterfaceKernels(), and CohesiveZoneAction().

◆ _save_in_slave

std::vector<AuxVariableName> CohesiveZoneAction::_save_in_slave
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 30 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: