22 params.addParam<
bool>(
25 "Whether or not to emit a warning if a Ray is being reflected on a non-planar side");
27 params.addClassDescription(
"A RayBC that reflects a Ray in a specular manner on a boundary.");
33 :
GeneralRayBC(params), _warn_non_planar(getParam<bool>(
"warn_non_planar"))
41 mooseWarning(
"A Ray is being reflected on a non-planar side.\n\n",
42 "Ray tracing on elements with non-planar faces is an approximation.\n\n",
43 "The normal used to compute the reflected direction is computed at\n",
44 "the side centroid and may not be valid for a non-planar side.\n\n",
45 "To disable this warning, set RayKernels/",
47 "/warn_non_planar=false.\n\n",
73 Point reflected_direction = direction;
74 reflected_direction -= 2.0 * (reflected_direction * normal) * normal;
75 return reflected_direction / reflected_direction.norm();
const unsigned short & _current_intersected_side
The side that _current_ray intersects (if any)
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
const std::shared_ptr< Ray > & currentRay() const
Gets the current Ray that this is working on.
ReflectRayBC(const InputParameters ¶ms)
virtual const std::string & name() const
void mooseWarning(Args &&... args) const
RayBC that reflects a Ray.
static Point reflectedDirection(const Point &direction, const Point &normal)
Computes the reflected direction given a direction and an outward normal for the surface it reflects ...
const Elem *const & _current_elem
The current Elem that _current_ray is tracing through.
const THREAD_ID _tid
The thread id.
bool sideIsNonPlanar(const Elem *elem, const unsigned short s) const
Whether or not the side on elem elem is non-planar.
static InputParameters validParams()
const bool _warn_non_planar
Whether or not to emit a warning if a Ray is being reflected on a non-planar side.
registerMooseObject("RayTracingApp", ReflectRayBC)
virtual const Point & getSideNormal(const Elem *elem, const unsigned short side, const THREAD_ID tid)
Get the outward normal for a given element side.
void changeRayDirection(const Point &direction, const bool skip_changed_check=false)
Changes the current Ray's direction.
static InputParameters validParams()
RayTracingStudy & _study
The RayTracingStudy associated with this object.
virtual void onBoundary(const unsigned int num_applying) override
Called on a Ray on the boundary to apply the Ray boundary condition.