Skip to content

Commit

Permalink
Merge pull request #26043 from gsgall/next
Browse files Browse the repository at this point in the history
Adding the post trace and upating the documentation page for RayKernel
  • Loading branch information
loganharbour authored Nov 15, 2023
2 parents 26072ad + 1b615b7 commit ed69223
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/ray_tracing/doc/content/syntax/RayKernels/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The remainder of the discussion focuses on the use of the functionality offered

## Using a RayKernel

The method that is called on each segment of a [Ray.md] in a RayKernel is `onSegment()`. This method is to be overridden to specialize the on-segment operation. The `preTrace()` method is also available to be overridden and is called before a trace begins on a processor/thread.
The method that is called on each segment of a [Ray.md] in a RayKernel is `onSegment()`. This method is to be overridden to specialize the on-segment operation. The `preTrace()` method is also available to be overridden and is called before a trace begins on a processor/thread. After the ray has finished its trace the `postTrace()` method is called, this method is also available to be overridden.

The significant information pertaining to the trace that is available within `onSegment()` is as follows:

Expand Down
5 changes: 5 additions & 0 deletions modules/ray_tracing/include/raykernels/RayKernelBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ class RayKernelBase : public RayTracingObject,
*/
virtual void preTrace();

/**
* This method is called once a ray has reached the end of its trace.
*/
virtual void postTrace();

/**
* Whether or not this RayKernel needs a segment reinit
*/
Expand Down
5 changes: 5 additions & 0 deletions modules/ray_tracing/src/raykernels/RayKernelBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ void
RayKernelBase::preTrace()
{
}

void
RayKernelBase::postTrace()
{
}
3 changes: 3 additions & 0 deletions modules/ray_tracing/src/raytracing/TraceRay.C
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,9 @@ TraceRay::trace(const std::shared_ptr<Ray> & ray)
void
TraceRay::onCompleteTrace(const std::shared_ptr<Ray> & ray)
{
for (RayKernelBase * rk : _study.currentRayKernels(_tid))
rk->postTrace();

debugRay("Called onCompleteTrace()\n", (*_current_ray)->getInfo());
if (_intersection_distance > 0)
possiblyAddDebugRayMeshPoint(_incoming_point, _intersection_point);
Expand Down

0 comments on commit ed69223

Please sign in to comment.