Skip to content

Compile operator metadata from op_system into solver-ready matrices #60

@jc-macdonald

Description

@jc-macdonald

Summary

op_system now threads operator metadata (operators, operator_axis) through CompiledRhs and into the flepimop2 provider adapter (ACCIDDA/op_system#54, ACCIDDA/op_system#62). The op_engine provider receives this metadata via system.options, but nothing currently interprets the metadata to construct the actual sparse matrices needed by the IMEX and implicit solvers.

Motivation

For PDE-coupled compartmental models (e.g., immune-waning via advection, spatial diffusion), the user specifies operator intent declaratively in the op_system config:

operators:
  waning:
    type: advection
    axis: immune_status
    velocity: -omega

The op_engine adapter needs to:

  1. Read this metadata from the system options.
  2. Dispatch to the appropriate matrix_ops builder (e.g., build_advection_matrix, build_diffusion_laplacian).
  3. Wrap the result in a StageOperatorFactory keyed on dt.
  4. Pass the (L, R) pairs into CoreSolver for IMEX splitting.

Proposed scope

  • Add an OperatorCompiler (or similar) that maps operator metadata dicts to concrete sparse matrices.
  • Integrate with the existing StageOperatorFactory pattern.
  • Support at minimum: advection (Add upwind advection operator builder in matrix_ops #59) and diffusion (existing Laplacian).
  • Add integration test: op_system config with operators block → op_engine IMEX solve → correct PDE solution.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions