Celeritas 0.7+cf8d83d
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
celeritas::VolumeParams Class Referencefinal

Define and manage a hierarchy of volumes and instances thereof. More...

#include <VolumeParams.hh>

Inheritance diagram for celeritas::VolumeParams:
Inheritance graph
[legend]

Public Types

using vol_level_uint = VolumeLevelId::size_type
 
Type aliases
using VolumeMap = LabelIdMultiMap< VolumeId >
 
using VolInstMap = LabelIdMultiMap< VolumeInstanceId >
 
using SpanVolInst = Span< VolumeInstanceId const >
 
VolumeVisitor template interface
using VolumeRef = VolumeId
 
using VolumeInstanceRef = VolumeInstanceId
 
- Public Types inherited from celeritas::ParamsDataInterface< VolumeParamsData >
using HostRef = HostCRef< VolumeParamsData >
 
using DeviceRef = DeviceCRef< VolumeParamsData >
 

Public Member Functions

 VolumeParams (inp::Volumes const &)
 Construct from input.
 
 VolumeParams ()
 Construct with no volumes, often for unit testing.
 
 VolumeParams (VolumeParams const &)=delete
 
VolumeParamsoperator= (VolumeParams const &)=delete
 
 VolumeParams (VolumeParams &&)=default
 
VolumeParamsoperator= (VolumeParams &&)=default
 
bool empty () const
 Empty if no volumes are present (e.g., ORANGE debugging)
 
VolumeId world () const
 World volume.
 
VolumeInstanceId world_instance () const
 Enclosing instance of the world volume (null if world is a true root).
 
VolumeId::size_type num_volumes () const
 Depth of the volume DAG.
 
VolumeInstanceId::size_type num_volume_instances () const
 Number of volume instances.
 
VolumeUniqueInstanceId::size_type num_unique_instances () const
 Total number of unique root-to-node paths (= num_desc of the world volume).
 
vol_level_uint num_volume_levels () const
 Depth of the volume DAG.
 
VolumeMap constvolume_labels () const
 Get volume metadata.
 
VolInstMap constvolume_instance_labels () const
 
AllVolumesView view () const
 Construct a device-compatible view of all volume data.
 
VolumeView get (VolumeId v_id) const
 Construct a lightweight view for accessing volume properties.
 
SpanVolInst children (VolumeId v_id) const
 Get the child instance edges from a volume.
 
VolumeId volume (VolumeInstanceId vi_id) const
 Get the volume being instantiated (outgoing node).
 
VolumeUniqueInstanceId::size_type offset (VolumeInstanceId vi_id) const
 Get the precomputed unique-instance offset for a volume instance.
 
SpanVolInst parents (VolumeId v_id) const
 
GeoMatId material (VolumeId v_id) const
 
Data interface
HostRef consthost_ref () const final
 Access volume graph data on the host.
 
DeviceRef constdevice_ref () const final
 Access volume graph data on the device.
 
- Public Member Functions inherited from celeritas::ParamsDataInterface< VolumeParamsData >
VolumeParamsData< Ownership::const_reference, M > const & ref () const
 
VolumeParamsData< Ownership::const_reference, M > const & ref () const
 Dispatch a "ref" call to host or device data.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::ParamsDataInterface< VolumeParamsData >
 ParamsDataInterface (ParamsDataInterface const &)=default
 
 ParamsDataInterface (ParamsDataInterface &&)=default
 
ParamsDataInterfaceoperator= (ParamsDataInterface const &)=default
 
ParamsDataInterfaceoperator= (ParamsDataInterface &&)=default
 

Detailed Description

Define and manage a hierarchy of volumes and instances thereof.

See the introduction to the Geometry API section (api_geometry in user manual) for a detailed description of volumes in the detector geometry description. This class abstracts the graph of user-defined volumes, relating nodes (VolumeId, aka logical volume) to edges (VolumeInstanceId, aka physical volume) and providing the means to determine the path (isomorphic to a VolumeUniqueInstanceId, aka touchable history) of a track state. The root of the graph is the world volume, and the level of a volume in the path is the distance to the root: zero for the root volume, one for its direct child, etc. The maximum value of the level in any path is one less than num_volume_levels : an array of VolumeInstanceId with that size can represent any path. (When explicitly constructing this array, we omit the world volume since it is implicit.) The total number of paths to any node in the geometry is num_unique_instances .

In conjunction with GeantGeoParams, this class allows conversion between the Celeritas geometry implementation and the Geant4 geometry navigation.

Label-based lookup (volume and volume instance names) is provided through the volume_labels and volume_instance_labels accessors. Graph properties (material, connectivity, world) are stored in the underlying VolumeParamsData and accessed efficiently via VolumeView.

Construction requirements:

Member Function Documentation

◆ device_ref()

DeviceRef const & celeritas::VolumeParams::device_ref ( ) const
inlinefinalvirtual

Access volume graph data on the device.

Implements celeritas::ParamsDataInterface< VolumeParamsData >.

◆ host_ref()

HostRef const & celeritas::VolumeParams::host_ref ( ) const
inlinefinalvirtual

Access volume graph data on the host.

Implements celeritas::ParamsDataInterface< VolumeParamsData >.

◆ material()

GeoMatId celeritas::VolumeParams::material ( VolumeId  v_id) const
inline
Deprecated:
Use get instead

◆ offset()

auto celeritas::VolumeParams::offset ( VolumeInstanceId  vi_id) const
inline

Get the precomputed unique-instance offset for a volume instance.

This is the sum of num_desc(volume(vj)) for all preceding sibling instances in the same parent volume's children list.

◆ parents()

auto celeritas::VolumeParams::parents ( VolumeId  v_id) const
inline
Deprecated:
Use get instead

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