www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
PFCRFFVariablesAction Class Reference

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

#include <PFCRFFVariablesAction.h>

Inheritance diagram for PFCRFFVariablesAction:
[legend]

Public Member Functions

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

Private Attributes

const unsigned int _num_L
 
const std::string _L_name_base
 

Detailed Description

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

Definition at line 24 of file PFCRFFVariablesAction.h.

Constructor & Destructor Documentation

◆ PFCRFFVariablesAction()

PFCRFFVariablesAction::PFCRFFVariablesAction ( const InputParameters &  params)

Definition at line 43 of file PFCRFFVariablesAction.C.

44  : Action(params),
45  _num_L(getParam<unsigned int>("num_L")),
46  _L_name_base(getParam<std::string>("L_name_base"))
47 {
48 }

Member Function Documentation

◆ act()

void PFCRFFVariablesAction::act ( )
virtual

Definition at line 51 of file PFCRFFVariablesAction.C.

52 {
53 #ifdef DEBUG
54  Moose::err << "Inside the PFCRFFVariablesAction Object\n";
55  Moose::err << "VariableBase: " << _L_name_base << "\torder: " << getParam<MooseEnum>("order")
56  << "\tfamily: " << getParam<MooseEnum>("family") << std::endl;
57 #endif
58 
59  auto fe_type = AddVariableAction::feType(_pars);
60  auto type = AddVariableAction::determineType(fe_type, 1);
61  auto var_params = _factory.getValidParams(type);
62 
63  var_params.applySpecificParameters(_pars, {"family", "order"});
64  var_params.set<std::vector<Real>>("scaling") = {getParam<Real>("scaling")};
65 
66  // Loop through the number of L variables
67  for (unsigned int l = 0; l < _num_L; ++l)
68  {
69  // Create L base name
70  std::string L_name = _L_name_base + Moose::stringify(l);
71 
72  // Create real L variable
73  const std::string real_name = L_name + "_real";
74  _problem->addVariable(type, real_name, var_params);
75 
76  if (l > 0)
77  {
78  // Create imaginary L variable IF l > 0
79  std::string imag_name = L_name + "_imag";
80  _problem->addVariable(type, imag_name, var_params);
81  }
82  }
83 }

Member Data Documentation

◆ _L_name_base

const std::string PFCRFFVariablesAction::_L_name_base
private

Definition at line 33 of file PFCRFFVariablesAction.h.

Referenced by act().

◆ _num_L

const unsigned int PFCRFFVariablesAction::_num_L
private

Definition at line 32 of file PFCRFFVariablesAction.h.

Referenced by act().


The documentation for this class was generated from the following files:
PFCRFFVariablesAction::_L_name_base
const std::string _L_name_base
Definition: PFCRFFVariablesAction.h:33
PFCRFFVariablesAction::_num_L
const unsigned int _num_L
Definition: PFCRFFVariablesAction.h:32