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 16 of file PolycrystalKernelAction.h.

Constructor & Destructor Documentation

PolycrystalKernelAction::PolycrystalKernelAction ( const InputParameters &  params)

Definition at line 37 of file PolycrystalKernelAction.C.

38  : Action(params),
39  _op_num(getParam<unsigned int>("op_num")),
40  _var_name_base(getParam<std::string>("var_name_base"))
41 {
42 }
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

void PolycrystalKernelAction::act ( )
virtual

Definition at line 45 of file PolycrystalKernelAction.C.

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

const unsigned int PolycrystalKernelAction::_op_num
protected

number of grains to create

Definition at line 25 of file PolycrystalKernelAction.h.

Referenced by act().

const std::string PolycrystalKernelAction::_var_name_base
protected

base name for the order parameter variables

Definition at line 28 of file PolycrystalKernelAction.h.

Referenced by act().


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