11 #include "MooseRandom.h"
12 #include "MooseMesh.h"
13 #include "MathUtils.h"
21 InputParameters params = validParams<InitialCondition>();
22 params.addClassDescription(
"Tricrystal with a triple junction");
23 params.addRequiredParam<
unsigned int>(
"op_num",
"Number of grain order parameters");
24 params.addRequiredParam<
unsigned int>(
"op_index",
"Index for the current grain order parameter");
25 params.addParam<Real>(
"theta1", 135.0,
"Angle of first grain at triple junction in degrees");
26 params.addParam<Real>(
"theta2", 135.0,
"Angle of second grain at triple junction in degrees");
27 params.addParam<Point>(
29 "The point where the triple junction is located. Default is the center of the mesh");
34 : InitialCondition(parameters),
35 _mesh(_fe_problem.mesh()),
36 _op_num(getParam<unsigned int>(
"op_num")),
37 _op_index(getParam<unsigned int>(
"op_index")),
38 _theta1(getParam<Real>(
"theta1")),
39 _theta2(getParam<Real>(
"theta2"))
42 paramError(
"op_num",
"Tricrystal ICs must have op_num = 3");
45 paramError(
"theta1",
"Sum of the angles theta1 and theta2 must total less than 360 degrees");
48 if (!parameters.isParamValid(
"junction"))
50 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
57 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
60 paramError(
"junction",
"Triple junction out of bounds");
115 if ((((dist_left >= 0 && dist_center >= 0) || (dist_center < 0)) &&
_op_index == 1) ||
116 (dist_right <= 0 && dist_center > 0 &&
_op_index == 2) ||
117 (dist_left < 0 && dist_center > 0 && dist_right > 0 &&
_op_index == 3))
124 else if (_tan_theta2 < 0 && _theta2 >= libMesh::pi / 2.0)
126 if ((dist_left <= 0 && dist_center <= 0 &&
_op_index == 1) ||
127 (((dist_right >= 0 && dist_center <= 0) || (dist_center > 0)) &&
_op_index == 2) ||
128 (dist_left > 0 && dist_right < 0 && dist_center < 0 &&
_op_index == 3))
136 if ((dist_left <= 0 && dist_center <= 0 &&
_op_index == 1) ||
137 (dist_right <= 0 && dist_center > 0 &&
_op_index == 2) ||
138 (((dist_left > 0 && dist_center < 0) || (dist_right > 0 && dist_center >= 0)) &&