22 params.addClassDescription(
23 "Ray study that spawns Rays in the direction of a cone from a given set of starting points.");
25 params.addRequiredParam<std::vector<Point>>(
"start_points",
"The point(s) of the cone(s).");
26 params.addRequiredParam<std::vector<Point>>(
27 "directions",
"The direction(s) of the cone(s) (points down the center of each cone).");
28 params.addParam<std::vector<Real>>(
"scaling_factors",
29 "Scaling factors for each cone (if any). Defaults to 1.");
31 params.addRequiredParam<std::vector<Real>>(
"half_cone_angles",
32 "Angle of the half-cones in degrees (must be <= 90)");
33 params.addParam<std::vector<unsigned int>>(
35 "Order of the polar quadrature for each cone. Polar angle is between ray and the "
36 "cone direction. Must be positive. This will default to 2 for all cones if not provided.");
37 params.addParam<std::vector<unsigned int>>(
38 "azimuthal_quad_orders",
39 "Order of the azimuthal quadrature per quadrant for each cone. The azimuthal angle is "
40 "measured in a plane perpendicular to the cone direction. This will default to 30 if not "
41 "provided. Must be positive.");
43 params.addRequiredParam<std::string>(
"ray_data_name",
44 "The name of the Ray data that the angular quadrature "
45 "weights and factors will be filled into for "
46 "properly weighting the line source per Ray.");
50 params.set<
bool>(
"_use_ray_registration") =
false;
57 _start_points(getParam<
std::vector<Point>>(
"start_points")),
58 _directions(getParam<
std::vector<Point>>(
"directions")),
59 _scaling_factors(isParamValid(
"scaling_factors")
60 ? getParam<
std::vector<Real>>(
"scaling_factors")
61 :
std::vector<Real>(_start_points.size(), 1)),
62 _half_cone_angles(getParam<
std::vector<Real>>(
"half_cone_angles")),
63 _polar_quad_orders(isParamValid(
"polar_quad_orders")
64 ? getParam<
std::vector<unsigned
int>>(
"polar_quad_orders")
65 :
std::vector<unsigned
int>(_start_points.size(), 2)),
66 _azimuthal_quad_orders(
67 isParamValid(
"azimuthal_quad_orders")
68 ? getParam<
std::vector<unsigned
int>>(
"azimuthal_quad_orders")
69 :
std::vector<unsigned
int>(_start_points.size(), 30)),
70 _ray_data_index(registerRayData(getParam<
std::string>(
"ray_data_name")))
73 paramError(
"directions",
"Not the same size as start_points.");
76 paramError(
"scaling_factors",
"Not the same size as start_points.");
79 paramError(
"half_cone_angles",
"Not the same size as start_points.");
81 if (val <= 0 || val > 90)
82 paramError(
"half_cone_angles",
"Must be > 0 and <= 90 degrees");
85 paramError(
"polar_quad_orders",
"Not the same size as start_points.");
88 paramError(
"azimuthal_quad_orders",
"Not the same size as start_points.");
132 _rays.emplace_back(std::move(ray));
registerMooseObject("RayTracingApp", ConeRayStudy)
void ErrorVector unsigned int
Ray study that spawns Rays in a cone from a given set of starting points for the cones and half angle...
virtual void defineRays() override
Entry point for the user to create Rays.
const std::vector< Real > _scaling_factors
Scaling factors for each cone's Rays (defaults to 1)
const std::vector< unsigned int > _azimuthal_quad_orders
The azimuthal quadrature orders for each cone.
const std::vector< Point > _directions
The directions that define the cones (points down the center of the cone)
const std::vector< Point > _start_points
The points to start the Rays from (the cone points)
const RayDataIndex _ray_data_index
The index into the Ray's data for storing the angular quadrature weight and scaling factor.
const std::vector< unsigned int > _polar_quad_orders
The polar quadrature orders for each cone.
static InputParameters validParams()
const std::vector< Real > _half_cone_angles
The half-cone angles in degrees for each cone.
ConeRayStudy(const InputParameters ¶meters)
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
virtual unsigned int dimension() const
std::size_t numDirections() const
Get the number of directions in the rotated and projected quadrature.
Real getTotalWeight(const unsigned int l) const
Gets the total of the weights associated with the direction l.
const libMesh::Point & getDirection(const unsigned int l) const
Get the direction associated with direction l.
void rotate(const libMesh::Point &rotation_direction)
Rotates the quadrature to a given direction.
MooseMesh & _mesh
The Mesh.
std::shared_ptr< Ray > acquireReplicatedRay()
Acquire a Ray from the pool of Rays within generateRays() in a replicated fashion.
A RayTracingStudy that generates and traces Rays repeatedly that a user defines only once.
std::vector< std::shared_ptr< Ray > > & _rays
Vector of Rays that the user will fill into in defineRays() (restartable)
static InputParameters validParams()