19 params.addParam<
bool>(
"at_end_without_set",
false,
"Test Ray::atEnd() without the end being set");
20 params.addParam<
bool>(
21 "end_point_without_set",
false,
"Test Ray::endPoint() without the end being set");
22 params.addParam<
bool>(
23 "set_start_again",
false,
"Test setting a Ray's start point multiple times");
24 params.addParam<
bool>(
25 "set_direction_again",
false,
"Test setting a Ray's direction multiple times");
26 params.addParam<
bool>(
"set_start_fail_bbox",
28 "Test setting a Ray's start point to a point that fails the bbox check");
29 params.addParam<
bool>(
"set_side_without_elem",
31 "Test setting a Ray's incoming side without a starting element");
32 params.addParam<
bool>(
33 "set_invalid_side",
false,
"Test setting a Ray's incoming side to an invalid one");
34 params.addParam<
bool>(
35 "set_bad_side",
false,
"Test setting a Ray's incoming side to a wrong side");
36 params.addParam<
bool>(
39 "Test setting a Ray's start point to one that is not within the starting element");
40 params.addParam<
bool>(
41 "set_direction_before_start",
false,
"Test setting a Ray's direction before its start point");
42 params.addParam<
bool>(
43 "set_zero_direction",
false,
"Test setting a Ray's direction to the zero vector");
44 params.addParam<
bool>(
45 "set_end_before_start",
false,
"Test setting a Ray's end point before its start point");
46 params.addParam<
bool>(
47 "set_end_equal_start",
false,
"Test setting a Ray's end point to its start point");
48 params.addParam<
bool>(
"set_end_with_direction",
50 "Test setting a Ray's end point after setting its direction");
51 params.addParam<
bool>(
"set_distance_with_end",
53 "Test setting a Ray's max distance after setting its end point");
54 params.addParam<
bool>(
"set_end_with_distance",
56 "Test setting a Ray's end point after setting its max distance");
57 params.addParam<
bool>(
"set_end_fail_bbox",
59 "Test setting a Ray's end point to a point that fails the bbox check");
60 params.addParam<
bool>(
"set_distance_before_start",
62 "Test setting a Ray's max distance before its start point");
63 params.addParam<
bool>(
64 "set_distance_negative",
false,
"Test setting a Ray's max distance to a negative value");
65 params.addParam<
bool>(
66 "set_start_inactive",
false,
"Tests setting a Ray's starting element to an inactive element");
67 params.addParam<
bool>(
"set_stationary_before_start",
69 "Test setting a Ray as stationary before its start point");
70 params.addParam<
bool>(
"set_stationary_with_direction",
72 "Test setting a Ray as stationary after setting its direction");
73 params.addParam<
bool>(
"set_stationary_with_end",
75 "Test setting a Ray as stationary after setting its endpoint");
76 params.set<
bool>(
"_use_ray_registration") =
false;
92 if (getParam<bool>(
"set_distance_before_start"))
93 ray->setStartingMaxDistance(1);
94 if (getParam<bool>(
"set_stationary_before_start"))
96 if (getParam<bool>(
"at_end_without_set"))
98 if (getParam<bool>(
"end_point_without_set"))
100 if (getParam<bool>(
"set_start_fail_bbox"))
101 ray->setStart(Point(1e6, 1e6, 1e6));
102 if (getParam<bool>(
"set_side_without_elem"))
103 ray->setStart(elem->vertex_average(),
nullptr, 0);
104 if (getParam<bool>(
"set_invalid_side"))
105 ray->setStart(elem->vertex_average(), elem, 100);
106 if (getParam<bool>(
"set_bad_side"))
107 ray->setStart(elem->vertex_average(), elem, 0);
108 if (getParam<bool>(
"set_direction_before_start"))
109 ray->setStartingDirection(Point(1, 0, 0));
110 if (getParam<bool>(
"set_bad_start"))
112 const Elem * another_elem = elem->neighbor_ptr(0);
114 another_elem = elem->neighbor_ptr(1);
115 ray->setStart(elem->vertex_average(), another_elem);
117 if (getParam<bool>(
"set_end_before_start"))
118 ray->setStartingEndPoint(elem->point(0));
119 if (getParam<bool>(
"set_start_inactive"))
121 for (
const auto & inactive_elem :
meshBase().element_ptr_range())
122 if (!inactive_elem->active())
123 ray->setStart(inactive_elem->true_centroid(), inactive_elem);
126 ray->setStart(elem->vertex_average(), elem);
128 if (getParam<bool>(
"set_start_again"))
129 ray->setStart(1.01 * elem->vertex_average());
130 if (getParam<bool>(
"set_direction_again"))
132 ray->setStartingDirection(Point(1, 0, 0));
133 ray->setStartingDirection(Point(-1, 0, 0));
135 if (getParam<bool>(
"set_zero_direction"))
136 ray->setStartingDirection(Point(0, 0, 0));
137 if (getParam<bool>(
"set_end_equal_start"))
138 ray->setStartingEndPoint(ray->currentPoint());
139 if (getParam<bool>(
"set_end_with_direction"))
141 ray->setStartingDirection(Point(1, 0, 0));
142 ray->setStartingEndPoint(elem->point(0));
144 if (getParam<bool>(
"set_distance_with_end"))
146 ray->setStartingEndPoint(elem->point(0));
147 ray->setStartingMaxDistance(1);
149 if (getParam<bool>(
"set_end_with_distance"))
151 ray->setStartingMaxDistance(1);
152 ray->setStartingEndPoint(elem->point(0));
154 if (getParam<bool>(
"set_end_fail_bbox"))
155 ray->setStartingEndPoint(Point(1e6, 1e6, 1e6));
156 if (getParam<bool>(
"set_distance_negative"))
157 ray->setStartingMaxDistance(-1);
158 if (getParam<bool>(
"set_stationary_with_direction"))
160 ray->setStartingDirection(Point(1, 0, 0));
161 ray->setStationary();
163 if (getParam<bool>(
"set_stationary_with_end"))
165 ray->setStartingEndPoint(elem->point(0));
166 ray->setStationary();
libMesh::ConstElemRange * getActiveLocalElementRange()
MooseMesh & _mesh
The Mesh.
TestRay(const InputParameters ¶meters)
registerMooseObject("RayTracingTestApp", TestRay)
std::shared_ptr< Ray > acquireRay()
User APIs for constructing Rays within the RayTracingStudy.
static InputParameters validParams()
void generateRays() override final
Subclasses should override this to determine how to generate Rays.
static InputParameters validParams()
const_iterator begin() const
MeshBase & meshBase() const
Access to the libMesh MeshBase.
Base class for Ray tracing studies that will generate Rays and then propagate all of them to terminat...