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

The Morton grid over a box: a point's cell is (p / 2 - lo / 2) * scale, clamped to [0, SFC::ValidSpan]. More...

#include <EBGeometry_SFC.hpp>

Public Member Functions

MortonKey key (const Vec3T< T > &a_point, const uint32_t a_index) const noexcept
 A point's key.
 

Static Public Member Functions

static MortonGrid over (const Vec3T< T > &a_lo, const Vec3T< T > &a_hi) noexcept
 The grid over a box.
 

Public Attributes

Vec3T< T > m_halfLo
 Half the box's lower corner.
 
T m_scale
 Cells per unit of halved length (0 for a box of one point).
 

Detailed Description

template<class T>
struct EBGeometry::SFCDetail::MortonGrid< T >

The Morton grid over a box: a point's cell is (p / 2 - lo / 2) * scale, clamped to [0, SFC::ValidSpan].

Cubic cells, the box's longest side spanning the grid. The coordinates are halved before subtracting, so that a box wider than the largest finite value of T still has a finite extent; halving is exact, so the host and a device compute the same cells.

Template Parameters
TFloating-point precision.

Member Function Documentation

◆ key()

template<class T >
MortonKey EBGeometry::SFCDetail::MortonGrid< T >::key ( const Vec3T< T > &  a_point,
const uint32_t  a_index 
) const
inlinenoexcept

A point's key.

Parameters
[in]a_pointThe point; finite.
[in]a_indexIts index.
Returns
The key.

◆ over()

template<class T >
static MortonGrid EBGeometry::SFCDetail::MortonGrid< T >::over ( const Vec3T< T > &  a_lo,
const Vec3T< T > &  a_hi 
)
inlinestaticnoexcept

The grid over a box.

Parameters
[in]a_loThe box's lower corner.
[in]a_hiThe box's upper corner.
Returns
The grid.

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