Skip to content

dsl: Introduce abstractions for multi-stage time integrators#2599

Open
fernanvr wants to merge 26 commits intodevitocodes:mainfrom
fernanvr:multi-stage-time-integrator
Open

dsl: Introduce abstractions for multi-stage time integrators#2599
fernanvr wants to merge 26 commits intodevitocodes:mainfrom
fernanvr:multi-stage-time-integrator

Conversation

@fernanvr
Copy link
Copy Markdown

@fernanvr fernanvr commented May 5, 2025

Implementation of the ideas of @mloubout, as discussed in the Slack channel #timestepping.

It were created two new classes:

  • MultiStage: Each instance represents a combination of a PDE and its associated time integrator.

  • RK: Instances encapsulate a Butcher Tableau. The class methods define specific Runge-Kutta schemes, and it includes logic to expand a single PDE into multiple stage equations according to the RK method. It only contains the classic RK44, of fourth order and four stages, as a prove of concept.

To integrate the MultiStage into Devito’s pipeline, we modified the _lower(...) function in operator.py by adding the line:
expressions = cls._lower_multistage(expressions, **kwargs),
and modified _sanitize_exprs(cls, expressions, **kwargs) to recognize MultiStage instances.

We also created a new function:
_lower_multistage(),
in the same file. This function handles the expansion of MultiStage instances into their corresponding stage equations.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants