Implemented (Real) Ray Tracing by Stack #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, I introduce "real" ray tracing by z-stack. A z-stack is a set of 3D tracks that have the same polar angle, same axial spacing, and are separated by a constant axial spacing. This will allow more faithful quantification of axial ray tracing time.
This method determines intersections of all tracks in a z-stack with vertical or horizontal (x-y plane) surfaces analytically. This method is described in detail in "Reducing 3D MOC Storage Requirements with Axial On-the-fly Ray Tracing" submitted to PHYSOR 2016.
The resulting algorithm is significantly faster than the current axial on-the-fly ray tracing algorithm and allows for no additional computational complexity when moving to local axial meshes.
To construct the intersections of all tracks in a z-stack, the structure of the track laydown procedure is utilized. Specifically all tracks in the z-stack have the same polar angle, project onto the same 2D track, and are separated by a constant axial ray spacing. Therefore, from the intersection of the lowest track with the z-axis at the start of the associated 2D track, the axial height of every track in the z-stack can be computed as a function of 2D distance traveled in the radial plane. This leads to the ability to analytically determine the indexes in the z-stack of the first and last tracks to cross a given FSR. An illustration is given below:
In this picture two FSRs are selected. The first and last tracks to cross the FSRs are denoted with green and red arrows. Notice that in FSR A, there are some tracks with the same length, implying they form the same segment information. This can be utilized to speed up axial ray tracing and also allows for the potential of spatial locality when accessing FSRs since adjacent tracks can hit the same FSR.