www.mooseframework.org
Public Member Functions | 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 Member Functions

 CHPFCRFFSplitVariablesAction (const InputParameters &params)
 
virtual void act ()
 

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 25 of file CHPFCRFFSplitVariablesAction.h.

Constructor & Destructor Documentation

◆ CHPFCRFFSplitVariablesAction()

CHPFCRFFSplitVariablesAction::CHPFCRFFSplitVariablesAction ( const InputParameters &  params)

Definition at line 46 of file CHPFCRFFSplitVariablesAction.C.

47  : Action(params),
48  _num_L(getParam<unsigned int>("num_L")),
49  _L_name_base(getParam<std::string>("L_name_base")),
50  _sub_filenames(getParam<std::vector<FileName>>("sub_filenames")),
51  _n_name(getParam<AuxVariableName>("n_name"))
52 {
53 }
const std::vector< FileName > _sub_filenames

Member Function Documentation

◆ act()

void CHPFCRFFSplitVariablesAction::act ( )
virtual

Definition at line 56 of file CHPFCRFFSplitVariablesAction.C.

57 {
58  ExecFlagEnum execute_options = MooseUtils::getDefaultExecFlagEnum();
59  execute_options = EXEC_TIMESTEP_BEGIN;
60 
61  // Setup MultiApp
62  InputParameters poly_params = _factory.getValidParams("TransientMultiApp");
63  poly_params.set<MooseEnum>("app_type") = "PhaseFieldApp";
64  poly_params.set<ExecFlagEnum>("execute_on") = execute_options;
65  poly_params.set<std::vector<FileName>>("input_files") = _sub_filenames;
66  poly_params.set<unsigned int>("max_procs_per_app") = 1;
67  poly_params.set<std::vector<Point>>("positions") = {Point()};
68  _problem->addMultiApp("TransientMultiApp", "HHEquationSolver", poly_params);
69 
70  poly_params = _factory.getValidParams("MultiAppNearestNodeTransfer");
71  poly_params.set<MooseEnum>("direction") = "to_multiapp";
72  poly_params.set<ExecFlagEnum>("execute_on") = execute_options;
73  poly_params.set<AuxVariableName>("variable") = _n_name;
74  poly_params.set<VariableName>("source_variable") = _n_name;
75  poly_params.set<MultiAppName>("multi_app") = "HHEquationSolver";
76  _problem->addTransfer("MultiAppNearestNodeTransfer", _n_name + "_trans", poly_params);
77 
78  // Loop through the number of L variables
79  for (unsigned int l = 0; l < _num_L; ++l)
80  {
81  // Create L base name
82  std::string L_name = _L_name_base + Moose::stringify(l);
83 
84  // Create real L variable
85  std::string real_name = L_name + "_real";
86 
87  _problem->addAuxVariable(
88  real_name,
89  FEType(Utility::string_to_enum<Order>(getParam<MooseEnum>("order")),
90  Utility::string_to_enum<FEFamily>(getParam<MooseEnum>("family"))));
91 
92  poly_params = _factory.getValidParams("MultiAppNearestNodeTransfer");
93  poly_params.set<MooseEnum>("direction") = "from_multiapp";
94  poly_params.set<AuxVariableName>("variable") = real_name;
95  poly_params.set<VariableName>("source_variable") = real_name;
96  poly_params.set<MultiAppName>("multi_app") = "HHEquationSolver";
97  _problem->addTransfer("MultiAppNearestNodeTransfer", real_name + "_trans", poly_params);
98 
99  if (l > 0)
100  {
101  // Create imaginary L variable IF l > 0
102  std::string imag_name = L_name + "_imag";
103 
104  _problem->addAuxVariable(
105  imag_name,
106  FEType(Utility::string_to_enum<Order>(getParam<MooseEnum>("order")),
107  Utility::string_to_enum<FEFamily>(getParam<MooseEnum>("family"))));
108 
109  poly_params = _factory.getValidParams("MultiAppNearestNodeTransfer");
110  poly_params.set<MooseEnum>("direction") = "from_multiapp";
111  poly_params.set<AuxVariableName>("variable") = imag_name;
112  poly_params.set<VariableName>("source_variable") = imag_name;
113  poly_params.set<MultiAppName>("multi_app") = "HHEquationSolver";
114  _problem->addTransfer("MultiAppNearestNodeTransfer", imag_name + "_trans", poly_params);
115  }
116  }
117 }
const std::vector< FileName > _sub_filenames

Member Data Documentation

◆ _L_name_base

const std::string CHPFCRFFSplitVariablesAction::_L_name_base
private

Definition at line 34 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().

◆ _n_name

const AuxVariableName CHPFCRFFSplitVariablesAction::_n_name
private

Definition at line 36 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().

◆ _num_L

const unsigned int CHPFCRFFSplitVariablesAction::_num_L
private

Definition at line 33 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().

◆ _sub_filenames

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

Definition at line 35 of file CHPFCRFFSplitVariablesAction.h.

Referenced by act().


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