|
Celeritas 0.7.0-dev.169+develop.bdc0041f6
|
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 GeoTrackInterface & | operator= (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 const & | pos () const =0 |
| Return the direction in the global coordinate system. | |
| virtual Real3 const & | dir () 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) | |
Standard interface to geometry navigation for a track for testing on CPU.
| RealType | Floating point precision |
CELERITAS_CORE_GEO configuration variable and defined as a type alias celeritas::CoreGeoTrackView .Initialization is performed via the assignment operator using a GeoTrackInitializer.
failed flag can be set if initialization encountered an error, which is usually due to the user geometry definition.is_outside will be set.Tracking to and across volumes along a straight line requires a specific sequence of calls.
find_next_step.move_internal or move_to_boundary.normal can be used to calculate the current surface normal.cross_boundary. This may cause the particle to leave the geometry, or result in an error that will set the failed 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:
find_safety.set_dir. (Note that this will always invalidate the linear "next step".)move_internal.
|
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 >.
|
pure virtual |
Return the direction in the global coordinate system.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
|
pure virtual |
Whether the last operation resulted in an error.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
|
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 >.
|
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 >.
|
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 >.
|
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 >.
|
pure virtual |
Get the implementation volume ID.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
|
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 >.
|
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 >.
|
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 >.
|
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).
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 >.
|
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 >.
|
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 >.
|
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 >.
|
pure virtual |
Return the direction in the global coordinate system.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
Change direction.
Changes the direction of the track (in global coordinate system).
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
|
pure virtual |
Get the physical volume ID in the current cell.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
|
pure virtual |
Get the physical volume ID in the current cell.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
|
pure virtual |
Get the volume instance ID for all levels.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.
|
pure virtual |
Get the distance from root volume in the geometry hierarchy.
Implemented in celeritas::test::CheckedGeoTrackView, and celeritas::test::WrappedGeoTrackView< GTV >.