17 #include "libmesh/string_to_enum.h" 27 params.
addClassDescription(
"Set up order parameter variables for a polycrystal simulation");
33 "Specifies the family of FE " 34 "shape function to use for the order parameters");
37 "Specifies the order of the FE " 38 "shape function to use for the order parameters");
42 "Take the initial condition of all polycrystal variables from the mesh file");
43 params.
addParam<
Real>(
"scaling", 1.0,
"Specifies a scaling factor to apply to this variable");
45 "specifies the number of order parameters to create");
46 params.
addRequiredParam<std::string>(
"var_name_base",
"specifies the base name of the variables");
47 params.
addParam<std::vector<SubdomainName>>(
48 "block", {},
"Block restriction for the variables and kernels");
54 _op_num(getParam<unsigned
int>(
"op_num")),
55 _var_name_base(getParam<
std::string>(
"var_name_base"))
63 bool initial_from_file = getParam<bool>(
"initial_from_file");
66 for (
unsigned int op = 0; op <
_op_num; op++)
79 var_params.set<std::vector<Real>>(
"scaling") = {
_pars.
get<
Real>(
"scaling")};
84 if (initial_from_file)
91 auto * system = &
_problem->getNonlinearSystemBase(0);
92 system->addVariableToCopy(var_name, var_name,
"LATEST");
InputParameters getValidParams(const std::string &name) const
const std::string _var_name_base
static InputParameters validParams()
static MooseEnum getNonlinearVariableFamilies()
static InputParameters validParams()
static MooseEnum getNonlinearVariableOrders()
Automatically generates all variables to model a polycrystal with op_num orderparameters.
void setExodusFileRestart(bool flag)
const std::string & type() const
const std::string & _current_task
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
std::string stringify(const T &t)
static libMesh::FEType feType(const InputParameters ¶ms)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned int _op_num
const InputParameters & _pars
registerMooseAction("PhaseFieldApp", PolycrystalVariablesAction, "add_variable")
std::shared_ptr< FEProblemBase > & _problem
void ErrorVector unsigned int
PolycrystalVariablesAction(const InputParameters ¶ms)