peclet.voro 1.0.4
Device-native moving-particle Voronoi dynamics
Loading...
Searching...
No Matches
pore_cells.hpp File Reference

The SDF-walled interstitial (pore-space) Voronoi cells of a seeding as exported geometry, on the device: the clipped polyhedra of every seed (VTK_POLYHEDRON layout) and their cross-section by a plane — peclet.voro.pore_mesh.sdf_voronoi_cells / sdf_voronoi_section (QUALITY_PLAN G.7, the device-first directive). More...

#include <cstdint>
#include <Kokkos_Core.hpp>
#include <string>
#include "peclet/core/common/view.hpp"
#include "peclet/voro/convex_cell.hpp"
#include "peclet/voro/params.hpp"
#include "peclet/voro/sdf.hpp"
#include "peclet/voro/tess_grid.hpp"
#include "peclet/voro/tessellator.hpp"
Include dependency graph for pore_cells.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  peclet::voro::PoreCellsResult< Real >
 The clipped polyhedra, packed as flat arrays in seed order (VTK_POLYHEDRON layout). More...
 
struct  peclet::voro::PoreSectionResult< Real >
 
struct  peclet::voro::detail::PoreCellGather< Real, Sdf, MAXP, MAXT >
 

Namespaces

namespace  peclet
 
namespace  peclet::voro
 Device-native Voronoi tessellation, geometry and finite-volume physics.
 
namespace  peclet::voro::detail
 

Functions

template<class Cell >
KOKKOS_INLINE_FUNCTION bool peclet::voro::detail::poreCellCount (const Cell &c, int &nPts, int &nEntries, bool &wall)
 
template<class Cell , class Real >
KOKKOS_INLINE_FUNCTION void peclet::voro::detail::poreCellFill (const Cell &c, const Real seed[3], int64_t ptBase, int64_t fBase, Real *pts, int64_t *faces)
 
template<class Count , class Off >
void peclet::voro::detail::exclusiveScan (const Count &count, const Off &off, int N)
 Exclusive scan of a per-seed count into offsets (N+1 entries; the last is the total).
 
template<class Off >
Off::value_type peclet::voro::detail::lastOf (const Off &off, int N)
 
template<class Status >
void peclet::voro::detail::statusCounts (const Status &status, int N, long &overflow, long &incomplete)
 
template<class Real , class Sdf , int MAXP = kMaxPlanes, int MAXT = kMaxTriangles>
PoreCellsResult< Real > peclet::voro::buildPoreCells (const Kokkos::View< Real *, peclet::core::MemSpace > &posFlat, int N, const Real L[3], const Sdf &sdf, int sw=kSearchWindow)
 
template<class Real , class Sdf , int MAXP = kMaxPlanes, int MAXT = kMaxTriangles>
PoreSectionResult< Real > peclet::voro::buildPoreSection (const Kokkos::View< Real *, peclet::core::MemSpace > &posFlat, int N, const Real L[3], const Sdf &sdf, const Real point[3], const Real normal[3], int sw=kSearchWindow)
 

Detailed Description

The SDF-walled interstitial (pore-space) Voronoi cells of a seeding as exported geometry, on the device: the clipped polyhedra of every seed (VTK_POLYHEDRON layout) and their cross-section by a plane — peclet.voro.pore_mesh.sdf_voronoi_cells / sdf_voronoi_section (QUALITY_PLAN G.7, the device-first directive).

Both entry points run the tessellator's own gather (CellBuilder::gatherCell over the counting-sort grid + presorted worklist of tess_grid.hpp — the exact worklist walk of the cold build, at the resident capacity kMaxPlanes / kMaxTriangles) followed by the SDF clip (clipCellAgainstSdf, as CellBuilder::finishCell applies it), one thread per cell, and export the finished ConvexCell with the count → scan → fill pattern: a first pass over the cells counts each cell's output (points and face-list entries, or section vertices), an exclusive scan in SEED order fixes every cell's offset, and a second pass rebuilds the cell and writes it in place. The output is therefore deterministic (seed order, independent of thread scheduling) and no over-buffer is needed; the price is the second gather, which is the same device-parallel work again.

Capacity: the production 64/112 (kMaxPlanes / kMaxTriangles), the same the cold build clips SDF-walled cells at; a cell that overflows it is skipped and counted (numOverflow). The larger pore capacity (kPoreMaxPlanes / kPoreMaxTriangles = 128/256, the host oracle's) is NOT used here on purpose: measured 2026-09-10 on an RTX 5080, the SDF clip of a 128/256 cell is WRONG on the CUDA backend (every wall cell off by up to 22 % in volume, deterministic; the same kernel at 64/112 matches the host oracle to 6e-11, and 128/256 is exact on OpenMP) — an open CUDA-only defect of clipCellAgainstSdf at that capacity, recorded in the G.7 report.

Layer 2 (tessellator + sdf + convex_cell).