Celeritas 0.7.0-dev.245+develop.a7be925e
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
celeritas::VolumeView Class Reference

Access data about a single implementation volume. More...

#include <VolumeView.hh>

Public Types

using ParamsRef = NativeCRef< OrangeParamsData >
 Type aliases.
 

Public Member Functions

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

Detailed Description

Access data about a single implementation 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()

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

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: