zoomy_core.model.derivation.basis_integral_cache

zoomy_core.model.derivation.basis_integral_cache#

Memoizing integral cache over a basis: concretizes opaque phi_k(arg) with the basis polynomials and integrates in polynomial form. Used by the Galerkin projection; it caches symbolic integrals, not M/A/B/D arrays.

Module Contents#

Classes#

BasisIntegralCache

Per-basis, in-memory cache from (integrand, var, lower, upper) to the symbolic integral. The caller must have factored out all var-independent factors from the integrand.

API#

class zoomy_core.model.derivation.basis_integral_cache.BasisIntegralCache(basis)#

Per-basis, in-memory cache from (integrand, var, lower, upper) to the symbolic integral. The caller must have factored out all var-independent factors from the integrand.

Initialization

Store the basis polynomials and their z-derivatives.

integrate(integrand, var, lower, upper)#

Return the symbolic value of the integral of integrand over var from lower to upper, cached by that tuple. Opaque phi_k(arg) and Derivative(phi_k(arg), arg) nodes are replaced by the basis polynomials before integration.