12 #include "FEProblem.h"
13 #include "Conversion.h"
21 InputParameters params = validParams<Action>();
22 params.addClassDescription(
"Constructs a bicrystal, where one grain is on the inside of "
23 "the box and the other grain is the outside of the box");
24 params.addRequiredParam<std::string>(
"var_name_base",
"specifies the base name of the variables");
25 params.addRequiredParam<
unsigned int>(
"op_num",
"Number of grains, should be 2");
26 params.addRequiredParam<Real>(
"x1",
"The x coordinate of the lower left-hand corner of the box");
27 params.addRequiredParam<Real>(
"y1",
"The y coordinate of the lower left-hand corner of the box");
28 params.addParam<Real>(
"z1", 0.0,
"The z coordinate of the lower left-hand corner of the box");
29 params.addRequiredParam<Real>(
"x2",
"The x coordinate of the upper right-hand corner of the box");
30 params.addRequiredParam<Real>(
"y2",
"The y coordinate of the upper right-hand corner of the box");
31 params.addParam<Real>(
"z2", 0.0,
"The z coordinate of the upper right-hand corner of the box");
37 _var_name_base(getParam<std::string>(
"var_name_base")),
38 _op_num(getParam<unsigned int>(
"op_num"))
41 paramError(
"op_num",
"Must equal 2 for bicrystal ICs");
48 Moose::err <<
"Inside the BicrystalBoundingBoxICAction Object\n";
52 for (
unsigned int op = 0; op <
_op_num; ++op)
55 const std::string var_name =
_var_name_base + Moose::stringify(op);
58 InputParameters poly_params = _factory.getValidParams(
"BoundingBoxIC");
59 poly_params.applyParameters(parameters());
60 poly_params.set<VariableName>(
"variable") = var_name;
64 poly_params.set<Real>(
"inside") = 1.0;
65 poly_params.set<Real>(
"outside") = 0.0;
70 poly_params.set<Real>(
"inside") = 0.0;
71 poly_params.set<Real>(
"outside") = 1.0;
75 _problem->addInitialCondition(
76 "BoundingBoxIC",
"BicrystalBoundingBoxIC_" + Moose::stringify(op), poly_params);