Celeritas 0.6.0-67+develop.47f47c88
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::VolumeSurfaceView Class Reference

Access surface properties attached to a volume. More...

#include <VolumeSurfaceView.hh>

Public Types

Type aliases
using SurfaceParamsRef = NativeCRef< SurfaceParamsData >
 

Public Member Functions

CELER_FUNCTION VolumeSurfaceView (SurfaceParamsRef const &params, VolumeId id)
 Construct from surface parameters and volume ID.
 
CELER_FORCEINLINE_FUNCTION VolumeId volume_id () const
 Get the volume ID being viewed.
 
CELER_FORCEINLINE_FUNCTION SurfaceId boundary_id () const
 Get the optional boundary surface ID for this volume.
 
CELER_FORCEINLINE_FUNCTION bool has_interface () const
 Check if this volume has at least one interface surface.
 
CELER_FUNCTION SurfaceId find_interface (VolumeInstanceId pre_id, VolumeInstanceId post_id) const
 Find the surface ID for a transition between volume instances.
 

Detailed Description

Access surface properties attached to a volume.

This class provides a view into surface data for a specific volume, usually an exiting volume, allowing access to its optional boundary surfaces (surrounding the entire volume) and optional interface surfaces to an adjacent volume.

Member Function Documentation

◆ boundary_id()

CELER_FUNCTION SurfaceId celeritas::VolumeSurfaceView::boundary_id ( ) const

Get the optional boundary surface ID for this volume.

If the result is null, no boundary surface is present.

◆ find_interface()

CELER_FUNCTION SurfaceId celeritas::VolumeSurfaceView::find_interface ( VolumeInstanceId  pre_id,
VolumeInstanceId  post_id 
) const
inline

Find the surface ID for a transition between volume instances.

This searches for the surface ID associated with a pre->post volume instance transition.

Todo:
The current implementation uses linear search, which is unsuitable for complex detectors such as LHCB's RICH, whose pvRichGrandPMTQuartz has 770 specific interfaces. We should either implement an equal_range function for searching these sorted arrays, or (better) use a hash lookup for {pre, post} -> surface.
Returns
The surface ID if found, or an invalid ID if not found.

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