zoomy_amrex.symkernels

zoomy_amrex.symkernels#

Device kernels of the symbolic solvers on AMReX: one struct <system>_t per system with a static constexpr functor per kernel the printed solver references (nsm.source is nsm_t::source). The kernels are the system’s call table (the functions JAX lambdifies and foam prints) in AMReX syntax, AMREX_GPU_HOST_DEVICE operators on amrex::SmallMatrix.

Module Contents#

Classes#

AmrexKernelPrinter

AMReX syntax of the kernel bodies (AmrexCore plus the opaque calls of AmrexNumericsPrinter), with symbol maps from each kernel’s own argument groups.

Functions#

family

Kernel family of the Function f (face, bc, recon, normal or cell), from its argument groups.

referenced

Kernel names <system>.<name> used by the printed solver.

write_kernels

Write Kernels.H to path: struct <name>_t and its constexpr instance for each (name, nsm) in systems, with the kernels source uses.

Data#

API#

zoomy_amrex.symkernels.FAMILY#

None

zoomy_amrex.symkernels.family(f)#

Kernel family of the Function f (face, bc, recon, normal or cell), from its argument groups.

class zoomy_amrex.symkernels.AmrexKernelPrinter(*args, **kwargs)#

Bases: zoomy_core.transformation.to_amrex.AmrexCore, zoomy_core.transformation.generic_c.GenericCppBase

AMReX syntax of the kernel bodies (AmrexCore plus the opaque calls of AmrexNumericsPrinter), with symbol maps from each kernel’s own argument groups.

Initialization

Initialize the instance.

c_functions#

None

kernel(f, sizes)#

Print struct <name>_k and its constexpr instance for the Function f. Every kernel of a family takes the family’s full argument list and ignores what it does not declare.

Args

  • sizes: entries per argument group of the system.

Returns

The C++ text.

zoomy_amrex.symkernels.referenced(source, system)#

Kernel names <system>.<name> used by the printed solver.

zoomy_amrex.symkernels.write_kernels(systems, source, path, dimension, classes=None)#

Write Kernels.H to path: struct <name>_t and its constexpr instance for each (name, nsm) in systems, with the kernels source uses.

Args

  • classes: {(name, "state"): closure class per state row} (the topology’s lsq_closure_class), the 6th int of each aux_derivatives entry; -1 without a closure.

Returns

path.