22 "grain_num",
"Value that specifies the number of grains to create aux kernels for.");
24 "variable_base",
"Vector specifies the base name of the variables.");
26 "The material property names.");
28 "use_displaced_mesh",
false,
"Whether to use displaced mesh in the kernels.");
34 _grain_num(getParam<unsigned
int>(
"grain_num")),
35 _var_name_base(getParam<
std::vector<
std::string>>(
"variable_base")),
36 _num_var(_var_name_base.size()),
37 _prop(getParam<
std::vector<MaterialPropertyName>>(
"property")),
38 _num_prop(_prop.size())
46 paramError(
"property",
"variable_base and property must be vectors of the same size");
48 for (
unsigned int gr = 0; gr <
_grain_num; ++gr)
49 for (
unsigned int val = 0; val <
_num_var; ++val)
54 params.
set<AuxVariableName>(
"variable") = var_name;
55 params.
set<MaterialPropertyName>(
"property") =
_prop[val];
56 params.
set<
unsigned int>(
"index") = gr;
57 params.
set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
59 std::string aux_kernel_name = var_name;
60 _problem->addAuxKernel(
"MaterialStdVectorAux", aux_kernel_name, params);
const unsigned int _grain_num
number of grains to create
MaterialVectorAuxKernelAction(const InputParameters ¶ms)
const std::vector< MaterialPropertyName > & _prop
list of material properties to be used
const unsigned int _num_prop
number of properties
static InputParameters validParams()
const unsigned int _num_var
number of auxvariables
InputParameters getValidParams(const std::string &name) const
const std::vector< std::string > & _var_name_base
base name for the auxvariables
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
std::string stringify(const T &t)
std::shared_ptr< FEProblemBase > & _problem
void ErrorVector unsigned int
registerMooseAction("PhaseFieldApp", MaterialVectorAuxKernelAction, "add_aux_kernel")