peclet.voro 1.0.4
Device-native moving-particle Voronoi dynamics
Loading...
Searching...
No Matches
peclet::voro::SdfGrid< Real > Struct Template Reference

#include <sdf.hpp>

Public Member Functions

KOKKOS_INLINE_FUNCTION Real eval (Real x, Real y, Real z) const
 
KOKKOS_INLINE_FUNCTION Real gradH () const
 

Static Public Member Functions

static KOKKOS_INLINE_FUNCTION SdfGrid 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)
 

Public Attributes

Kokkos::View< const float *, peclet::core::MemSpace > values
 
peclet::core::geom::GridDesc< Real > desc {}
 

Detailed Description

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.

Member Function Documentation

◆ eval()

template<class Real >
KOKKOS_INLINE_FUNCTION Real peclet::voro::SdfGrid< Real >::eval ( Real  x,
Real  y,
Real  z 
) const
inline

◆ fromSpacing()

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.

◆ gradH()

template<class Real >
KOKKOS_INLINE_FUNCTION Real peclet::voro::SdfGrid< Real >::gradH ( ) const
inline

Member Data Documentation

◆ desc

template<class Real >
peclet::core::geom::GridDesc<Real> peclet::voro::SdfGrid< Real >::desc {}

◆ values

template<class Real >
Kokkos::View<const float*, peclet::core::MemSpace> peclet::voro::SdfGrid< Real >::values

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