16 #include "libmesh/string_to_enum.h" 32 "displacements",
"Nonlinear variable names for the displacements");
33 MooseEnum formulation_option(
"BOND ORDINARY_STATE NONORDINARY_STATE");
35 "formulation", formulation_option,
"Peridynamic formulation options");
36 MooseEnum stabilization_option(
"FORCE BOND_HORIZON_I BOND_HORIZON_II");
39 "Stabilization techniques for the peridynamic correspondence model");
43 "Parameter to set whether to use full jacobian for state based formulation or not");
44 MooseEnum strain_type(
"SMALL FINITE",
"SMALL");
46 params.
addParam<VariableName>(
"temperature",
"Nonlinear variable name for the temperature");
47 params.
addParam<VariableName>(
"out_of_plane_strain",
48 "Nonlinear variable name for the out_of_plane strain for " 49 "plane stress using the NOSPD formulation");
50 params.
addParam<std::vector<SubdomainName>>(
"block",
52 "List of ids of the blocks (subdomains) that the " 53 "peridynamic mechanics kernel will be applied to");
54 params.
addParam<std::vector<AuxVariableName>>(
"save_in", {},
"The displacement residuals");
55 params.
addParam<std::vector<AuxVariableName>>(
56 "diag_save_in", {},
"The displacement diagonal preconditioner terms");
57 params.
addParam<std::vector<MaterialPropertyName>>(
60 "List of eigenstrains to be coupled in non-ordinary state-based mechanics kernels");
67 _displacements(getParam<
std::vector<VariableName>>(
"displacements")),
68 _ndisp(_displacements.size()),
69 _formulation(getParam<
MooseEnum>(
"formulation")),
70 _stabilization(getParam<
MooseEnum>(
"stabilization")),
72 _subdomain_names(getParam<
std::vector<SubdomainName>>(
"block")),
74 _save_in(getParam<
std::vector<AuxVariableName>>(
"save_in")),
75 _diag_save_in(getParam<
std::vector<AuxVariableName>>(
"diag_save_in"))
79 mooseError(
"'stabilization' is a required parameter for non-ordinary state-based models only.");
82 mooseError(
"Number of save_in variables should equal to the number of displacement variables ",
87 "Number of diag_save_in variables should equal to the number of displacement variables ",
104 for (
const auto & action : actions)
107 const auto added_size = action->_subdomain_ids.size();
111 if (size_after != size_before + added_size)
112 mooseError(
"The block restrictions in the Peridynamics/Mechanics/Master actions must be " 115 if (added_size == 0 && actions.size() > 1)
117 "No Peridynamics/Mechanics/Master action can be block unrestricted if more than one " 118 "Peridynamics/Mechanics/Master action is specified!");
124 const std::string var_type =
"MooseVariableConstMonomial";
133 _problem->addAuxVariable(var_type,
"bond_status", params);
137 const std::string ic_type =
"ConstantIC";
138 const std::string ic_name =
name() +
"bond_status";
141 params.
set<VariableName>(
"variable") =
"bond_status";
142 params.
set<
Real>(
"value") = 1.0;
148 _problem->addInitialCondition(ic_type, ic_name, params);
153 const std::string uo_type =
"GhostElemPD";
154 const std::string uo_name =
name() +
"GhostElemPD";
157 params.
set<
bool>(
"use_displaced_mesh") = (
_strain ==
"FINITE");
159 _problem->addUserObject(uo_type, uo_name, params);
166 for (
unsigned int i = 0; i <
_ndisp; ++i)
170 params.
set<
unsigned int>(
"component") = i;
174 params.
set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
176 params.
set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
178 _problem->addKernel(kernel_name, kernel_object_name, params);
182 mooseError(
"Task error in MechanicsActionPD!");
192 name =
"MechanicsBPD";
196 name =
"MechanicsOSPD";
202 name =
"ForceStabilizedSmallStrainMechanicsNOSPD";
207 name =
"HorizonStabilizedFormISmallStrainMechanicsNOSPD";
209 name =
"HorizonStabilizedFormIFiniteStrainMechanicsNOSPD";
214 name =
"HorizonStabilizedFormIISmallStrainMechanicsNOSPD";
216 name =
"HorizonStabilizedFormIIFiniteStrainMechanicsNOSPD";
219 paramError(
"stabilization",
"Unknown PD stabilization scheme!");
222 paramError(
"formulation",
"Unsupported peridynamic formulation!");
235 "out_of_plane_strain",
237 "use_displaced_mesh",
243 params.
set<std::vector<VariableName>>(
"temperature") = {getParam<VariableName>(
"temperature")};
245 params.
set<std::vector<VariableName>>(
"out_of_plane_strain") = {
246 getParam<VariableName>(
"out_of_plane_strain")};
249 params.
set<
bool>(
"use_displaced_mesh") =
false;
253 params.
set<std::vector<MaterialPropertyName>>(
"eigenstrain_names") =
254 getParam<std::vector<MaterialPropertyName>>(
"eigenstrain_names");
MechanicsActionPD(const InputParameters ¶ms)
std::vector< AuxVariableName > _save_in
Residual debugging.
std::vector< AuxVariableName > _diag_save_in
std::set< SubdomainID > _subdomain_id_union
set of SubdomainID generated from the combined block restrictions of all TensorMechanics/Master actio...
static InputParameters validParams()
const unsigned int _ndisp
Action class to setup peridynamic models for solid mechanics problems.
virtual void act() override
InputParameters getValidParams(const std::string &name) const
virtual InputParameters getKernelParameters(std::string name)
Function to get the input parameters for a given kernel name.
virtual std::string getKernelName()
Function to get the kernel name based on the value of member variables: _formulation and _stabilizati...
virtual const std::string & name() const
const MooseEnum _strain
Option of strain formulation: SMALL or FINITE.
bool isParamValid(const std::string &name) const
static InputParameters validParams()
registerMooseAction("PeridynamicsApp", MechanicsActionPD, "setup_mesh_complete")
const T & getParam(const std::string &name) const
const MooseEnum _formulation
Option of which peridynamic model needs to be setup: BOND, ORDINARY_STATE or NONORDINARY_STATE.
const std::string & _current_task
std::set< SubdomainID > _subdomain_ids
set of subdomain IDs generated from the passed in vector of subdomain names
void paramError(const std::string ¶m, Args... args) const
std::string stringify(const T &t)
std::shared_ptr< MooseMesh > & _mesh
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< VariableName > _displacements
Displacement variables.
const MooseEnum _stabilization
Option of stabilization scheme for correspondence material model: FORCE, BOND_HORIZON_I or BOND_HORIZ...
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const
std::vector< SubdomainName > _subdomain_names
vector of subdomain names from provided blocks
std::vector< const T *> getActions()