16 #include "libmesh/string_to_enum.h" 27 params.
addClassDescription(
"Creates the L auxiliary variables, as well as a MultiApp along with " 28 "transfers to set the variables, for the Cahn-Hilliard equation for " 29 "the RFF form of the phase field crystal model");
33 "Specifies the family of FE shape functions to use for the L variables");
38 "Specifies the order of the FE shape function to use for the L variables");
39 params.
addParam<
Real>(
"scaling", 1.0,
"Specifies a scaling factor to apply to the L variables");
41 "num_L",
"specifies the number of complex L variables will be solved for");
42 params.
addRequiredParam<std::string>(
"L_name_base",
"Base name for the complex L variables");
44 "This is the filename of the sub.i file");
45 params.
addRequiredParam<AuxVariableName>(
"n_name",
"Name of atomic density variable");
52 _num_L(getParam<unsigned
int>(
"num_L")),
53 _L_name_base(getParam<
std::string>(
"L_name_base")),
54 _sub_filenames(getParam<
std::vector<FileName>>(
"sub_filenames")),
55 _n_name(getParam<AuxVariableName>(
"n_name"))
67 poly_params.
set<
MooseEnum>(
"app_type") =
"PhaseFieldApp";
70 poly_params.
set<
unsigned int>(
"max_procs_per_app") = 1;
71 poly_params.
set<std::vector<Point>>(
"positions") = {
Point()};
72 _problem->addMultiApp(
"TransientMultiApp",
"HHEquationSolver", poly_params);
74 poly_params =
_factory.getValidParams(
"MultiAppNearestNodeTransfer");
76 poly_params.
set<std::vector<AuxVariableName>>(
"variable") = {
_n_name};
77 poly_params.
set<std::vector<VariableName>>(
"source_variable") = {
_n_name};
78 poly_params.
set<MultiAppName>(
"to_multi_app") =
"HHEquationSolver";
79 _problem->addTransfer(
"MultiAppNearestNodeTransfer",
_n_name +
"_trans", poly_params);
82 for (
unsigned int l = 0; l <
_num_L; ++l)
88 std::string real_name = L_name +
"_real";
92 FEType(Utility::string_to_enum<Order>(getParam<MooseEnum>(
"order")),
93 Utility::string_to_enum<FEFamily>(getParam<MooseEnum>(
"family"))),
100 _problem->addAuxVariable(var_type, real_name, var_params);
102 poly_params =
_factory.getValidParams(
"MultiAppNearestNodeTransfer");
103 poly_params.
set<std::vector<AuxVariableName>>(
"variable") = {real_name};
104 poly_params.
set<std::vector<VariableName>>(
"source_variable") = {real_name};
105 poly_params.
set<MultiAppName>(
"from_multi_app") =
"HHEquationSolver";
106 _problem->addTransfer(
"MultiAppNearestNodeTransfer", real_name +
"_trans", poly_params);
111 std::string imag_name = L_name +
"_imag";
113 _problem->addAuxVariable(var_type, imag_name, var_params);
115 poly_params =
_factory.getValidParams(
"MultiAppNearestNodeTransfer");
116 poly_params.
set<std::vector<AuxVariableName>>(
"variable") = {imag_name};
117 poly_params.
set<std::vector<VariableName>>(
"source_variable") = {imag_name};
118 poly_params.
set<MultiAppName>(
"from_multi_app") =
"HHEquationSolver";
119 _problem->addTransfer(
"MultiAppNearestNodeTransfer", imag_name +
"_trans", poly_params);
const std::vector< FileName > _sub_filenames
const AuxVariableName _n_name
const unsigned int _num_L
registerMooseAction("PhaseFieldApp", CHPFCRFFSplitVariablesAction, "add_variable")
static InputParameters validParams()
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
static MooseEnum getNonlinearVariableFamilies()
ExecFlagEnum getDefaultExecFlagEnum()
static InputParameters validParams()
static MooseEnum getNonlinearVariableOrders()
const ExecFlagType EXEC_TIMESTEP_BEGIN
CHPFCRFFSplitVariablesAction(const InputParameters ¶ms)
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)
const std::string _L_name_base
Automatically generates all the L variables for the RFF phase field crystal model.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::shared_ptr< FEProblemBase > & _problem
void ErrorVector unsigned int