Celeritas 0.7.0-dev.254+develop.a6804dd8
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
celeritas::optical::SurfaceTraversalView Class Reference

Manage one-dimensional logic for traversing an optical surface. More...

#include <SurfaceTraversalView.hh>

Classes

struct  Initializer
 

Public Types

Type aliases
using SurfaceParamsRef = NativeCRef< SurfacePhysicsParamsData >
 
using SurfaceStateRef = NativeRef< SurfacePhysicsStateData >
 

Public Member Functions

 SurfaceTraversalView (SurfaceParamsRef const &, SurfaceStateRef const &, TrackSlotId)
 Create view from surface physics data and state for a given track.
 
SurfaceTraversalViewoperator= (Initializer const &)
 Initialize track state with given initializer data.
 
bool in_pre_volume () const
 Whether the track is in the pre-volume.
 
bool in_post_volume () const
 Whether the track is in the post-volume.
 
bool is_exiting () const
 Whether the current track direction is exiting the surface.
 
bool is_exiting (SubsurfaceDirection) const
 Whether the direction is exiting the surface.
 
SurfaceTrackPosition pos () const
 Current position of the track in the sub-surfaces, in track-local coordinates.
 
SurfaceTrackPosition next_pos () const
 
void pos (SurfaceTrackPosition)
 Set current position of the track in the sub-surfaces, in track-local coordinates.
 
SurfaceTrackPosition::size_type num_positions () const
 Get number of valid track positions in the surface.
 
SubsurfaceDirection dir () const
 Get current track traversal direction.
 
void dir (SubsurfaceDirection)
 Set current track traversal direction.
 
void cross_interface (SubsurfaceDirection)
 Cross the subsurface interface in the given direction.
 

Detailed Description

Manage one-dimensional logic for traversing an optical surface.

Member Function Documentation

◆ dir()

SubsurfaceDirection celeritas::optical::SurfaceTraversalView::dir ( ) const
inline

Get current track traversal direction.

This quantity is cached for a single loop of surface boundary crossing to avoid repeated queries of the geometry. The traversal direction should be updated when the geometry direction is updated after an interaction.

◆ num_positions()

SurfaceTrackPosition::size_type celeritas::optical::SurfaceTraversalView::num_positions ( ) const
inline

Get number of valid track positions in the surface.

This is equivalent to the number of interstitial sub-surface materials, plus the pre-volume and post-volumes.

Todo:
Check if caching this would improve performance over redirections.

◆ pos()

SurfaceTrackPosition celeritas::optical::SurfaceTraversalView::pos ( ) const
inline

Current position of the track in the sub-surfaces, in track-local coordinates.

Tracks traverse a surface in track-local coordinates where 0 is the pre-volume and N is the post-volume. Depending on the surface orientation, this will be mapped to the appropriate sub-surface material and interface.


The documentation for this class was generated from the following file: