flow
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
pnm_bindings.cpp File Reference

nanobind module pnm — Kokkos pore-network extraction from SDF geometry. More...

#include <nanobind/nanobind.h>
#include <nanobind/ndarray.h>
#include <nanobind/stl/pair.h>
#include <nanobind/stl/string.h>
#include <nanobind/stl/vector.h>
#include <array>
#include <cstddef>
#include <Kokkos_Core.hpp>
#include <vector>
#include "peclet/core/python/ndarray_interop.hpp"
#include "pore_extraction.hpp"
#include "sdf_reader.h"

Go to the source code of this file.

Functions

static std::vector< float > to_sdf (nb::ndarray< float, nb::c_contig > a, std::array< int, 3 > &res)
 
 NB_MODULE (_pnm, m)
 

Detailed Description

nanobind module pnm — Kokkos pore-network extraction from SDF geometry.

Matches the numpy convention: SDF is (Nz,Ny,Nx) C-order, origin/spacing are zyx. VTI reading (SDFReader) is pure C++ (sdf_reader.cpp, backend-free); the pore/segmentation/topology compute is the Kokkos GPU port. Exposes SDFReader, extract_pores, segment_volume, extract_topology_gpu. A C-order (Nz,Ny,Nx) buffer is contiguous x-fastest, so it maps onto the solver's flat layout directly via the shared bridge (peclet::core::python, core).

Definition in file pnm_bindings.cpp.

Function Documentation

◆ to_sdf()

static std::vector< float > to_sdf ( nb::ndarray< float, nb::c_contig >  a,
std::array< int, 3 > &  res 
)
static

Definition at line 28 of file pnm_bindings.cpp.

Referenced by NB_MODULE().

◆ NB_MODULE()