|
flow 1.3.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/vector.h>#include <array>#include <cstdint>#include <limits>#include <Kokkos_Core.hpp>#include <string>#include <vector>#include <nanobind/stl/tuple.h>#include "anderson_accelerator.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 | BoundSolver< Grid > |
| struct | BoundAccelerator< Grid > |
| struct | Diagnostics< Grid > |
| The developer tier: a view onto one Solver<Grid> (no state of its own). More... | |
Functions | |
| template<class S > | |
| static nb::ndarray< nb::numpy, double > | field_out (S &s, std::vector< double > &&v) |
| template<class S > | |
| static nb::ndarray< nb::numpy, double > | vofBlockColourArray (S &s, long id) |
| template<class S > | |
| static nb::ndarray< nb::numpy, double > | vofBlockKappaArray (S &s, long id) |
| static std::vector< double > | grid_in (nb::ndarray< double, nb::f_contig > a) |
| static int | enum_index (const std::string &v, const std::vector< std::string > &names, const char *who, const char *what) |
| static int | face_index (const std::string &f, const char *who) |
| template<class S > | |
| static auto | field3d_out (S &s, peclet::flow::CCField f) |
| template<class Grid > | |
| static void | bind_accelerator (nb::module_ &m, const char *name) |
| template<class Grid > | |
| static auto | traction_force_torque_array (peclet::flow::Solver< Grid > &s) |
The reconstructed-traction loads as the (4, n_instances, 3) array that both of its Python names return: diagnostics.hydro_force_torque_traction() (canonical) and the deprecated hydro_force_torque(). | |
| 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) | |
Variables | |
| static const std::vector< std::string > | kFaces {"-x", "+x", "-y", "+y", "-z", "+z"} |
| static const std::vector< std::string > | kAxes {"x", "y", "z"} |
| static const std::vector< std::string > | kBcTypes {"periodic", "wall", "inflow", "outflow", "slip"} |
| static const std::vector< std::string > | kScalarBcTypes {"periodic", "neumann", "dirichlet"} |
| static const std::vector< std::string > | kAdvSchemes {"sou", "koren"} |
| static const std::vector< std::string > | kScalarSchemes {"fou", "koren", "sou"} |
| static const std::vector< std::string > | kScalarWallTypes {"neumann", "dirichlet", "robin"} |
| static const std::vector< std::string > | kFluidOnly {"off", "filter", "star"} |
| static const std::vector< std::string > | kCsfModes {"face", "cell"} |
| static const std::vector< std::string > | kPivots |
| static const std::vector< std::string > | kAreaModes |
| static const std::vector< std::string > | kBlockAssign {"round-robin", "lpt", "orb"} |
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 70 of file flow_bindings.cpp.
Referenced by bind_diagnostics(), and bind_solver().
|
static |
Definition at line 82 of file flow_bindings.cpp.
|
static |
Definition at line 101 of file flow_bindings.cpp.
Referenced by bind_diagnostics().
|
static |
Definition at line 120 of file flow_bindings.cpp.
Referenced by bind_solver().
|
static |
Definition at line 126 of file flow_bindings.cpp.
Referenced by bind_diagnostics(), bind_solver(), and face_index().
|
static |
Definition at line 138 of file flow_bindings.cpp.
References enum_index(), and kFaces.
Referenced by bind_solver().
|
static |
Definition at line 163 of file flow_bindings.cpp.
Referenced by bind_diagnostics().
|
static |
Definition at line 198 of file flow_bindings.cpp.
|
static |
The reconstructed-traction loads as the (4, n_instances, 3) array that both of its Python names return: diagnostics.hydro_force_torque_traction() (canonical) and the deprecated hydro_force_torque().
One helper, so the two stay bit-identical.
Definition at line 241 of file flow_bindings.cpp.
|
static |
Definition at line 259 of file flow_bindings.cpp.
References enum_index(), field3d_out(), field_out(), kAreaModes, peclet::flow::kCaBoth, peclet::flow::kCaMg, peclet::flow::kCaMomentum, kCsfModes, kFluidOnly, kPivots, and vofBlockKappaArray().
|
static |
Definition at line 2047 of file flow_bindings.cpp.
References peclet::flow::ArrheniusMu, peclet::flow::BoussinesqForce, enum_index(), face_index(), field_out(), grid_in(), kAdvSchemes, kAxes, kBcTypes, kBlockAssign, kScalarBcTypes, kScalarSchemes, kScalarWallTypes, peclet::flow::LinearMix, and source().
| NB_MODULE | ( | _flow | , |
| m | |||
| ) |
Definition at line 3708 of file flow_bindings.cpp.
References weights().
|
static |
Definition at line 137 of file flow_bindings.cpp.
Referenced by face_index().
|
static |
Definition at line 141 of file flow_bindings.cpp.
Referenced by bind_solver().
|
static |
Definition at line 142 of file flow_bindings.cpp.
Referenced by bind_solver().
|
static |
Definition at line 143 of file flow_bindings.cpp.
Referenced by bind_solver().
|
static |
Definition at line 144 of file flow_bindings.cpp.
Referenced by bind_solver().
|
static |
Definition at line 145 of file flow_bindings.cpp.
Referenced by bind_solver().
|
static |
Definition at line 146 of file flow_bindings.cpp.
Referenced by bind_solver().
|
static |
Definition at line 147 of file flow_bindings.cpp.
Referenced by bind_diagnostics().
|
static |
Definition at line 148 of file flow_bindings.cpp.
Referenced by bind_diagnostics().
|
static |
Definition at line 149 of file flow_bindings.cpp.
Referenced by bind_diagnostics().
|
static |
Definition at line 151 of file flow_bindings.cpp.
Referenced by bind_diagnostics().
|
static |
Definition at line 154 of file flow_bindings.cpp.
Referenced by bind_solver().