zoomy_core.model.derivative_workflow#
Module zoomy_core.model.derivative_workflow.
Module Contents#
Classes#
DerivativeSpec. (class). |
|
DerivativeNamespace. (class). |
|
Compatibility layer for named fields + derivative mapping. |
|
Computes declared derivative buffer entries and fills Qaux. |
|
Generic derivative-aware solver based on the NumPy hyperbolic base. |
|
Backward-compatible alias. |
Functions#
Compatibility wrapper; prefer model.print_model_functions(). |
API#
- class zoomy_core.model.derivative_workflow.DerivativeSpec#
DerivativeSpec. (class).
- field: str#
None
- axes: Tuple[str, ...]#
None
- property key: Tuple[str, Tuple[str, ...]]#
Key.
- aux_name() str#
Aux name.
- class zoomy_core.model.derivative_workflow.DerivativeNamespace(model: zoomy_core.model.derivative_workflow.StructuredDerivativeModel)#
DerivativeNamespace. (class).
Initialization
Initialize the instance.
- diff(field, axes: Iterable[str])#
Diff.
- dt(field)#
Dt.
- dx(field)#
Dx.
- dxx(field)#
Dxx.
- dtxx(field)#
Dtxx.
- class zoomy_core.model.derivative_workflow.StructuredDerivativeModel(init_functions=True, **params)#
Bases:
zoomy_core.model.basemodel.ModelCompatibility layer for named fields + derivative mapping.
Initialization
Declare variables and parameters, run the derivation, and (unless
_finalize_lazy) finalize for the SystemModel.Args
init_functions: register the operator methods as symbolic functions during finalization.
- user_aux_variables#
‘Parameter(…)’
- auto_requested_derivatives#
‘Boolean(…)’
- derivative_canonicalization#
‘Selector(…)’
- aux_variables#
None
- requested_derivatives() List[zoomy_core.model.derivative_workflow.DerivativeSpec]#
Requested derivatives.
- derivative_buffer_aux_names() List[str]#
Derivative buffer aux names.
- resolve_field_name(field) str#
Resolve field name.
- class zoomy_core.model.derivative_workflow.DerivativeAwareSolverMixin#
Computes declared derivative buffer entries and fills Qaux.
- update_qaux(Q, Qaux, Qold, Qauxold, mesh, model, parameters, time, dt)#
Run the canonical aux legs, then overlay any
derivative_specs.COMPOSE, don’t shadow.
super().update_qauxresolves (via the MRO of every concrete user — IMEXSolver, DerivativeAwareSolver — past this mixin toSolver.update_qaux) and fills the two canonical legs: the localupdate_aux_variablesformula (e.g. KPhinv) and the non-localaux_registryspatial-derivative rows. Canonicalaux_registrymodels (SME/VAM/…) carry noderivative_specs, so they get exactly the explicitHyperbolicSolveraux path — previously this method early-returnedQauxunchanged and silently froze their aux at the IC. On top, any model that DOES declarederivative_specs(StructuredDerivativeModel / Green-Naghdi) gets its declared buffer rows — including the(Q-Qold)/dttime derivative, the one capability the canonical leg lacks — overlaid here.
- class zoomy_core.model.derivative_workflow.DerivativeAwareSolver(**kwargs)#
Bases:
zoomy_core.model.derivative_workflow.DerivativeAwareSolverMixin,zoomy_core.fvm.solver_numpy.HyperbolicSolverGeneric derivative-aware solver based on the NumPy hyperbolic base.
Initialization
- class zoomy_core.model.derivative_workflow.DerivativeAwareHyperbolicSolver(**kwargs)#
Bases:
zoomy_core.model.derivative_workflow.DerivativeAwareSolverBackward-compatible alias.
Initialization
- zoomy_core.model.derivative_workflow.print_model_functions(model: zoomy_core.model.basemodel.Model, function_names=None)#
Compatibility wrapper; prefer model.print_model_functions().