Celeritas 0.7.0-dev.169+develop.bdc0041f6
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::test::WrappedGeoTrackView< GTV > Class Template Referencefinal

Wrap a track view for CPU testing and interface validation. More...

#include <WrappedGeoTrackView.hh>

Inheritance diagram for celeritas::test::WrappedGeoTrackView< GTV >:
Inheritance graph
[legend]

Public Types

Type aliases
using GeoTrackViewT = GTV
 
using Initializer_t = GeoTrackInitializer
 
using real_type = typename GTV::real_type
 
using Real3 = typename GeoTrackInterface< typename GTV::real_type >::Real3
 
- Public Types inherited from celeritas::GeoTrackInterface< GTV::real_type >
using Initializer_t = GeoTrackInitializer
 
using real_type = GTV::real_type
 
using Real3 = Array< real_type, 3 >
 

Public Member Functions

template<class... Args>
 WrappedGeoTrackView (Args &&... args)
 Forward construction arguments to the original track view.
 
 CELER_DEFAULT_MOVE_DELETE_COPY (WrappedGeoTrackView)
 
GTV consttrack_view () const
 Access the underlying track view.
 
GTVtrack_view ()
 Access the underlying track view.
 
WrappedGeoTrackViewoperator= (Initializer_t 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.
 
Propagation find_next_step () final
 Find the distance to the next boundary (infinite max).
 
Propagation find_next_step (real_type max_step) final
 Find the distance to the next boundary, up to and including a step.
 
void move_internal (real_type step) final
 Move within the volume.
 
void move_to_boundary () final
 Move to the boundary in preparation for crossing it.
 
void cross_boundary () final
 Cross from one side of the current surface to the other.
 
real_type find_safety () final
 Find the safety distance at the current position.
 
real_type find_safety (real_type max_step) final
 Find the safety at the current position, up to a maximum step distance.
 
void set_dir (Real3 const &newdir) final
 Change direction.
 
void move_internal (Real3 const &pos) final
 Move within the volume to a specific point.
 
- Public Member Functions inherited from celeritas::GeoTrackInterface< GTV::real_type >
virtual ~GeoTrackInterface ()=0
 Default virtual destructor.
 

Additional Inherited Members

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

Detailed Description

template<class GTV>
class celeritas::test::WrappedGeoTrackView< GTV >

Wrap a track view for CPU testing and interface validation.

Note
This uses composition to wrap the parent track view and exposes it through the virtual interface for C++ testing.

Member Function Documentation

◆ cross_boundary()

template<class GTV >
void celeritas::test::WrappedGeoTrackView< GTV >::cross_boundary ( )
inlinefinalvirtual

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

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

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ dir()

template<class GTV >
Real3 const & celeritas::test::WrappedGeoTrackView< GTV >::dir ( ) const
inlinefinalvirtual

Return the direction in the global coordinate system.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ failed()

template<class GTV >
bool celeritas::test::WrappedGeoTrackView< GTV >::failed ( ) const
inlinefinalvirtual

Whether the last operation resulted in an error.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ find_next_step() [1/2]

template<class GTV >
Propagation celeritas::test::WrappedGeoTrackView< GTV >::find_next_step ( )
inlinefinalvirtual

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.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ find_next_step() [2/2]

template<class GTV >
Propagation celeritas::test::WrappedGeoTrackView< GTV >::find_next_step ( real_type  max_step)
inlinefinalvirtual

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.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ find_safety() [1/2]

template<class GTV >
real_type celeritas::test::WrappedGeoTrackView< GTV >::find_safety ( )
inlinefinalvirtual

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

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ find_safety() [2/2]

template<class GTV >
real_type celeritas::test::WrappedGeoTrackView< GTV >::find_safety ( real_type  max_step)
inlinefinalvirtual

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

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

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ impl_volume_id()

template<class GTV >
ImplVolumeId celeritas::test::WrappedGeoTrackView< GTV >::impl_volume_id ( ) const
inlinefinalvirtual

Get the implementation volume ID.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ is_on_boundary()

template<class GTV >
bool celeritas::test::WrappedGeoTrackView< GTV >::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< GTV::real_type >.

◆ is_outside()

template<class GTV >
bool celeritas::test::WrappedGeoTrackView< GTV >::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< GTV::real_type >.

◆ move_internal() [1/2]

template<class GTV >
void celeritas::test::WrappedGeoTrackView< GTV >::move_internal ( Real3 const pos)
inlinefinalvirtual

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

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ move_internal() [2/2]

template<class GTV >
void celeritas::test::WrappedGeoTrackView< GTV >::move_internal ( real_type  step)
inlinefinalvirtual

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.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ move_to_boundary()

template<class GTV >
void celeritas::test::WrappedGeoTrackView< GTV >::move_to_boundary ( )
inlinefinalvirtual

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.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ normal()

template<class GTV >
Real3 celeritas::test::WrappedGeoTrackView< GTV >::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< GTV::real_type >.

◆ operator=()

Initialize the state.

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

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ pos()

template<class GTV >
Real3 const & celeritas::test::WrappedGeoTrackView< GTV >::pos ( ) const
inlinefinalvirtual

Return the direction in the global coordinate system.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ set_dir()

template<class GTV >
void celeritas::test::WrappedGeoTrackView< GTV >::set_dir ( Real3 const newdir)
inlinefinalvirtual

Change direction.

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

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ volume_id()

template<class GTV >
VolumeId celeritas::test::WrappedGeoTrackView< GTV >::volume_id ( ) const
inlinefinalvirtual

Get the physical volume ID in the current cell.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ volume_instance_id() [1/2]

template<class GTV >
VolumeInstanceId celeritas::test::WrappedGeoTrackView< GTV >::volume_instance_id ( ) const
inlinefinalvirtual

Get the physical volume ID in the current cell.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ volume_instance_id() [2/2]

template<class GTV >
void celeritas::test::WrappedGeoTrackView< GTV >::volume_instance_id ( Span< VolumeInstanceId levels) const
inlinefinalvirtual

Get the volume instance ID for all levels.

Implements celeritas::GeoTrackInterface< GTV::real_type >.

◆ volume_level()

template<class GTV >
VolumeLevelId celeritas::test::WrappedGeoTrackView< GTV >::volume_level ( ) const
inlinefinalvirtual

Get the distance from root volume in the geometry hierarchy.

Implements celeritas::GeoTrackInterface< GTV::real_type >.


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