zoomy_foam.symkernels#
C++ kernels of the symbolic solvers on foam: one struct <system>_t per system with one
static constexpr functor per kernel the printed solver references. The kernels are the
NumericalSystemModel’s call table (the Functions the JAX runtime lambdifies) printed in Foam
syntax: state arguments are zs::Col views (rt.H), results fixed-size std::arrays, row-major.
Module Contents#
Classes#
Foam syntax of |
Functions#
Kernel family ( |
|
Kernel names |
|
Write |
API#
- zoomy_foam.symkernels.family(f)#
Kernel family (
face,bc,recon,normal,cell) of aFunction, which fixes its full C++ argument list.
- class zoomy_foam.symkernels.FoamKernelPrinter#
Bases:
zoomy_core.transformation.to_openfoam.FoamNumericsPrinterFoam syntax of
FoamNumericsPrinterwith stack results (std::array, row-major); the symbol maps come from each kernel’s own argument groups.Initialization
Initialise the generic C++ printer only.
- get_array_declaration(target, shape, init_zero=False)#
Zero-initialised stack array
targetof the flattenedshape.
- format_assignment(target, indices, value, shape)#
Row-major flat entry of
indices.
- kernel(f, n_state)#
Print one
Functionasstruct <name>_kand itsstatic constexprinstance; the call operator takes the full argument list of its family (unused arguments are ignored).
- zoomy_foam.symkernels.referenced(source, system)#
Kernel names
<system>.<name>used by the printed solver source.
- zoomy_foam.symkernels.write_kernels(systems, source, path, topo=None)#
Write
Kernels.H:struct <name>_tandconstexpr <name>_t <name>for each(name, nsm)insystems, with the kernelssourceuses.Args
topo: mesh topology; derivative aux entries carry the boundary-closure class of their state row (-1 without it)
Returns
path.