12 #include "Conversion.h"
13 #include "FEProblem.h"
21 InputParameters params = validParams<Action>();
22 params.addClassDescription(
"Action that adds the contribution of stored energy associated with "
23 "dislocations to grain growth models");
24 params.addRequiredParam<
unsigned int>(
"op_num",
25 "specifies the total number of OPs representing "
26 "all grains (deformed + undeformed "
27 "(recrystallized)) to create");
28 params.addRequiredParam<std::string>(
"var_name_base",
"specifies the base name of the variables");
29 params.addParam<VariableName>(
"c",
"Name of coupled concentration variable");
30 params.addRequiredParam<
unsigned int>(
"deformed_grain_num",
31 "specifies the number of deformed grains to create");
32 params.addParam<VariableName>(
"T",
"Name of temperature variable");
33 params.addParam<
bool>(
34 "use_displaced_mesh",
false,
"Whether to use displaced mesh in the kernels");
35 params.addRequiredParam<UserObjectName>(
"grain_tracker",
36 "The GrainTracker UserObject to get values from.");
42 _op_num(getParam<unsigned int>(
"op_num")),
43 _var_name_base(getParam<std::string>(
"var_name_base")),
44 _deformed_grain_num(getParam<unsigned int>(
"deformed_grain_num"))
51 for (
unsigned int op = 0; op <
_op_num; ++op)
58 std::vector<VariableName> v;
62 for (
unsigned int j = 0; j <
_op_num; ++j)
70 InputParameters params = _factory.getValidParams(
"ACSEDGPoly");
71 params.set<NonlinearVariableName>(
"variable") = var_name;
72 params.set<std::vector<VariableName>>(
"v") = v;
73 params.set<UserObjectName>(
"grain_tracker") = getParam<UserObjectName>(
"grain_tracker");
74 params.set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
75 params.set<
unsigned int>(
"deformed_grain_num") = getParam<unsigned int>(
"deformed_grain_num");
76 params.set<
unsigned int>(
"op_index") = op;
78 std::string kernel_name =
"ACStoredEnergy_" + var_name;
79 _problem->addKernel(
"ACSEDGPoly", kernel_name, params);