Celeritas
0.5.0-56+6b053cd
|
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 ¶ms, 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. | |
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.
|
inline |
Find the face ID of a surface.
This is an O(log(num_faces)) operation.
|
inline |
Get the surface ID for a single face.
This is an O(1) operation.