Celeritas  0.5.0-56+6b053cd
Public Types | Public Member Functions | List of all members
celeritas::VolumeView Class Reference

Access data about a single volume. More...

#include <VolumeView.hh>

Public Types

using ParamsRef = NativeCRef< OrangeParamsData >
 Type aliases.
 

Public Member Functions

CELER_FUNCTION VolumeView (ParamsRef const &params, SimpleUnitRecord const &unit_record, LocalVolumeId id)
 Construct with reference to persistent data.
 
CELER_FORCEINLINE_FUNCTION FaceId::size_type num_faces () const
 Number of surfaces bounding this volume.
 
CELER_FUNCTION LocalSurfaceId get_surface (FaceId id) const
 Get the surface ID for a single face. More...
 
CELER_FUNCTION FaceId find_face (LocalSurfaceId id) const
 Find the face ID of a surface. More...
 
CELER_FORCEINLINE_FUNCTION LdgSpan< LocalSurfaceId const > faces () const
 Get all the surface IDs corresponding to the faces of this volume.
 
CELER_FORCEINLINE_FUNCTION LdgSpan< logic_int const > logic () const
 Get logic definition.
 
CELER_FORCEINLINE_FUNCTION logic_int max_intersections () const
 Get the maximum number of surface intersections.
 
CELER_FORCEINLINE_FUNCTION bool internal_surfaces () const
 Whether the volume has internal surface crossings.
 
CELER_FORCEINLINE_FUNCTION bool implicit_vol () const
 Whether the volume is an "implicit complement".
 
CELER_FORCEINLINE_FUNCTION bool simple_safety () const
 Whether the safety distance can be calculated with the simple algorithm.
 
CELER_FORCEINLINE_FUNCTION bool simple_intersection () const
 Whether the intersection is the closest interior surface.
 

Detailed Description

Access data about a single volume.

A volume is a CSG tree of surfaces. The sorted, unique surface IDs comprising the volume are "faces" and can be indexed as part of this volume using the FaceId.

Each surface defines an "inside" space and "outside" space that correspond to "negative" and "positive" values of the quadric expression's evaluation. Left of a plane is negative, for example, and evaluates to "false" or "inside" or "negative". The CSG tree is encoded into a vector of Reverse Polish Notation-type operations (push, negate, and, or) that is evaluated at tracking time to determine whether a particle is inside the volume. The encoded set of operations is the logic accessor.

Member Function Documentation

◆ find_face()

CELER_FUNCTION FaceId celeritas::VolumeView::find_face ( LocalSurfaceId  surface) const
inline

Find the face ID of a surface.

  • A non-empty surface ID that's among the faces in this volume will return the face ID, which is just the index of the surface ID in the list of local faces.
  • If the given surface is not present in the volume, the result will be false.

This is an O(log(num_faces)) operation.

◆ get_surface()

CELER_FUNCTION LocalSurfaceId celeritas::VolumeView::get_surface ( FaceId  id) const
inline

Get the surface ID for a single face.

This is an O(1) operation.


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