https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CHPFCRFFSplitVariablesAction Class Reference

Automatically generates all the L variables for the RFF phase field crystal model. More...

#include <CHPFCRFFSplitVariablesAction.h>

Inheritance diagram for CHPFCRFFSplitVariablesAction:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 CHPFCRFFSplitVariablesAction (const InputParameters &params)
 
virtual void act ()
 
void timedAct ()
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Private Attributes

const unsigned int _num_L
 
const std::string _L_name_base
 
const std::vector< FileName > _sub_filenames
 
const AuxVariableName _n_name
 

Detailed Description

Automatically generates all the L variables for the RFF phase field crystal model.

Definition at line 18 of file CHPFCRFFSplitVariablesAction.h.

Constructor & Destructor Documentation

◆ CHPFCRFFSplitVariablesAction()

CHPFCRFFSplitVariablesAction::CHPFCRFFSplitVariablesAction ( const InputParameters params)

Definition at line 50 of file CHPFCRFFSplitVariablesAction.C.

51  : Action(params),
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"))
56 {
57 }
const std::vector< FileName > _sub_filenames
Action(const InputParameters &parameters)
const T & getParam(const std::string &name) const

Member Function Documentation

◆ act()

void CHPFCRFFSplitVariablesAction::act ( )
virtual

Implements Action.

Definition at line 60 of file CHPFCRFFSplitVariablesAction.C.

61 {
63  execute_options = EXEC_TIMESTEP_BEGIN;
64 
65  // Setup MultiApp
66  InputParameters poly_params = _factory.getValidParams("TransientMultiApp");
67  poly_params.set<MooseEnum>("app_type") = "PhaseFieldApp";
68  poly_params.set<ExecFlagEnum>("execute_on") = execute_options;
69  poly_params.set<std::vector<FileName>>("input_files") = _sub_filenames;
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);
73 
74  poly_params = _factory.getValidParams("MultiAppNearestNodeTransfer");
75  poly_params.set<ExecFlagEnum>("execute_on") = execute_options;
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);
80 
81  // Loop through the number of L variables
82  for (unsigned int l = 0; l < _num_L; ++l)
83  {
84  // Create L base name
85  std::string L_name = _L_name_base + Moose::stringify(l);
86 
87  // Create real L variable
88  std::string real_name = L_name + "_real";
89 
90  // Get string name for specified L variable type
91  std::string var_type = AddVariableAction::variableType(
92  FEType(Utility::string_to_enum<Order>(getParam<MooseEnum>("order")),
93  Utility::string_to_enum<FEFamily>(getParam<MooseEnum>("family"))),
94  /* is_fv = */ false,
95  /* is_array = */ false);
96 
97  // Get params for specified L variable type
98  InputParameters var_params = _factory.getValidParams(var_type);
99 
100  _problem->addAuxVariable(var_type, real_name, var_params);
101 
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);
107 
108  if (l > 0)
109  {
110  // Create imaginary L variable IF l > 0
111  std::string imag_name = L_name + "_imag";
112 
113  _problem->addAuxVariable(var_type, imag_name, var_params);
114 
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);
120  }
121  }
122 }
const std::vector< FileName > _sub_filenames
T & set(const std::string &name, bool quiet_mode=false)
ExecFlagEnum getDefaultExecFlagEnum()
Factory & _factory
const ExecFlagType EXEC_TIMESTEP_BEGIN
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)
std::shared_ptr< FEProblemBase > & _problem

◆ validParams()

InputParameters CHPFCRFFSplitVariablesAction::validParams ( )
static

Definition at line 23 of file CHPFCRFFSplitVariablesAction.C.

24 {
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");
30  params.addParam<MooseEnum>(
31  "family",
32  familyEnum,
33  "Specifies the family of FE shape functions to use for the L variables");
35  params.addParam<MooseEnum>(
36  "order",
37  orderEnum,
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");
40  params.addRequiredParam<unsigned int>(
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");
43  params.addRequiredParam<std::vector<FileName>>("sub_filenames",
44  "This is the filename of the sub.i file");
45  params.addRequiredParam<AuxVariableName>("n_name", "Name of atomic density variable");
46 
47  return params;
48 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static MooseEnum getNonlinearVariableFamilies()
static InputParameters validParams()
static MooseEnum getNonlinearVariableOrders()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _L_name_base

const std::string CHPFCRFFSplitVariablesAction::_L_name_base
private

Definition at line 29 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().

◆ _n_name

const AuxVariableName CHPFCRFFSplitVariablesAction::_n_name
private

Definition at line 31 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().

◆ _num_L

const unsigned int CHPFCRFFSplitVariablesAction::_num_L
private

Definition at line 28 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().

◆ _sub_filenames

const std::vector<FileName> CHPFCRFFSplitVariablesAction::_sub_filenames
private

Definition at line 30 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().


The documentation for this class was generated from the following files: