|
peclet.voro 1.0.0
Device-native moving-particle Voronoi dynamics
|
peclet.voro computes and dynamically maintains the 3D Voronoi tessellation of a set of moving points in a periodic box, on the device path (Kokkos: Serial / OpenMP / CUDA / HIP — one source, the backend fixed at build time), with optional MPI domain decomposition. It is built around a compact, register-resident cell representation and an incremental repair update that makes per-step tessellation of moving points several times cheaper than rebuilding.
The retired half-edge CPU engine has been removed; everything below is the device path.
A Voronoi cell is the intersection of half-spaces (one per neighbour, plus the box). Rather than an explicit half-edge mesh, peclet.voro stores the cell in the dual (peclet::voro::ConvexCell, see convex_cell.hpp): each primal vertex is the intersection of three planes, kept as a triple of plane indices; the whole cell is then a small dual-triangle list that lives in registers / a tiny per-thread frame. This is what lifts GPU occupancy far above the old half-edge frame. Cell geometry (volume, per-facet area vector, volume gradient dV, connector) is computed sort-free and adjacency-free by a per-vertex divergence-theorem scatter.
peclet::voro::buildTessellation (tessellator.hpp) builds the whole tessellation: a counting-sort grid + a voro++-derived presorted worklist gathers each cell's candidate neighbours closest-first (the dominant cost), then clips the ConvexCell on the fly and publishes a read-only peclet::voro::TessellationView (tessellation_view.hpp). It optionally emits a compact resident topology store so a later step can re-evaluate/repair without re-gathering.
peclet::voro::MovingTessellation (repair.hpp) updates a resident tessellation each step without a full rebuild: re-evaluate every cell's geometry on the fixed stored topology, run an O(nt) Lawson convexity certificate (isLocallyConvex, complete via the dual tet's four faces) to find which cells changed, then a two-pass gather repair of just those cells, with an adaptive gate that routes high-churn steps to a full rebuild (so it is never much slower than a cold build) and a verify pass that keeps it exact. Distributed across ranks via peclet::voro::mpi::VoronoiHalo (voronoi_halo.hpp).
On top of the tessellation, peclet::voro::physics provides a device-native compressible-Euler / Navier-Stokes Voronoi fluid (simulation.hpp, plus the euler_pressure / viscous / interface force consumers over the published view).
The nanobind module peclet.voro (voro_bindings.cpp) exposes two surfaces: Tessellation (cold build + incremental repair, volumes, neighbour counts) and Simulation (the fluid solver). Build with -DPECLET_VORO_BUILD_PYTHON=ON (or pip install .). See python/test_vorflow.py for usage.
A full cross-backend performance / memory / accuracy study (cold build + repair throughput, scaling, volume conservation) is in docs/performance_report.md.