www.mooseframework.org
PolycrystalVoronoiVoidICAction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
9 #include "Factory.h"
10 #include "FEProblem.h"
11 #include "Conversion.h"
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<Action>();
19  params.addRequiredParam<std::string>("var_name_base", "specifies the base name of the variables");
20  params.suppressParameter<VariableName>("variable");
21 
22  return params;
23 }
24 
26  : Action(params),
27  _op_num(getParam<unsigned int>("op_num")),
28  _var_name_base(getParam<std::string>("var_name_base"))
29 {
30 }
31 
32 void
34 {
35  // Loop through the number of order parameters
36  for (unsigned int op = 0; op < _op_num; op++)
37  {
38  // Set parameters for BoundingBoxIC
39  InputParameters poly_params = _factory.getValidParams("PolycrystalVoronoiVoidIC");
40  poly_params.applyParameters(parameters());
41  poly_params.set<unsigned int>("op_index") = op;
42  poly_params.set<VariableName>("variable") = _var_name_base + Moose::stringify(op);
43  poly_params.set<MooseEnum>("structure_type") = "grains";
44 
45  // Add initial condition
46  _problem->addInitialCondition(
47  "PolycrystalVoronoiVoidIC", name() + "_" + Moose::stringify(op), poly_params);
48  }
49 }
PolycrystalVoronoiVoidICAction(const InputParameters &params)
InputParameters validParams< PolycrystalVoronoiVoidICAction >()
static InputParameters actionParameters()