22 "Value that specifies the number of grains to create");
24 "var_name_base",
"Vector specifies the base name of the variables");
26 "the scalar material property names");
28 "use_displaced_mesh",
false,
"Whether to use displaced mesh in the kernels");
30 params.
addParam<AuxVariableName>(
"divergence_variable",
31 "Name of divergence variable to generate kernels for");
32 params.
addParam<MaterialPropertyName>(
"divergence_property",
33 "Scalar material property name for divergence variable");
39 _div_var(getParam<AuxVariableName>(
"divergence_variable")),
40 _prop(getParam<
std::vector<MaterialPropertyName>>(
"property")),
41 _div_prop(getParam<MaterialPropertyName>(
"divergence_property"))
43 mooseDeprecated(
"Use 'MaterialVectorAuxKernel' or 'MaterialVectorGradAuxKernel' action instead " 44 "depending on data_type of MaterialProperty<std::vector<data_type> >");
50 const std::vector<std::string> var_name_base =
51 getParam<std::vector<std::string>>(
"var_name_base");
53 const unsigned int op_num = getParam<unsigned int>(
"op_num");
54 const unsigned int dim = getParam<unsigned int>(
"dim");
55 const unsigned int size_v = var_name_base.size();
56 const unsigned int size_p =
_prop.size();
59 paramError(
"property",
"var_name_base and property must be vectors of the same dimension");
61 for (
unsigned int op = 0; op < op_num; ++op)
63 for (
unsigned int val = 0; val < size_v; ++val)
64 for (
unsigned int x = 0;
x <
dim; ++
x)
69 params.
set<AuxVariableName>(
"variable") = var_name;
70 params.
set<MaterialPropertyName>(
"property") =
_prop[val];
71 params.
set<
unsigned int>(
"component") =
x;
72 params.
set<
unsigned int>(
"index") = op;
73 params.
set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
74 _problem->addAuxKernel(
"MaterialStdVectorRealGradientAux",
"grad_" + var_name, params);
84 params.
set<MaterialPropertyName>(
"property") =
_div_prop;
85 params.
set<
unsigned int>(
"index") = op;
86 params.
set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
90 mooseError(
"Must specify a divergence_property name along with divergence_variable name");
registerMooseAction("PhaseFieldApp", MatVecRealGradAuxKernelAction, "add_aux_kernel")
const MaterialPropertyName _div_prop
void mooseDeprecated(Args &&... args) const
static InputParameters validParams()
InputParameters getValidParams(const std::string &name) const
bool isParamValid(const std::string &name) const
static InputParameters validParams()
const std::vector< double > x
const std::vector< MaterialPropertyName > _prop
MatVecRealGradAuxKernelAction(const InputParameters ¶ms)
void paramError(const std::string ¶m, Args... args) const
std::string stringify(const T &t)
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const AuxVariableName _div_var