12 #include "FEProblem.h"
13 #include "Conversion.h"
21 InputParameters params = validParams<Action>();
22 params.addClassDescription(
23 "Action that addes the elastic driving force for each order parameter");
24 params.addRequiredParam<
unsigned int>(
"op_num",
"specifies the number of grains to create");
25 params.addRequiredParam<std::string>(
"var_name_base",
"specifies the base name of the variables");
26 params.addParam<
bool>(
27 "use_displaced_mesh",
false,
"Whether to use displaced mesh in the kernels");
28 params.addParam<std::string>(
"base_name",
29 "Optional parameter that allows the user to define "
30 "multiple mechanics material systems on the same "
31 "block, i.e. for multiple phases");
36 const InputParameters & params)
38 _op_num(getParam<unsigned int>(
"op_num")),
39 _var_name_base(getParam<std::string>(
"var_name_base")),
40 _base_name(isParamValid(
"base_name") ? getParam<std::string>(
"base_name") +
"_" :
""),
41 _elasticity_tensor_name(_base_name +
"elasticity_tensor")
49 Moose::err <<
"Inside the PolycrystalElasticDrivingForceAction Object\n";
53 for (
unsigned int op = 0; op <
_op_num; ++op)
59 MaterialPropertyName D_stiff_name =
63 std::string kernel_type =
"ACGrGrElasticDrivingForce";
66 InputParameters poly_params = _factory.getValidParams(kernel_type);
67 poly_params.set<NonlinearVariableName>(
"variable") = var_name;
68 poly_params.set<MaterialPropertyName>(
"D_tensor_name") = D_stiff_name;
69 poly_params.set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
71 std::string kernel_name =
"AC_ElasticDrivingForce_" + var_name;
74 _problem->addKernel(kernel_type, kernel_name, poly_params);