24 params.addParam<std::vector<std::string>>(
"depends_on",
25 "Other RayKernels that this RayKernel depends on");
27 params.registerBase(
"RayKernel");
28 params.registerSystemAttributeName(
"RayKernel");
33 params.addPrivateParam<
bool>(
"_need_segment_reinit",
false);
45 _current_segment_start(_trace_ray.currentIncomingPoint()),
46 _current_segment_end(_trace_ray.currentIntersectionPoint()),
47 _current_segment_length(_trace_ray.currentIntersectionDistance()),
48 _current_incoming_side(_trace_ray.currentIncomingSide()),
49 _need_segment_reinit(getParam<bool>(
"_need_segment_reinit"))
53 for (
const auto &
name : getParam<std::vector<std::string>>(
"depends_on"))
69 if (!ray->shouldContinue())
71 if (ray->endSet() && ray->atEnd())
72 mooseError(
"Cannot changeRayStartDirection() for a Ray that should not continue.\n\n",
73 "It has also hit its user-set end point.\n\n",
76 mooseError(
"Cannot changeRayStartDirection() for a Ray that should not continue.\n\n",
80 if (ray->trajectoryChanged())
81 mooseError(
"Cannot change a Ray's trajectory when its trajectory has already been changed\n\n",
85 mooseError(
"Cannot change the direction of a Ray whose end point is set upon generation "
86 "(via setStartingEndPoint()).\n\n",
90 mooseError(
"A Ray's start point was changed within a RayKernel, and said start point\n",
91 "is not within the element that the RayKernel was executed on.\n\n",
103 std::shared_ptr<Ray> ray =
106 ray->setStartingDirection(direction);
115 "Should not move Rays into buffer while not propagating");
static InputParameters validParams()
void statefulPropertiesAllowed(bool)
static InputParameters validParams()
const std::string & name() const
void mooseError(Args &&... args) const
bool isParamValid(const std::string &name) const
static InputParameters validParams()
virtual void preTrace()
Called at the beginning of the trace on this processor/thread for a Ray.
virtual void postTrace()
This method is called once a ray has reached the end of its trace.
void changeRayStartDirection(const Point &start, const Point &direction)
Changes the current Ray's start point and direction.
void moveRayToBuffer(std::shared_ptr< Ray > &ray)
Moves a Ray into the working buffer to be traced during tracing with a meaningful error on verificati...
std::shared_ptr< Ray > acquireRay(const Point &start, const Point &direction)
Acquires a Ray to be used for generating a new Ray while tracing on the boundary.
RayKernelBase(const InputParameters ¶ms)
static InputParameters validParams()
Base class for a MooseObject used in ray tracing.
const THREAD_ID _tid
The thread id.
static InputParameters validParams()
void dependsOn(const std::string name)
Add an object of this classes base type that this class depends on.
RayTracingStudy & _study
The RayTracingStudy associated with this object.
const std::shared_ptr< Ray > & currentRay() const
Gets the current Ray that this is working on.
const Elem *const & _current_elem
The current Elem that _current_ray is tracing through.
Key that is used for restricting access to moveRayToBufferDuringTrace() and acquireRayDuringTrace().
void moveRayToBufferDuringTrace(std::shared_ptr< Ray > &ray, const THREAD_ID tid, const AcquireMoveDuringTraceKey &)
INTERNAL method for moving a Ray into the buffer during tracing.
std::shared_ptr< Ray > acquireRayDuringTrace(const THREAD_ID tid, const AcquireMoveDuringTraceKey &)
INTERNAL methods for acquiring a Ray during a trace in RayKernels and RayBCs.
bool verifyRays() const
Whether or not to verify if Rays have valid information before being traced.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
Class that is used as a parameter to changeStartDirection() that allows only RayKernelBase methods to...
static const unsigned short invalid_side
Identifier for an invalid side index.