template<class Real>
struct peclet::voro::SdfGrid< Real >
Device-resident sampled SDF (trilinear; x-fastest), the universal provider for analytic-baked or VTI geometry.
DELEGATES to peclet::core::geom::sampleGrid, the suite's single trilinear grid-SDF routine (Layer 0). The descriptor is held as a MEMBER, built once by fromSpacing() – building it per call inside the sampler is what shifted nvcc's FMA contraction in dem's rung-3 port. The extension policy is kClamp: the field flattens at the box face, which is what this provider has always done (dem's kObject/kContainer residual policies are for bodies and containers whose far field must keep growing).
NOTE the shared routine multiplies by an inverse spacing where this body used to divide by spacing, so the last bit of an off-lattice sample can differ. Inert in practice: nothing in voro constructed an SdfGrid – it was a provider written ahead of its first consumer.
template<class Real >
| static KOKKOS_INLINE_FUNCTION SdfGrid peclet::voro::SdfGrid< Real >::fromSpacing |
( |
Kokkos::View< const float *, peclet::core::MemSpace > |
v, |
|
|
int |
nx, |
|
|
int |
ny, |
|
|
int |
nz, |
|
|
Real |
ox, |
|
|
Real |
oy, |
|
|
Real |
oz, |
|
|
Real |
sx, |
|
|
Real |
sy, |
|
|
Real |
sz |
|
) |
| |
|
inlinestatic |
Build from the natural (origin, spacing) description; inverts the spacing once, here.
CALL THIS AT SETUP, on the host, and pass the resulting provider into the kernel by value – that is the whole point of caching the descriptor (see the rung-3 FMA note in docs/ANALYTIC_SDF_GEOMETRY.md). It is marked device-callable only so that calling it in the wrong place is a performance mistake rather than a silent one: without the annotation nvcc accepts a host function inside a device lambda WITHOUT error and quietly corrupts the kernel.