zoomy_core.model.derivation.projection#
Galerkin-projection operations on the modal ansatz: sum expansion, test-function projection, bracket extraction and basis resolution. They carry a Model derivation from the unexpanded ansatz to basis-resolved moment equations.
Module Contents#
Classes#
Merge products and integer powers of unexpanded |
|
Unroll every finite |
|
Purely abstract definite integral: wrap each additive term in an unevaluated |
|
Galerkin projection: multiply by the test function, then integrate over |
|
Pull operator-independent factors out of every |
|
Name Galerkin brackets: a zeta-independent factor comes out as a constant, |
|
Resolve every Galerkin bracket to a number against a concrete basis via
|
Functions#
All named-bracket ( |
|
Pull every factor independent of a binding operator’s variable out of that derivative or integral, to a fixpoint. Gentle: never applies the product rule to a variable-dependent product. |
Data#
API#
- zoomy_core.model.derivation.projection.Gram#
‘_mk_bracket(…)’
- zoomy_core.model.derivation.projection.Weight#
‘_mk_bracket(…)’
- zoomy_core.model.derivation.projection.bracket_atoms(expr)#
All named-bracket (
Gram/Weight) atoms present inexpr.
- class zoomy_core.model.derivation.projection.ExpandSums(name='expand_sums')#
Bases:
zoomy_core.model.operations.OperationMerge products and integer powers of unexpanded
Sumfactors into one multi-indexSumwith distinct dummies. Apply after the ansatz substitution and beforeProject.Initialization
Create the operation.
- whole_leaf_op#
True
- class zoomy_core.model.derivation.projection.EvaluateSums(name='evaluate_sums')#
Bases:
zoomy_core.model.operations.OperationUnroll every finite
Sum(concrete integer bound) to explicit modes, leavingIntegralandDerivativedeferred. Narrower than a baredoit().Initialization
Create the operation.
- whole_leaf_op#
True
- class zoomy_core.model.derivation.projection.Integrate(var=None, bounds=(0, 1), dummy=None, name='integrate')#
Bases:
zoomy_core.model.operations.OperationPurely abstract definite integral: wrap each additive term in an unevaluated
Integral(term, (var, lo, hi)). Evaluation is left toResolveIntegralorExtractBrackets; a running integral (varin the bounds) gets a fresh dummy variable.Initialization
Create the operation.
Args
var: Integration variable (default zeta).bounds: Integration interval.dummy: Symbol to bind the integrand to (default: a fresh dummy only whenvaris in the bounds).
- whole_leaf_op#
True
- class zoomy_core.model.derivation.projection.Project(test_function, var=None, bounds=(0, 1), name='project')#
Bases:
zoomy_core.model.operations.OperationGalerkin projection: multiply by the test function, then integrate over
(zeta, 0, 1)through the unexpandedSum. The opaque basis brackets stay unevaluated.Args
test_function: Full test weight, e.g.c(zeta) * phi(l, zeta).var: Integration variable (default zeta).bounds: Integration interval.
References
Kowalski, Torrilhon 2019, https://doi.org/10.4208/cicp.OA-2017-0263
Initialization
Create the operation.
- whole_leaf_op#
True
- zoomy_core.model.derivation.projection.pull_out(expr)#
Pull every factor independent of a binding operator’s variable out of that derivative or integral, to a fixpoint. Gentle: never applies the product rule to a variable-dependent product.
- class zoomy_core.model.derivation.projection.PullConstants(name='pull_constants')#
Bases:
zoomy_core.model.operations.OperationPull operator-independent factors out of every
IntegralandDerivative(seepull_out). Run beforeExtractBracketsso that only purely zeta-dependent bodies remain under a bracket.Initialization
Create the operation.
- whole_leaf_op#
True
- class zoomy_core.model.derivation.projection.ExtractBrackets(basis, var=None, weight_name=None, name='extract_brackets')#
Bases:
zoomy_core.model.operations.OperationName Galerkin brackets: a zeta-independent factor comes out as a constant,
int phi_i c phi_lbecomesGram(i, l),int c phi_lbecomesWeight(l), any other pure-zeta body stays an explicitIntegral. A non-zetad_xwrapping the product commutes out (conservative flux).Args
basis: Opaque basis whosephihead is recognised.var: Integration variable (default zeta).weight_name: Name of the weight Functionc(default read off the basis).
Initialization
Create the operation.
- whole_leaf_op#
True
- class zoomy_core.model.derivation.projection.ResolveBasis(basis, var=None, name='resolve_basis')#
Bases:
zoomy_core.model.operations.OperationResolve every Galerkin bracket to a number against a concrete basis via
Basisfunction.resolve. Apply afterResolveModeshas made every bracket index an integer.Initialization
Create the operation.
- whole_leaf_op#
True