zoomy_core.model.derivative_workflow

zoomy_core.model.derivative_workflow#

Module zoomy_core.model.derivative_workflow.

Module Contents#

Classes#

DerivativeSpec

DerivativeSpec. (class).

DerivativeNamespace

DerivativeNamespace. (class).

StructuredDerivativeModel

Compatibility layer for named fields + derivative mapping.

DerivativeAwareSolverMixin

Computes declared derivative buffer entries and fills Qaux.

DerivativeAwareSolver

Generic derivative-aware solver based on the NumPy hyperbolic base.

DerivativeAwareHyperbolicSolver

Backward-compatible alias.

Functions#

print_model_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.Model

Compatibility 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_qaux resolves (via the MRO of every concrete user — IMEXSolver, DerivativeAwareSolver — past this mixin to Solver.update_qaux) and fills the two canonical legs: the local update_aux_variables formula (e.g. KP hinv) and the non-local aux_registry spatial-derivative rows. Canonical aux_registry models (SME/VAM/…) carry no derivative_specs, so they get exactly the explicit HyperbolicSolver aux path — previously this method early-returned Qaux unchanged and silently froze their aux at the IC. On top, any model that DOES declare derivative_specs (StructuredDerivativeModel / Green-Naghdi) gets its declared buffer rows — including the (Q-Qold)/dt time 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.HyperbolicSolver

Generic derivative-aware solver based on the NumPy hyperbolic base.

Initialization

class zoomy_core.model.derivative_workflow.DerivativeAwareHyperbolicSolver(**kwargs)#

Bases: zoomy_core.model.derivative_workflow.DerivativeAwareSolver

Backward-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().