16#include "libmesh/string_to_enum.h"
25 params.
addClassDescription(
"Creates the L auxiliary variables, as well as a MultiApp along with "
26 "transfers to set the variables, for the Cahn-Hilliard equation for "
27 "the RFF form of the phase field crystal model");
31 "Specifies the family of FE shape functions to use for the L variables");
36 "Specifies the order of the FE shape function to use for the L variables");
37 params.
addParam<Real>(
"scaling", 1.0,
"Specifies a scaling factor to apply to the L variables");
39 "num_L",
"specifies the number of complex L variables will be solved for");
40 params.
addRequiredParam<std::string>(
"L_name_base",
"Base name for the complex L variables");
42 "This is the filename of the sub.i file");
43 params.
addRequiredParam<AuxVariableName>(
"n_name",
"Name of atomic density variable");
50 _num_L(getParam<unsigned
int>(
"num_L")),
51 _L_name_base(getParam<
std::string>(
"L_name_base")),
52 _sub_filenames(getParam<
std::vector<FileName>>(
"sub_filenames")),
53 _n_name(getParam<AuxVariableName>(
"n_name"))
65 poly_params.
set<
MooseEnum>(
"app_type") =
"PhaseFieldApp";
68 poly_params.
set<
unsigned int>(
"max_procs_per_app") = 1;
69 poly_params.
set<std::vector<Point>>(
"positions") = {Point()};
70 _problem->addMultiApp(
"TransientMultiApp",
"HHEquationSolver", poly_params);
74 poly_params.
set<std::vector<AuxVariableName>>(
"variable") = {
_n_name};
75 poly_params.
set<std::vector<VariableName>>(
"source_variable") = {
_n_name};
76 poly_params.
set<MultiAppName>(
"to_multi_app") =
"HHEquationSolver";
77 _problem->addTransfer(
"MultiAppNearestNodeTransfer",
_n_name +
"_trans", poly_params);
80 for (
unsigned int l = 0; l <
_num_L; ++l)
86 std::string real_name = L_name +
"_real";
90 FEType(Utility::string_to_enum<Order>(getParam<MooseEnum>(
"order")),
91 Utility::string_to_enum<FEFamily>(getParam<MooseEnum>(
"family"))),
98 _problem->addAuxVariable(var_type, real_name, var_params);
101 poly_params.
set<std::vector<AuxVariableName>>(
"variable") = {real_name};
102 poly_params.
set<std::vector<VariableName>>(
"source_variable") = {real_name};
103 poly_params.
set<MultiAppName>(
"from_multi_app") =
"HHEquationSolver";
104 _problem->addTransfer(
"MultiAppNearestNodeTransfer", real_name +
"_trans", poly_params);
109 std::string imag_name = L_name +
"_imag";
111 _problem->addAuxVariable(var_type, imag_name, var_params);
114 poly_params.
set<std::vector<AuxVariableName>>(
"variable") = {imag_name};
115 poly_params.
set<std::vector<VariableName>>(
"source_variable") = {imag_name};
116 poly_params.
set<MultiAppName>(
"from_multi_app") =
"HHEquationSolver";
117 _problem->addTransfer(
"MultiAppNearestNodeTransfer", imag_name +
"_trans", poly_params);
registerMooseAction("PhaseFieldApp", CHPFCRFFSplitVariablesAction, "add_variable")
const ExecFlagType EXEC_TIMESTEP_BEGIN
void ErrorVector unsigned int
static InputParameters validParams()
std::shared_ptr< FEProblemBase > & _problem
static MooseEnum getNonlinearVariableFamilies()
static MooseEnum getNonlinearVariableOrders()
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
Automatically generates all the L variables for the RFF phase field crystal model.
const std::vector< FileName > _sub_filenames
const unsigned int _num_L
const std::string _L_name_base
const AuxVariableName _n_name
static InputParameters validParams()
CHPFCRFFSplitVariablesAction(const InputParameters ¶ms)
InputParameters getValidParams(const std::string &name) const
ExecFlagEnum getDefaultExecFlagEnum()
std::string stringify(const T &t)