EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
EBGeometry::PointCloudDetail::SpherePrimitive< T, W > Struct Template Reference

The primitive of SphereCloudBVH: a sphere, keyed at its center and packed into SphereAoSoA groups; see PointPrimitive. More...

#include <EBGeometry_SphereCloudBVH.hpp>

Public Types

using Item = SphereCloud::Sphere< T >
 What the source returns: a sphere.
 
using Group = SphereAoSoA< T, W >
 The leaf group.
 
using FromArray = SphereCloud::FromArray< T >
 The source reading an array of primitives.
 

Static Public Member Functions

static const Vec3T< T > & center (const Item &a_item) noexcept
 The point a sphere's Morton key is taken at.
 
static void grow (Vec3T< T > &a_lo, Vec3T< T > &a_hi, const Item &a_item) noexcept
 Grow a box to hold a sphere.
 
static void requireValid (const char *a_who, const std::vector< Item > &a_items) noexcept
 Abort with a message unless the spheres of a host array can be built over: a finite center, and a finite radius of at least 0.
 
template<class Source >
static void requireValidWhereBuilt (const Source &a_source, const uint32_t a_numItems, const bool a_parallel, Vec3T< T > *a_scratch, const char *a_who) noexcept
 Check every radius, where the build runs: finite, and at least 0.
 

Static Public Attributes

static constexpr const char * ClassName = "SphereCloudBVH"
 The class built over these primitives, for the messages.
 
static constexpr const char * Singular = "sphere"
 One primitive, for the messages.
 
static constexpr const char * Plural = "spheres"
 Primitives, for the messages.
 
static constexpr const char * MaxParameter = "a_maxSpheres"
 build()'s parameter giving the room for a rebuild, for the messages.
 

Detailed Description

template<class T, size_t W>
struct EBGeometry::PointCloudDetail::SpherePrimitive< T, W >

The primitive of SphereCloudBVH: a sphere, keyed at its center and packed into SphereAoSoA groups; see PointPrimitive.

Internal; not part of the public API.

Template Parameters
TFloating-point precision.
WSpheres per group.

Member Function Documentation

◆ center()

template<class T , size_t W>
static const Vec3T< T > & EBGeometry::PointCloudDetail::SpherePrimitive< T, W >::center ( const Item &  a_item)
inlinestaticnoexcept

The point a sphere's Morton key is taken at.

Parameters
[in]a_itemThe sphere.
Returns
Its center.

◆ grow()

template<class T , size_t W>
static void EBGeometry::PointCloudDetail::SpherePrimitive< T, W >::grow ( Vec3T< T > &  a_lo,
Vec3T< T > &  a_hi,
const Item &  a_item 
)
inlinestaticnoexcept

Grow a box to hold a sphere.

Parameters
[in,out]a_loThe box's lower corner.
[in,out]a_hiThe box's upper corner.
[in]a_itemThe sphere.

◆ requireValid()

template<class T , size_t W>
static void EBGeometry::PointCloudDetail::SpherePrimitive< T, W >::requireValid ( const char *  a_who,
const std::vector< Item > &  a_items 
)
inlinestaticnoexcept

Abort with a message unless the spheres of a host array can be built over: a finite center, and a finite radius of at least 0.

Parameters
[in]a_whoThe calling function, for the message.
[in]a_itemsThe spheres.

◆ requireValidWhereBuilt()

template<class T , size_t W>
template<class Source >
static void EBGeometry::PointCloudDetail::SpherePrimitive< T, W >::requireValidWhereBuilt ( const Source &  a_source,
const uint32_t  a_numItems,
const bool  a_parallel,
Vec3T< T > *  a_scratch,
const char *  a_who 
)
inlinestaticnoexcept

Check every radius, where the build runs: finite, and at least 0.

The centers are checked with the box of the centers. Through GPU::parallelFor(), the smallest radius and whether every radius is finite come from GPU::boundingBoxOf(), and a bad one is reported as "a sphere"; on the host, it is reported by its index.

One of three checks of a sphere, each for one way in: this one for every build from a source, where the build runs; requireValid() for a host array headed to a build through GPU::parallelFor(), so that a bad sphere is still named by its index; and SphereAoSoA::pack() for a group packed by hand.

Template Parameters
SourceThe spheres' source.
Parameters
[in]a_sourceThe spheres.
[in]a_numItemsNumber of spheres.
[in]a_parallelWhether the build runs through GPU::parallelFor().
[in]a_scratchGPU::boundingBoxScratchSize(a_numItems) elements, for a build through GPU::parallelFor().
[in]a_whoThe calling function, for the message.

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