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

Action that sets up ACGrGrPoly, ACInterface, TimeDerivative, and ACGBPoly kernels. More...

#include <PolycrystalKernelAction.h>

Inheritance diagram for PolycrystalKernelAction:
[legend]

Public Member Functions

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

Protected Attributes

const unsigned int _op_num
 number of grains to create More...
 
const std::string _var_name_base
 base name for the order parameter variables More...
 

Detailed Description

Action that sets up ACGrGrPoly, ACInterface, TimeDerivative, and ACGBPoly kernels.

Definition at line 19 of file PolycrystalKernelAction.h.

Constructor & Destructor Documentation

◆ PolycrystalKernelAction()

PolycrystalKernelAction::PolycrystalKernelAction ( const InputParameters &  params)

Definition at line 42 of file PolycrystalKernelAction.C.

43  : Action(params),
44  _op_num(getParam<unsigned int>("op_num")),
45  _var_name_base(getParam<std::string>("var_name_base"))
46 {
47 }
const unsigned int _op_num
number of grains to create
const std::string _var_name_base
base name for the order parameter variables

Member Function Documentation

◆ act()

void PolycrystalKernelAction::act ( )
virtual

Definition at line 50 of file PolycrystalKernelAction.C.

51 {
52  for (unsigned int op = 0; op < _op_num; ++op)
53  {
54  //
55  // Create variable names
56  //
57 
58  std::string var_name = _var_name_base + Moose::stringify(op);
59  std::vector<VariableName> v;
60  v.resize(_op_num - 1);
61 
62  unsigned int ind = 0;
63  for (unsigned int j = 0; j < _op_num; ++j)
64  if (j != op)
65  v[ind++] = _var_name_base + Moose::stringify(j);
66 
67  //
68  // Set up ACGrGrPoly kernels
69  //
70 
71  {
72  InputParameters params = _factory.getValidParams("ACGrGrPoly");
73  params.set<NonlinearVariableName>("variable") = var_name;
74  params.set<std::vector<VariableName>>("v") = v;
75  params.applyParameters(parameters());
76 
77  std::string kernel_name = "ACBulk_" + var_name;
78  _problem->addKernel("ACGrGrPoly", kernel_name, params);
79  }
80 
81  //
82  // Set up ACInterface kernels
83  //
84 
85  {
86  InputParameters params = _factory.getValidParams("ACInterface");
87  params.set<NonlinearVariableName>("variable") = var_name;
88  params.applyParameters(parameters());
89 
90  std::string kernel_name = "ACInt_" + var_name;
91  _problem->addKernel("ACInterface", kernel_name, params);
92  }
93 
94  //
95  // Set up TimeDerivative kernels
96  //
97 
98  {
99  InputParameters params = _factory.getValidParams("TimeDerivative");
100  params.set<NonlinearVariableName>("variable") = var_name;
101  params.set<bool>("implicit") = true;
102  params.applyParameters(parameters());
103 
104  std::string kernel_name = "IE_" + var_name;
105  _problem->addKernel("TimeDerivative", kernel_name, params);
106  }
107 
108  //
109  // Set up optional ACGBPoly bubble interaction kernels
110  //
111 
112  if (isParamValid("c"))
113  {
114  InputParameters params = _factory.getValidParams("ACGBPoly");
115  params.set<NonlinearVariableName>("variable") = var_name;
116  params.set<std::vector<VariableName>>("c") = {getParam<VariableName>("c")};
117  params.applyParameters(parameters());
118 
119  std::string kernel_name = "ACBubInteraction_" + var_name;
120  _problem->addKernel("ACGBPoly", kernel_name, params);
121  }
122  }
123 }
const unsigned int _op_num
number of grains to create
const std::string _var_name_base
base name for the order parameter variables

Member Data Documentation

◆ _op_num

const unsigned int PolycrystalKernelAction::_op_num
protected

number of grains to create

Definition at line 28 of file PolycrystalKernelAction.h.

Referenced by act().

◆ _var_name_base

const std::string PolycrystalKernelAction::_var_name_base
protected

base name for the order parameter variables

Definition at line 31 of file PolycrystalKernelAction.h.

Referenced by act().


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