-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented (Real) Ray Tracing by Stack #2
base: master
Are you sure you want to change the base?
Conversation
@jtramm This PR adds faithful ray tracing to SimpleMOC. This should be reviewed and tested before merging with master. |
|
||
// calculate the distance traveled in the SR | ||
float start_z = first_track_lower_z + k*fine_delta_z; | ||
float ds = (z_max - start_z) / abs(mu); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the integer abs() call intentional here? If you want the floating point one, that would be fabs or fabsf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be floating point
|
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.