Celeritas 0.7.0-dev.169+develop.bdc0041f6
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
celeritas::GeoTrackInterface< RealType > Class Template Referenceabstract

Standard interface to geometry navigation for a track for testing on CPU. More...

#include <GeoTrackInterface.hh>

Public Types

Type aliases
using Initializer_t = GeoTrackInitializer
 
using real_type = RealType
 
using Real3 = Array< real_type, 3 >
 

Public Member Functions

virtual ~GeoTrackInterface ()=0
 Default virtual destructor.
 
virtual GeoTrackInterfaceoperator= (Initializer_t const &init)=0
 Initialize the state.
 
virtual ImplVolumeId impl_volume_id () const =0
 Get the implementation volume ID.
 
virtual bool is_outside () const =0
 Whether the track is outside the valid geometry region.
 
virtual bool failed () const =0
 Whether the last operation resulted in an error.
 
Physical state

Return the physical position in the global coordinate system

virtual Real3 constpos () const =0
 Return the direction in the global coordinate system.
 
virtual Real3 constdir () const =0
 Return the direction in the global coordinate system.
 
Canonical volume state

Get the canonical volume ID in the current impl volume

virtual VolumeId volume_id () const =0
 Get the physical volume ID in the current cell.
 
virtual VolumeInstanceId volume_instance_id () const =0
 Get the physical volume ID in the current cell.
 
virtual VolumeLevelId volume_level () const =0
 Get the distance from root volume in the geometry hierarchy.
 
virtual void volume_instance_id (Span< VolumeInstanceId > levels) const =0
 Get the volume instance ID for all levels.
 
Surface state
virtual bool is_on_boundary () const =0
 Whether the track is exactly on a surface.
 
virtual Real3 normal () const =0
 Calculate the normal vector on the current surface.
 
Straight-line movement and boundary crossing
virtual Propagation find_next_step ()=0
 Find the distance to the next boundary (infinite max).
 
virtual Propagation find_next_step (real_type max_step)=0
 Find the distance to the next boundary, up to and including a step.
 
virtual void move_internal (real_type step)=0
 Move within the volume.
 
virtual void move_to_boundary ()=0
 Move to the boundary in preparation for crossing it.
 
virtual void cross_boundary ()=0
 Cross from one side of the current surface to the other.
 
Locally bounded movement
virtual real_type find_safety ()=0
 Find the safety distance at the current position.
 
virtual real_type find_safety (real_type max_step)=0
 Find the safety at the current position, up to a maximum step distance.
 
virtual void set_dir (Real3 const &newdir)=0
 Change direction.
 
virtual void move_internal (Real3 const &pos)=0
 Move within the volume to a specific point.
 

Protected Member Functions

 CELER_DEFAULT_COPY_MOVE (GeoTrackInterface)
 

Detailed Description

template<class RealType = ::celeritas::real_type>
class celeritas::GeoTrackInterface< RealType >

Standard interface to geometry navigation for a track for testing on CPU.

Template Parameters
RealTypeFloating point precision
Note
This class is for illustrative and testing purposes only (see celeritas::test::WrappedGeoTrackView) and is not used during the main Celeritas execution. The geometry there is determined by the CELERITAS_CORE_GEO configuration variable and defined as a type alias celeritas::CoreGeoTrackView .

Initialization is performed via the assignment operator using a GeoTrackInitializer.

Tracking to and across volumes along a straight line requires a specific sequence of calls.

Note
The flag is_on_boundary will be true both before and after the call to cross_boundary, and the surface normal can be calculated in both cases.

Movement to a nearby but arbitrary point can be done inside a "safety" distance:

Member Function Documentation

◆ cross_boundary()

template<class RealType = ::celeritas::real_type>
virtual void celeritas::GeoTrackInterface< RealType >::cross_boundary ( )
pure virtual

Cross from one side of the current surface to the other.

Changes the logical state when on the boundary, updating to the next volume.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ dir()

template<class RealType = ::celeritas::real_type>
virtual Real3 const & celeritas::GeoTrackInterface< RealType >::dir ( ) const
pure virtual

Return the direction in the global coordinate system.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ failed()

template<class RealType = ::celeritas::real_type>
virtual bool celeritas::GeoTrackInterface< RealType >::failed ( ) const
pure virtual

Whether the last operation resulted in an error.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ find_next_step() [1/2]

template<class RealType = ::celeritas::real_type>
virtual Propagation celeritas::GeoTrackInterface< RealType >::find_next_step ( )
pure virtual

Find the distance to the next boundary (infinite max).

Determines the distance to the next boundary (i.e., a different implementation volume) along the track's current direction.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ find_next_step() [2/2]

template<class RealType = ::celeritas::real_type>
virtual Propagation celeritas::GeoTrackInterface< RealType >::find_next_step ( real_type  max_step)
pure virtual

Find the distance to the next boundary, up to and including a step.

Determines the distance to the next boundary along the track's current direction, up to a given distance. Queries may be more efficient for small distances.

Implemented in celeritas::test::WrappedGeoTrackView< GTV >.

◆ find_safety() [1/2]

template<class RealType = ::celeritas::real_type>
virtual real_type celeritas::GeoTrackInterface< RealType >::find_safety ( )
pure virtual

Find the safety distance at the current position.

Determines the distance to the nearest boundary in any direction (i.e., the radius of the maximally inscribed sphere).

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ find_safety() [2/2]

template<class RealType = ::celeritas::real_type>
virtual real_type celeritas::GeoTrackInterface< RealType >::find_safety ( real_type  max_step)
pure virtual

Find the safety at the current position, up to a maximum step distance.

The resulting safety should be no larger than the maximum step.

Implemented in celeritas::test::WrappedGeoTrackView< GTV >.

◆ impl_volume_id()

template<class RealType = ::celeritas::real_type>
virtual ImplVolumeId celeritas::GeoTrackInterface< RealType >::impl_volume_id ( ) const
pure virtual

Get the implementation volume ID.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ is_on_boundary()

template<class RealType = ::celeritas::real_type>
virtual bool celeritas::GeoTrackInterface< RealType >::is_on_boundary ( ) const
pure virtual

Whether the track is exactly on a surface.

Returns true if a track is exactly on the boundary of a volume, capable of changing to another volume without altering the physical position.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ is_outside()

template<class RealType = ::celeritas::real_type>
virtual bool celeritas::GeoTrackInterface< RealType >::is_outside ( ) const
pure virtual

Whether the track is outside the valid geometry region.

Returns true if the track has left the world (or started outside the outermost known volume).

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ move_internal() [1/2]

template<class RealType = ::celeritas::real_type>
virtual void celeritas::GeoTrackInterface< RealType >::move_internal ( Real3 const pos)
pure virtual

Move within the volume to a specific point.

Changes the physical position of the geometry state without altering the logical state (i.e., it must remain within the current volume).

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ move_internal() [2/2]

template<class RealType = ::celeritas::real_type>
virtual void celeritas::GeoTrackInterface< RealType >::move_internal ( real_type  step)
pure virtual

Move within the volume.

Changes the physical position of the geometry state without altering the logical state (i.e., it must remain within the current volume).

Precondition
The given step must be less than or equal to the previous find_next_step result and can only be equal if the endpoint is not on a boundary.

Implemented in celeritas::test::WrappedGeoTrackView< GTV >.

◆ move_to_boundary()

template<class RealType = ::celeritas::real_type>
virtual void celeritas::GeoTrackInterface< RealType >::move_to_boundary ( )
pure virtual

Move to the boundary in preparation for crossing it.

Moves the track to the boundary of the current volume along the current direction, updating its logical state to indicate that it is on the boundary of the current volume.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ normal()

template<class RealType = ::celeritas::real_type>
virtual Real3 celeritas::GeoTrackInterface< RealType >::normal ( ) const
pure virtual

Calculate the normal vector on the current surface.

Returns a global-coordinate direction perpendicular to the volume at the local point when on a boundary. The sign of the surface normal is implementation-dependent; it may change based on the track state (previous volume, direction, surface sign) or geometry construction.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ operator=()

template<class RealType = ::celeritas::real_type>
virtual GeoTrackInterface & celeritas::GeoTrackInterface< RealType >::operator= ( Initializer_t const init)
pure virtual

Initialize the state.

Takes a GeoTrackInitializer object to locate the point in the geometry hierarchy.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ pos()

template<class RealType = ::celeritas::real_type>
virtual Real3 const & celeritas::GeoTrackInterface< RealType >::pos ( ) const
pure virtual

Return the direction in the global coordinate system.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ set_dir()

template<class RealType = ::celeritas::real_type>
virtual void celeritas::GeoTrackInterface< RealType >::set_dir ( Real3 const newdir)
pure virtual

Change direction.

Changes the direction of the track (in global coordinate system).

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ volume_id()

template<class RealType = ::celeritas::real_type>
virtual VolumeId celeritas::GeoTrackInterface< RealType >::volume_id ( ) const
pure virtual

Get the physical volume ID in the current cell.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ volume_instance_id() [1/2]

template<class RealType = ::celeritas::real_type>
virtual VolumeInstanceId celeritas::GeoTrackInterface< RealType >::volume_instance_id ( ) const
pure virtual

Get the physical volume ID in the current cell.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ volume_instance_id() [2/2]

template<class RealType = ::celeritas::real_type>
virtual void celeritas::GeoTrackInterface< RealType >::volume_instance_id ( Span< VolumeInstanceId levels) const
pure virtual

Get the volume instance ID for all levels.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.

◆ volume_level()

template<class RealType = ::celeritas::real_type>
virtual VolumeLevelId celeritas::GeoTrackInterface< RealType >::volume_level ( ) const
pure virtual

Get the distance from root volume in the geometry hierarchy.

Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.


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