https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CohesiveZoneAction.h
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
10#pragma once
11
13
15{
16public:
18 CohesiveZoneAction(const InputParameters & params);
19
22 virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override;
23
24 void act() override;
25
26protected:
28 void actOutputMatProp();
29
32
35
38
40 void prepareSaveInInputs(std::vector<AuxVariableName> & /*save_in_names*/,
41 std::string & /*save_in_side*/,
42 const std::vector<AuxVariableName> & /*var_name_primary*/,
43 const std::vector<AuxVariableName> & /*var_name_secondary*/,
44 const int & /*i*/) const;
45
48
49 template <typename T, typename T2>
50 bool setupOutput(std::string out, T table, T2 setup);
51
53 std::vector<VariableName> _displacements;
54
56 const unsigned int _ndisp;
57
59 const bool _use_AD;
60
62 const std::string _base_name;
63
65 const std::vector<BoundaryName> _boundary;
66
68 enum class Strain
69 {
70 Small,
71 Finite
73
75 std::vector<AuxVariableName> _save_in_primary;
76 std::vector<AuxVariableName> _diag_save_in_primary;
77 std::vector<AuxVariableName> _save_in_secondary;
78 std::vector<AuxVariableName> _diag_save_in_secondary;
80
83 std::string _czm_kernel_name;
87
89 std::vector<std::string> _generate_output;
92
94 std::set<BoundaryName> _boundary_name_union;
95
97 std::set<Strain> _strain_formulation_union;
98
100 const bool _verbose;
101
103 std::string addBaseName(const std::string & name) const
104 {
105 return _base_name.empty() ? name : _base_name + "_" + name;
106 }
107};
108
109template <typename T, typename T2>
110bool
111CohesiveZoneAction::setupOutput(std::string out, T table, T2 setup)
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}
const double T
virtual void addRelationshipManagers(Moose::RelationshipManagerType when_type)
static const std::map< std::string, std::string > _real_vector_cartesian_component_table
table data for output generation
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
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
std::set< BoundaryName > _boundary_name_union
set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks
void addRequiredCZMInterfaceMaterials()
adds the required interface materials based on the selected strain formulation
std::set< Strain > _strain_formulation_union
set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks
std::string addBaseName(const std::string &name) const
simple method for adding the base name to a variable
void chekMultipleActionParameters()
method checking multiple CohesiveZoneAction block inputs
std::vector< AuxVariableName > _save_in_secondary
static InputParameters validParams()
std::string _disp_jump_provider_name
bool setupOutput(std::string out, T table, T2 setup)
enum CohesiveZoneAction::Strain _strain
MultiMooseEnum _material_output_order
MultiMooseEnum _material_output_family
void addRequiredCZMInterfaceKernels()
adds the required interfacekernels based on the selected strain formulation
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
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.
const std::string & name() const
void mooseError(Args &&... args) const
void setup(EquationSystems &systems, Mesh &mesh, GetPot &args)
RelationshipManagerType