zoomy_core.symsolver.numpy_backend.kernels

zoomy_core.symsolver.numpy_backend.kernels#

The kernels of a NumericalSystemModel in numpy: every entry of nsm.call lambdified once and evaluated on whole columns (cells or faces) by broadcasting, the numpy counterpart of zoomy_jax’s vmapped JaxRuntime for the printed solver templates.

Module Contents#

Classes#

Lowered

One kernel definition lambdified against signature groups; called with one array per group (column groups (rows, n), scalars otherwise), returns shape + (n,).

Indexed

An indexed boundary kernel (a Piecewise over idx of state vectors), called bc(branch, time, position, distance, q, qaux, p, normal) with one branch per column; each branch is evaluated on its own columns only.

Slot

A cell operator k(Q, Qaux, p, *trailing, **named) of a declared signature; the trailing groups bind in declared order or by name, time / dt default to 0 and position to the origin (as JaxRuntime).

Face

A numerics face function k(qL, qR, aL, aR, p, normal); the _speed variant returns the two sides and the speed (Wm, Wp, S) (as zoomy_jax’s _face_kernel).

NumpyKernels

Every kernel of nsm.call as a numpy callable, by slot name (None where empty); aux_derivatives is set by the runtime (the derivative-aux spec).

API#

class zoomy_core.symsolver.numpy_backend.kernels.Lowered(definition, groups, module)#

One kernel definition lambdified against signature groups; called with one array per group (column groups (rows, n), scalars otherwise), returns shape + (n,).

Initialization

Lambdify definition over groups (lists of symbols) with module.

class zoomy_core.symsolver.numpy_backend.kernels.Indexed(function, n_state, module)#

An indexed boundary kernel (a Piecewise over idx of state vectors), called bc(branch, time, position, distance, q, qaux, p, normal) with one branch per column; each branch is evaluated on its own columns only.

Initialization

Lambdify every branch of function (a Function whose definition is the Piecewise).

class zoomy_core.symsolver.numpy_backend.kernels.Slot(function, sm, module, squeeze)#

A cell operator k(Q, Qaux, p, *trailing, **named) of a declared signature; the trailing groups bind in declared order or by name, time / dt default to 0 and position to the origin (as JaxRuntime).

Initialization

Lambdify function (declared args); a dt that is also a parameter is dropped.

class zoomy_core.symsolver.numpy_backend.kernels.Face(function, module)#

A numerics face function k(qL, qR, aL, aR, p, normal); the _speed variant returns the two sides and the speed (Wm, Wp, S) (as zoomy_jax’s _face_kernel).

Initialization

Lambdify function over its six groups.

class zoomy_core.symsolver.numpy_backend.kernels.NumpyKernels(nsm)#

Every kernel of nsm.call as a numpy callable, by slot name (None where empty); aux_derivatives is set by the runtime (the derivative-aux spec).

Initialization

Lambdify the call table of nsm (a NumericalSystemModel).

property parameters#

The current parameter values, (n_parameters,).