Skip to content

Adjust and document optical surface traversal#2345

Open
sethrj wants to merge 6 commits intoceleritas-project:developfrom
sethrj:optical-surface-id
Open

Adjust and document optical surface traversal#2345
sethrj wants to merge 6 commits intoceleritas-project:developfrom
sethrj:optical-surface-id

Conversation

@sethrj
Copy link
Copy Markdown
Member

@sethrj sethrj commented Mar 31, 2026

I was working on the optical ID refactor and hit the surprise that the "surface track position" is an opaque ID that didn't quite behave like an opaque ID. This PR is intended to reduce some of the confusion in "sub-surface" stepping by refactoring the data and IDs to behave more like IDs:

  • LocalPositionId represents the pre/interstitial/post material ID
  • LocalSurfaceId represents the interstitial surface ID
  • LocalDirection is the -/+ sign while moving through the surface crossing.

The analogy for these names is in ORANGE where they index into elements of a record. We do the same here for a single physics surface record.

See detailed documentation in https://github.com/sethrj/celeritas/blob/9899ff12805f601c1ce9d55c73aff07c3b934861/src/celeritas/optical/surface/SurfacePhysicsView.hh#L21 .


I have a feeling we can, in the future, entirely remove "orientation" and the sign swapping on surface normals, and turn those IDs into true IDs (not flipping them around). When entering a surface, we should be able to simply initialize the position and direction in the {position N, negative dir} logical state and store {forward orientation = reported geometry normal < 0} as an additional logical state.

@sethrj sethrj requested a review from hhollenb March 31, 2026 20:44
@sethrj sethrj added physics Particles, processes, and stepping algorithms minor Refactoring or minor internal changes/fixes labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

Test summary

 5 701 files   9 238 suites   19m 37s ⏱️
 2 251 tests  2 209 ✅  42 💤 0 ❌
32 202 runs  32 077 ✅ 125 💤 0 ❌

Results for commit 667ed4f.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.25%. Comparing base (e2c8f84) to head (667ed4f).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2345      +/-   ##
===========================================
- Coverage    87.26%   87.25%   -0.01%     
===========================================
  Files         1377     1377              
  Lines        43836    43831       -5     
  Branches     13875    13872       -3     
===========================================
- Hits         38253    38245       -8     
- Misses        4524     4527       +3     
  Partials      1059     1059              
Files with missing lines Coverage Δ
src/celeritas/inp/OpticalPhysics.hh 67.90% <ø> (ø)
src/celeritas/optical/Types.hh 100.00% <100.00%> (ø)
...rc/celeritas/optical/surface/SurfacePhysicsData.hh 95.55% <100.00%> (ø)
.../celeritas/optical/surface/SurfacePhysicsParams.cc 98.73% <100.00%> (ø)
...leritas/optical/surface/SurfacePhysicsTrackView.hh 100.00% <100.00%> (ø)
...c/celeritas/optical/surface/SurfacePhysicsUtils.hh 96.00% <100.00%> (ø)
...rc/celeritas/optical/surface/SurfacePhysicsView.hh 100.00% <100.00%> (ø)
.../celeritas/optical/surface/SurfaceTraversalView.hh 100.00% <100.00%> (ø)
...celeritas/optical/surface/VolumeSurfaceSelector.hh 100.00% <100.00%> (ø)
...tas/optical/surface/detail/InitBoundaryExecutor.hh 90.90% <100.00%> (ø)
... and 1 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sethrj
Copy link
Copy Markdown
Member Author

sethrj commented Apr 4, 2026

@hhollenb Could you please take a look at this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Refactoring or minor internal changes/fixes physics Particles, processes, and stepping algorithms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant