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
37 virtual void customizeCZMInterfaceKernelParameters(InputParameters & /*params*/) const {}
38
41
44
46 void prepareSaveInInputs(std::vector<AuxVariableName> & /*save_in_names*/,
47 std::string & /*save_in_side*/,
48 const std::vector<AuxVariableName> & /*var_name_primary*/,
49 const std::vector<AuxVariableName> & /*var_name_secondary*/,
50 const int & /*i*/) const;
51
54
55 template <typename T, typename T2>
56 bool setupOutput(std::string out, T table, T2 setup);
57
59 std::vector<VariableName> _displacements;
60
62 const unsigned int _ndisp;
63
65 const bool _use_AD;
66
68 const std::string _base_name;
69
71 const std::vector<BoundaryName> _boundary;
72
74 enum class Strain
75 {
76 Small,
77 Finite
79
81 std::vector<AuxVariableName> _save_in_primary;
82 std::vector<AuxVariableName> _diag_save_in_primary;
83 std::vector<AuxVariableName> _save_in_secondary;
84 std::vector<AuxVariableName> _diag_save_in_secondary;
86
89 std::string _czm_kernel_name;
93
95 std::vector<std::string> _generate_output;
98
100 std::set<BoundaryName> _boundary_name_union;
101
104
106 const bool _verbose;
107
109 std::string addBaseName(const std::string & name) const
110 {
111 return _base_name.empty() ? name : _base_name + "_" + name;
112 }
113};
114
115template <typename T, typename T2>
116bool
117CohesiveZoneAction::setupOutput(std::string out, T table, T2 setup)
118{
119 for (const auto & t1 : table)
120 {
121 // find the officially supported properties
122 for (const auto & t2 : t1.second.second)
123 if (t1.first + '_' + t2 == out)
124 {
125 const auto it = _real_vector_cartesian_component_table.find(t2);
127 {
128 setup(it->second, t1.second.first);
129 return true;
130 }
131 else
132 mooseError("Internal error. The permitted vector shortcuts must be keys in the "
133 "'_real_vector_cartesian_component_table'.");
134 }
135
136 // check for custom properties
137 auto prefix = t1.first + '_';
138 if (out.substr(0, prefix.length()) == prefix)
139 {
140 setup(out.substr(prefix.length()), t1.second.first);
141 return true;
142 }
143 }
144
145 return false;
146}
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
virtual void customizeCZMInterfaceKernelParameters(InputParameters &) const
Allows derived actions to set parameters on each generated interface kernel.
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
virtual void customizeCZMDisplacementJumpMaterialParameters(InputParameters &) const
Allows derived actions to set parameters on the generated displacement jump material.
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