11 #include "MooseMesh.h"
17 InputParameters params = validParams<InitialCondition>();
18 params.addRequiredParam<Real>(
"outside",
"Outside value");
19 params.addRequiredParam<std::vector<Point>>(
20 "smaller_coordinate_corners",
21 "For 1D, these are the left points; for 2D, these are the bottom left corners; for 3D, these "
22 "are the back bottom left corners. The format is (corner1_x corner1_y corner1_z corner2_x "
23 "corner2_y corner2_z ...)");
24 params.addRequiredParam<std::vector<Point>>(
25 "larger_coordinate_corners",
26 "For 1D, these are the right points; for 2D, these are the top right corners; for 3D, these "
27 "are the front top right corners. The format is (corner1_x corner1_y corner1_z corner2_x "
28 "corner2_y corner2_z ...)");
29 params.addRequiredParam<Real>(
"int_width",
"The value of the interfacial width between boxes");
30 params.addRequiredParam<std::vector<Real>>(
"inside",
31 "The value of the variable inside each box "
32 "(one value per box or a single value for "
38 : InitialCondition(parameters),
39 _outside(getParam<Real>(
"outside")),
40 _c1(getParam<std::vector<Point>>(
"smaller_coordinate_corners")),
41 _c2(getParam<std::vector<Point>>(
"larger_coordinate_corners")),
43 _int_width(getParam<Real>(
"int_width")),
44 _dim(_fe_problem.mesh().dimension()),
45 _inside(getParam<std::vector<Real>>(
"inside"))
62 paramError(
"vector inputs must all be the same size");
65 paramError(
"'int_width' should be non-negative");
69 for (
unsigned int b = 0; b <
_nbox; ++b)
71 for (
unsigned int i = 0; i <
_dim; ++i)
72 if (
_c1[b](i) <
_c2[b](i) && p(i) >=
_c1[b](i) && p(i) <=
_c2[b](i))