|
flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
nanobind module flow — the Kokkos cut-cell IBM Navier-Stokes solver (peclet.flow.Solver). More...
#include <nanobind/nanobind.h>#include <nanobind/ndarray.h>#include <nanobind/stl/array.h>#include <nanobind/stl/optional.h>#include <nanobind/stl/pair.h>#include <nanobind/stl/string.h>#include <nanobind/stl/tuple.h>#include <nanobind/stl/vector.h>#include <array>#include <cstdint>#include <Kokkos_Core.hpp>#include <limits>#include <string>#include <vector>#include "anderson_accelerator.hpp"#include "flow_bindings_checks.hpp"#include "flow_bindings_common.hpp"#include "flow_bindings_core.hpp"#include "flow_bindings_geometry.hpp"#include "flow_bindings_phase_change.hpp"#include "flow_bindings_scalar.hpp"#include "flow_bindings_sharp_viscous.hpp"#include "flow_bindings_tuning.hpp"#include "flow_bindings_vof.hpp"#include "flow_bindings_vof_blocks.hpp"#include "flow_bindings_vof_momentum.hpp"#include "flow_ibm.hpp"#include "peclet/core/python/kokkos_teardown.hpp"#include "peclet/core/python/ndarray_interop.hpp"Go to the source code of this file.
Classes | |
| struct | BoundAccelerator< Grid > |
| struct | BoundSolver< Grid > |
| struct | Diagnostics< Grid > |
| The developer tier: a view onto one Solver<Grid> (no state of its own). More... | |
Functions | |
| template<class Grid> | |
| static void | bind_accelerator (nb::module_ &m, const char *name) |
| template<class Grid> | |
| static void | bind_diagnostics (nb::module_ &m, const char *name) |
| template<class Grid> | |
| static void | bind_solver (nb::module_ &m, const char *name, const char *diag_name) |
| NB_MODULE (_flow, m) | |
nanobind module flow — the Kokkos cut-cell IBM Navier-Stokes solver (peclet.flow.Solver).
Exposes peclet::flow::IbmSolver to Python: set rho/mu/dt, a body force, an SDF solid (cut-cell IBM no-slip
Kokkos teardown follows the suite-wide pattern of peclet/core/python/kokkos_teardown.hpp: Kokkos is initialized at import; every bound Solver is a Releasable (registered on construction) and every zero-copy array (field_view) is a Releasable capsule; the module's single atexit hook (also flow.finalize()) releases all of them and THEN calls Kokkos::finalize, so a Solver or array still referenced at interpreter exit (script globals, a Jupyter/Quarto kernel) can no longer be destroyed after finalize – which is a Kokkos::abort (SIGABRT / exit 134, on OpenMP as on CUDA), not a warning. Nothing needs to be deleted before exit any more.
Arrays cross the boundary through the shared zero-copy bridge (peclet::core::python, in core): fields come back as Fortran-order (nx,ny,nz) float64 NumPy arrays referencing the field buffer, and inputs are read as flat x-fastest buffers. See peclet/core/python/ndarray_interop.hpp.
Definition in file flow_bindings.cpp.
|
static |
Definition at line 77 of file flow_bindings.cpp.
Referenced by NB_MODULE().
|
static |
Definition at line 120 of file flow_bindings.cpp.
References peclet::flow::bindings::bindDiagnosticsGeometry(), peclet::flow::bindings::bindDiagnosticsPhaseChange(), peclet::flow::bindings::bindDiagnosticsPorousMpi(), peclet::flow::bindings::bindDiagnosticsPressure(), peclet::flow::bindings::bindDiagnosticsScalar(), peclet::flow::bindings::bindDiagnosticsSharpViscous(), peclet::flow::bindings::bindDiagnosticsSolverOptions(), peclet::flow::bindings::bindDiagnosticsVof(), peclet::flow::bindings::bindDiagnosticsVofBlocks(), peclet::flow::bindings::bindDiagnosticsVofForces(), and peclet::flow::bindings::bindDiagnosticsVofMomentum().
Referenced by bind_solver().
|
static |
Definition at line 146 of file flow_bindings.cpp.
References bind_diagnostics(), peclet::flow::bindings::bindSolverControls(), peclet::flow::bindings::bindSolverGeometry(), peclet::flow::bindings::bindSolverPhaseChange(), peclet::flow::bindings::bindSolverPorousMpi(), peclet::flow::bindings::bindSolverScalar(), peclet::flow::bindings::bindSolverSetup(), peclet::flow::bindings::bindSolverSharpViscous(), peclet::flow::bindings::bindSolverState(), peclet::flow::bindings::bindSolverVof(), peclet::flow::bindings::bindSolverVofBlocks(), and peclet::flow::bindings::bindSolverVofMomentum().
Referenced by NB_MODULE().
| NB_MODULE | ( | _flow | , |
| m | ) |
Definition at line 170 of file flow_bindings.cpp.
References bind_accelerator(), bind_solver(), and weights().