www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
NonconservedAction Class Reference

#include <NonconservedAction.h>

Inheritance diagram for NonconservedAction:
[legend]

Public Member Functions

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

Protected Attributes

const NonlinearVariableName _var_name
 Name of the variable being created. More...
 
const FEType _fe_type
 FEType for the variable being created. More...
 

Detailed Description

Definition at line 25 of file NonconservedAction.h.

Constructor & Destructor Documentation

◆ NonconservedAction()

NonconservedAction::NonconservedAction ( const InputParameters &  params)

Definition at line 63 of file NonconservedAction.C.

64  : Action(params),
65  _var_name(name()),
66  _fe_type(Utility::string_to_enum<Order>(getParam<MooseEnum>("order")),
67  Utility::string_to_enum<FEFamily>(getParam<MooseEnum>("family")))
68 {
69 }
const std::string name
Definition: Setup.h:22
const FEType _fe_type
FEType for the variable being created.
const NonlinearVariableName _var_name
Name of the variable being created.

Member Function Documentation

◆ act()

void NonconservedAction::act ( )
virtual

Definition at line 72 of file NonconservedAction.C.

73 {
74  //
75  // Add variable
76  //
77  if (_current_task == "add_variable")
78  {
79  // Create nonconserved variable
80  _problem->addVariable(_var_name, _fe_type, getParam<Real>("scaling"));
81  }
82 
83  //
84  // Add Kernels
85  //
86  else if (_current_task == "add_kernel")
87  {
88  // Add time derivative kernel
89  std::string kernel_type = "TimeDerivative";
90 
91  std::string kernel_name = _var_name + "_" + kernel_type;
92  InputParameters params1 = _factory.getValidParams(kernel_type);
93  params1.set<NonlinearVariableName>("variable") = _var_name;
94  params1.applyParameters(parameters());
95 
96  _problem->addKernel(kernel_type, kernel_name, params1);
97 
98  // Add AllenCahn kernel
99  kernel_type = "AllenCahn";
100 
101  kernel_name = _var_name + "_" + kernel_type;
102  InputParameters params2 = _factory.getValidParams(kernel_type);
103  params2.set<NonlinearVariableName>("variable") = _var_name;
104  params2.set<MaterialPropertyName>("mob_name") = getParam<MaterialPropertyName>("mobility");
105  params2.set<MaterialPropertyName>("f_name") = getParam<MaterialPropertyName>("free_energy");
106  params2.applyParameters(parameters());
107 
108  _problem->addKernel(kernel_type, kernel_name, params2);
109 
110  // Add ACInterface kernel
111  kernel_type = "ACInterface";
112 
113  kernel_name = _var_name + "_" + kernel_type;
114  InputParameters params3 = _factory.getValidParams(kernel_type);
115  params3.set<NonlinearVariableName>("variable") = _var_name;
116  params3.set<MaterialPropertyName>("mob_name") = getParam<MaterialPropertyName>("mobility");
117  params3.set<MaterialPropertyName>("kappa_name") = getParam<MaterialPropertyName>("kappa");
118  params3.set<bool>("variable_L") = getParam<bool>("variable_mobility");
119  params3.applyParameters(parameters());
120 
121  _problem->addKernel(kernel_type, kernel_name, params3);
122  }
123 }
const FEType _fe_type
FEType for the variable being created.
const NonlinearVariableName _var_name
Name of the variable being created.

Member Data Documentation

◆ _fe_type

const FEType NonconservedAction::_fe_type
protected

FEType for the variable being created.

Definition at line 36 of file NonconservedAction.h.

Referenced by act().

◆ _var_name

const NonlinearVariableName NonconservedAction::_var_name
protected

Name of the variable being created.

Definition at line 34 of file NonconservedAction.h.

Referenced by act().


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