EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
EBGeometry::SurfaceInventory Class Reference

What an expression's index says about its surfaces, kept for checking surface groups against them without the index: each surface's shape (leaf), each shape's parts and their labels, the pairs of regions each may separate, and each region's material. More...

#include <EBGeometry_SurfacePieces.hpp>

Public Member Functions

 SurfaceInventory ()=default
 An empty inventory: no surfaces.
 
template<class T >
 SurfaceInventory (const ExprIndex< T > &a_index)
 The inventory of an expression's index.
 
std::vector< SurfaceLevel > levelsOf (const uint32_t a_surface) const
 The levels a surface belongs to, innermost first: the surface (when it is one member of a collection, a sphere of a cloud), its shape, then each node up to the root, the whole object. Nested nodes covering the same surfaces (a translated box, a labeled union) are one level, the outermost node's. Each level covers a contiguous range of surfaces, and contains the one before it.
 
uint32_t getNumSurfaces () const noexcept
 How many surfaces there are.
 
uint32_t getLeaf (const uint32_t a_surface) const
 A surface's shape.
 
uint32_t getNumParts (const uint32_t a_surface) const
 How many parts a surface's shape has (ExprIndex::getNumPartsOfLeaf()): 0 for a collection's member.
 
SurfaceLabelId getLabel (const uint32_t a_surface, const uint32_t a_part) const
 A part's surface label: its face group's, or its shape's.
 
bool hasPartLabels (const uint32_t a_surface) const
 Whether a surface's parts have labels of their own (face groups).
 
const std::vector< std::pair< uint32_t, uint32_t > > & getSides (const uint32_t a_surface) const
 The pairs of regions a surface may separate, smaller region first.
 
MaterialLabelId getMaterial (const uint32_t a_region) const noexcept
 A region's material.
 

Detailed Description

What an expression's index says about its surfaces, kept for checking surface groups against them without the index: each surface's shape (leaf), each shape's parts and their labels, the pairs of regions each may separate, and each region's material.

Host only. Built from ExprIndex (from the expression alone, no geometry), so it holds every surface and every pair of regions a surface may separate (ExprIndex::getSidesOfLeaf(), conservative: some pairs listed may not meet).

Constructor & Destructor Documentation

◆ SurfaceInventory()

template<class T >
EBGeometry::SurfaceInventory::SurfaceInventory ( const ExprIndex< T > &  a_index)
inlineexplicit

The inventory of an expression's index.

Template Parameters
TFloating-point precision.
Parameters
[in]a_indexThe index.

Member Function Documentation

◆ getLabel()

SurfaceLabelId EBGeometry::SurfaceInventory::getLabel ( const uint32_t  a_surface,
const uint32_t  a_part 
) const
inline

A part's surface label: its face group's, or its shape's.

Parameters
[in]a_surfaceThe surface.
[in]a_partThe part.
Returns
The label, or none.

◆ getLeaf()

uint32_t EBGeometry::SurfaceInventory::getLeaf ( const uint32_t  a_surface) const
inline

A surface's shape.

Parameters
[in]a_surfaceThe surface (below getNumSurfaces()).
Returns
Its leaf.

◆ getMaterial()

MaterialLabelId EBGeometry::SurfaceInventory::getMaterial ( const uint32_t  a_region) const
inlinenoexcept

A region's material.

Parameters
[in]a_regionThe region.
Returns
Its material label, or none.

◆ getNumParts()

uint32_t EBGeometry::SurfaceInventory::getNumParts ( const uint32_t  a_surface) const
inline

How many parts a surface's shape has (ExprIndex::getNumPartsOfLeaf()): 0 for a collection's member.

Parameters
[in]a_surfaceThe surface.
Returns
The count.

◆ getNumSurfaces()

uint32_t EBGeometry::SurfaceInventory::getNumSurfaces ( ) const
inlinenoexcept

How many surfaces there are.

Returns
The count.

◆ getSides()

const std::vector< std::pair< uint32_t, uint32_t > > & EBGeometry::SurfaceInventory::getSides ( const uint32_t  a_surface) const
inline

The pairs of regions a surface may separate, smaller region first.

Parameters
[in]a_surfaceThe surface.
Returns
The pairs.

◆ hasPartLabels()

bool EBGeometry::SurfaceInventory::hasPartLabels ( const uint32_t  a_surface) const
inline

Whether a surface's parts have labels of their own (face groups).

Parameters
[in]a_surfaceThe surface.
Returns
True if they do.

◆ levelsOf()

std::vector< SurfaceLevel > EBGeometry::SurfaceInventory::levelsOf ( const uint32_t  a_surface) const
inline

The levels a surface belongs to, innermost first: the surface (when it is one member of a collection, a sphere of a cloud), its shape, then each node up to the root, the whole object. Nested nodes covering the same surfaces (a translated box, a labeled union) are one level, the outermost node's. Each level covers a contiguous range of surfaces, and contains the one before it.

Parameters
[in]a_surfaceThe surface (below getNumSurfaces()).
Returns
The levels; empty for an inventory built without an index.

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