zoomy_core.model.kernel_functions#
Opaque SymPy functions (eigensystem, solve, pick, conditional, …) that every backend realises numerically. Each kernel must be registered in the backend’s function table (NumPy, JAX, C).
Module Contents#
Classes#
Opaque full eigendecomposition |
|
Opaque estimate of |
|
Opaque eigenvalue-only spectrum of the row-major |
|
Opaque per-cell linear solve |
|
Component |
|
Opaque non-local spatial derivative |
|
Vector-aware differentiable |
Functions#
Rewrite |
Data#
API#
- class zoomy_core.model.kernel_functions.eigensystem#
Bases:
sympy.FunctionOpaque full eigendecomposition
[lambda, R, L=R^-1]of the row-majorn*nmatrixA_flat, packed in one vector. Components are read throughpick(eigensystem(*a), idx); used by the Roe scheme.Args
A_flat: then*nmatrix entries, row-major.
- is_commutative#
True
- is_real#
True
- classmethod eval(*args)#
Keep the call unevaluated.
- class zoomy_core.model.kernel_functions.spectral_radius#
Bases:
sympy.FunctionOpaque estimate of
rho(A)bykpower-iteration steps onA^2(no eigendecomposition, runs on any device). Used as the wave-speed bound of the symbolic solvers.Args
k: number of power-iteration steps.safety: multiplicative safety factor on the estimate.A_flat: then*nmatrix entries, row-major.
References
Golub & Van Loan 2013, https://doi.org/10.56021/9781421407944
- is_commutative#
True
- is_real#
True
- classmethod eval(*args)#
Keep the call unevaluated.
- class zoomy_core.model.kernel_functions.eigenvalues#
Bases:
sympy.FunctionOpaque eigenvalue-only spectrum of the row-major
n*nmatrixA_flat, read throughpick(eigenvalues(*a), idx). Cheaper companion ofeigensystemfor wave-speed bounds when no closed-form spectrum exists.- is_commutative#
True
- is_real#
True
- classmethod eval(*args)#
Keep the call unevaluated.
- class zoomy_core.model.kernel_functions.solve#
Bases:
sympy.FunctionOpaque per-cell linear solve
A^-1 b, called assolve(*A_flat, *b_flat)and read throughpick(solve(*a), idx). Used by the point-implicit source treatment of the NumericalSystemModel.- is_commutative#
True
- is_real#
True
- classmethod eval(*args)#
Keep the call unevaluated.
- class zoomy_core.model.kernel_functions.pick#
Bases:
sympy.FunctionComponent
idxof a packed opaque-kernel result (eigensystem,eigenvalues,solve). Per-component backends restoreK(idx, *a)throughlower_pick_to_component.- is_commutative#
True
- is_real#
True
- classmethod eval(*args)#
Keep the call unevaluated.
- zoomy_core.model.kernel_functions.lower_pick_to_component(expr)#
Rewrite
pick(K(*a), idx)into the per-component formK(idx, *a)required by the C/C++ and UFL printers.Returns
The expression (or array/matrix) with every
pickof a per-component kernel swapped structurally.
- class zoomy_core.model.kernel_functions.compute_derivative#
Bases:
sympy.FunctionOpaque non-local spatial derivative
compute_derivative(field, *multi_index);(h, 1, 0)is d h / d x. The solver injects the backend’s LSQ-gradient implementation; it is emitted byexpose_auxintoupdate_aux_variables.- is_commutative#
True
- is_real#
True
- classmethod eval(*args)#
Keep the call unevaluated.
- class zoomy_core.model.kernel_functions.conditional#
Bases:
sympy.FunctionVector-aware differentiable
conditional(c, t, f): a symbolic node for scalars, aZArrayof nodes for vector branches. Differentiation follows the active branch and ignores the jump at the condition.- nargs#
3
- is_commutative#
True
- zoomy_core.model.kernel_functions.REQUIRED_KERNELS#
‘frozenset(…)’