Python API¶
The suite is driven from Python — everything lives under the single peclet namespace, installable
from PyPI (pip install peclet for the CPU family, pip install peclet-cu13 for the CUDA family, or an
individual pip install peclet-<name>). Worked, runnable examples for every module are on the
examples gallery.
| Package | Import | What you get |
|---|---|---|
| peclet.flow | import peclet.flow |
Solver / SolverColocated — the Eulerian Navier–Stokes solver (cut-cell IBM, VoF two-phase, moving analytic scenes, scalars, CFD-DEM hooks) |
| peclet.pnm | import peclet.pnm |
Pore-network extraction + per-throat flow rates / pore pressures from a flow DNS |
| peclet.dem | import peclet.dem |
Simulation — Lagrangian DEM (XPBD and Hertz–Mindlin), SDF-shaped particles, analytic walls |
| peclet.voro | import peclet.voro |
Tessellation, Simulation, FlowSolver — moving-cell Voronoi, dynamics, Navier–Stokes on a Voronoi mesh |
| peclet.coupling | import peclet.coupling |
CfdDem / ResolvedCfdDem — two-way CFD-DEM over flow + dem |
| peclet.halo · peclet.geom | from peclet import halo, geom |
particle halo (MPI), analytic-SDF scene authoring (SceneBuilder); peclet.core.mpi / peclet.core.geom are the deprecated spellings |
| peclet.amr | import peclet.amr |
block-octree AMR (Octree, DistributedOctree) and its collocated cut-cell Navier–Stokes solver (Flow) — under development |
| peclet.morton | import peclet.morton |
vectorised Morton/Z-order arithmetic |
Every Kokkos-backed module exposes execution_space (OpenMP / Cuda / HIP / Serial) so you can
confirm which build you imported, and finalize() for a deterministic teardown (also run at interpreter
exit). The package pages are generated from the modules' own docstrings each time this site is built,
inside the released peclet-cpu container image, so they describe the latest release (not main) and
include the distributed entry points; the full C++ API is on each code's Doxygen site (linked from the
home page).
GPU & multi-rank
pip install peclet gives the multicore-CPU (OpenMP) build and pip install peclet-cu13 the
single-GPU CUDA build. For AMD/HIP or multi-rank MPI, build the packages from source against a
Kokkos prefix, or use a container — see Install & run.
Distributed (MPI) API¶
Built with the MPI flags on (PECLET_FLOW_MPI / PECLET_PNM_MPI / PECLET_DEM_MPI / PECLET_VORO_MPI
— all on in the containers and the Snellius site install), the compute modules gain a
multi-rank surface driven from mpi4py. peclet.flow.has_mpi reports whether the build you imported
carries it (the PyPI wheels do not):
| Module | Distributed entry points |
|---|---|
peclet.flow |
Solver.init_mpi(gnx,gny,gnz), peclet.flow.mpi_block(gnx,gny,gnz) → (origin, size), Solver.rebalance_by_weights(...), real Solver.rank()/size(), exchange_field / exchange_field_add across ranks |
peclet.pnm |
peclet.pnm.mpi_block(...), extract_pore_network_mpi(...), extract_network_flow_mpi(...) (bit-exact to the single-rank extraction), mpi_rank()/mpi_size() |
peclet.dem |
Simulation.init_mpi(...), enable_mpi_step(...), step_mpi(nsteps), step_hertz_mpi(nsteps), rebalance(), rank(), num_ghost() |
peclet.voro |
VoronoiHalo(origin, size, gsize, periodic) with owned_mask, gather(...) → (pos, gid, weight, n_owned), refresh_positions, rank()/size() |
peclet.coupling |
the drivers run distributed when their flow and dem are (the deposition uses exchange_field_add) |
peclet.halo |
peclet.halo.ParticleMigrator / ParticleHalo (the shared particle halo the above build on); peclet.amr.DistributedOctree |
A distributed driver import mpi4py (which calls MPI_Init), then decomposes and steps. See the
worked example benchmarks/profile_mpi_flow.py,
the launch recipes in Containers → Distributed MPI, and the scaling studies on the
gallery's benchmarks section.