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 22 of file NonconservedAction.h.

Constructor & Destructor Documentation

NonconservedAction::NonconservedAction ( const InputParameters &  params)

Definition at line 57 of file NonconservedAction.C.

58  : Action(params),
59  _var_name(name()),
60  _fe_type(Utility::string_to_enum<Order>(getParam<MooseEnum>("order")),
61  Utility::string_to_enum<FEFamily>(getParam<MooseEnum>("family")))
62 {
63 }
const FEType _fe_type
FEType for the variable being created.
const NonlinearVariableName _var_name
Name of the variable being created.

Member Function Documentation

void NonconservedAction::act ( )
virtual

Definition at line 66 of file NonconservedAction.C.

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

Member Data Documentation

const FEType NonconservedAction::_fe_type
protected

FEType for the variable being created.

Definition at line 33 of file NonconservedAction.h.

Referenced by act().

const NonlinearVariableName NonconservedAction::_var_name
protected

Name of the variable being created.

Definition at line 31 of file NonconservedAction.h.

Referenced by act().


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