Celeritas 0.7.0-dev.194+develop.0df4cab59
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
celeritas::test::CheckedGeoTrackView Class Referencefinal

Check validity of safety and volume crossings while navigating on CPU. More...

#include <CheckedGeoTrackView.hh>

Inheritance diagram for celeritas::test::CheckedGeoTrackView:
Inheritance graph
[legend]

Public Types

Type aliases
using Initializer_t = GeoTrackInitializer
 
using Real3 = Array< real_type, 3 >
 
using TrackT = GeoTrackInterface< real_type >
 
using UPTrack = std::unique_ptr< TrackT >
 
- Public Types inherited from celeritas::GeoTrackInterface< real_type >
using Initializer_t = GeoTrackInitializer
 
using real_type = real_type
 
using Real3 = Array< real_type, 3 >
 

Public Member Functions

 CheckedGeoTrackView (UPTrack track)
 Construct with a unique pointer to a geo track view.
 
TrackT consttrack_view () const
 Access the underlying track view.
 
TrackTtrack_view ()
 Access the underlying track view.
 
size_type intersect_count () const
 Number of calls of find_next_step.
 
size_type safety_count () const
 Number of calls of find_safety.
 
void reset_count ()
 Reset the counters.
 
void check_normal (bool value)
 Enable/disable normal checking.
 
bool check_normal () const
 Whether normal checking is enabled.
 
CheckedGeoTrackViewoperator= (GeoTrackInitializer const &init) final
 Initialize the state.
 
Real3 constpos () const final
 Return the direction in the global coordinate system.
 
Real3 constdir () const final
 Return the direction in the global coordinate system.
 
VolumeId volume_id () const final
 Get the physical volume ID in the current cell.
 
VolumeInstanceId volume_instance_id () const final
 Get the physical volume ID in the current cell.
 
VolumeLevelId volume_level () const final
 Get the distance from root volume in the geometry hierarchy.
 
void volume_instance_id (Span< VolumeInstanceId > levels) const final
 Get the volume instance ID for all levels.
 
ImplVolumeId impl_volume_id () const final
 Get the implementation volume ID.
 
bool is_outside () const final
 Whether the track is outside the valid geometry region.
 
bool failed () const final
 Whether the last operation resulted in an error.
 
bool is_on_boundary () const final
 Whether the track is exactly on a surface.
 
Real3 normal () const final
 Calculate the normal vector on the current surface.
 
real_type find_safety () final
 Calculate the safety distance.
 
real_type find_safety (real_type max_safety) final
 Calculate the safety distance up to a given length.
 
void set_dir (Real3 const &) final
 Set the direction.
 
Propagation find_next_step () final
 Find the distance to the next boundary.
 
Propagation find_next_step (real_type max_distance) final
 Find the distance to the next boundary.
 
void move_internal (real_type) final
 Move within the volume along the current direction.
 
void move_internal (Real3 const &pos) final
 Move within the volume to a nearby position.
 
void move_to_boundary () final
 Move to the next boundary.
 
void cross_boundary () final
 Move to the next boundary.
 
- Public Member Functions inherited from celeritas::GeoTrackInterface< real_type >
virtual ~GeoTrackInterface ()=0
 Default virtual destructor.
 
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 real_type find_safety (real_type max_step)=0
 Find the safety at the current position, up to a maximum step distance.
 

Static Public Member Functions

static constexpr real_type safety_tol ()
 Check volume consistency this far from the boundary.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::GeoTrackInterface< real_type >
 CELER_DEFAULT_COPY_MOVE (GeoTrackInterface)
 

Detailed Description

Check validity of safety and volume crossings while navigating on CPU.

Also count the number of calls to "find distance" and "find safety".

This wraps a GeoTrackInterface and adds validation and instrumentation.

Member Function Documentation

◆ cross_boundary()

void celeritas::test::CheckedGeoTrackView::cross_boundary ( )
finalvirtual

Move to the next boundary.

Implements celeritas::GeoTrackInterface< real_type >.

◆ dir()

Real3 const & celeritas::test::CheckedGeoTrackView::dir ( ) const
inlinefinalvirtual

Return the direction in the global coordinate system.

Implements celeritas::GeoTrackInterface< real_type >.

◆ failed()

bool celeritas::test::CheckedGeoTrackView::failed ( ) const
inlinefinalvirtual

Whether the last operation resulted in an error.

Implements celeritas::GeoTrackInterface< real_type >.

◆ find_next_step()

Propagation celeritas::test::CheckedGeoTrackView::find_next_step ( )
finalvirtual

Find the distance to the next boundary.

Implements celeritas::GeoTrackInterface< real_type >.

◆ find_safety()

real_type celeritas::test::CheckedGeoTrackView::find_safety ( )
finalvirtual

Calculate the safety distance.

Implements celeritas::GeoTrackInterface< real_type >.

◆ impl_volume_id()

ImplVolumeId celeritas::test::CheckedGeoTrackView::impl_volume_id ( ) const
inlinefinalvirtual

Get the implementation volume ID.

Implements celeritas::GeoTrackInterface< real_type >.

◆ is_on_boundary()

bool celeritas::test::CheckedGeoTrackView::is_on_boundary ( ) const
inlinefinalvirtual

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.

Implements celeritas::GeoTrackInterface< real_type >.

◆ is_outside()

bool celeritas::test::CheckedGeoTrackView::is_outside ( ) const
inlinefinalvirtual

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).

Implements celeritas::GeoTrackInterface< real_type >.

◆ move_internal()

void celeritas::test::CheckedGeoTrackView::move_internal ( Real3 const pos)
finalvirtual

Move within the volume to a nearby position.

Implements celeritas::GeoTrackInterface< real_type >.

◆ move_to_boundary()

void celeritas::test::CheckedGeoTrackView::move_to_boundary ( )
finalvirtual

Move to the next boundary.

Implements celeritas::GeoTrackInterface< real_type >.

◆ normal()

Real3 celeritas::test::CheckedGeoTrackView::normal ( ) const
inlinefinalvirtual

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.

Implements celeritas::GeoTrackInterface< real_type >.

◆ operator=()

CheckedGeoTrackView & celeritas::test::CheckedGeoTrackView::operator= ( GeoTrackInitializer const init)
finalvirtual

Initialize the state.

Implements celeritas::GeoTrackInterface< real_type >.

◆ pos()

Real3 const & celeritas::test::CheckedGeoTrackView::pos ( ) const
inlinefinalvirtual

Return the direction in the global coordinate system.

Implements celeritas::GeoTrackInterface< real_type >.

◆ set_dir()

void celeritas::test::CheckedGeoTrackView::set_dir ( Real3 const newdir)
finalvirtual

Set the direction.

Implements celeritas::GeoTrackInterface< real_type >.

◆ volume_id()

VolumeId celeritas::test::CheckedGeoTrackView::volume_id ( ) const
inlinefinalvirtual

Get the physical volume ID in the current cell.

Implements celeritas::GeoTrackInterface< real_type >.

◆ volume_instance_id() [1/2]

VolumeInstanceId celeritas::test::CheckedGeoTrackView::volume_instance_id ( ) const
inlinefinalvirtual

Get the physical volume ID in the current cell.

Implements celeritas::GeoTrackInterface< real_type >.

◆ volume_instance_id() [2/2]

void celeritas::test::CheckedGeoTrackView::volume_instance_id ( Span< VolumeInstanceId levels) const
inlinefinalvirtual

Get the volume instance ID for all levels.

Implements celeritas::GeoTrackInterface< real_type >.

◆ volume_level()

VolumeLevelId celeritas::test::CheckedGeoTrackView::volume_level ( ) const
inlinefinalvirtual

Get the distance from root volume in the geometry hierarchy.

Implements celeritas::GeoTrackInterface< real_type >.


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