Use Krylov for matrix-free split ExpRK operators#3588
Open
AshtonSBradley wants to merge 1 commit into
Open
Conversation
Author
|
Codex was used to help prepare and validate this PR. |
9c337c0 to
7599142
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Teaches fixed-step exponential RK methods to use the existing Krylov path when a
SplitODEProblemlinear operator is matrix-free.This builds on the
has_concretizationsupport merged in SciMLOperators PR: SciML/SciMLOperators.jl#361Fixes #2078.
Motivation
Operator-splitting problems using SciMLOperators matrix-free compositions can fail during cache construction because the non-Krylov path eagerly calls
convert(AbstractMatrix, A).Changes
prepare_alg, detect split linear operators with!has_concretization(A).krylov = trueforLawsonEuler,NorsettEuler,ETDRK2,ETDRK3,ETDRK4, andHochOst4.m,iop,autodiff, andconcrete_jac.FunctionOperator \ DiagonalOperator * FunctionOperatorsplit.Type stability / allocations
The new check happens once during algorithm preparation. It does not add per-step work. Matrix-backed operators keep the existing dense cached path. Matrix-free operators move onto the already-existing Krylov path, avoiding failed matrix materialization.
Tests
On current
master, with SciMLOperators v1.18.0:The OrdinaryDiffEq matrix-free split tests for this change pass on the rebased branch.
Pkg.test()forOrdinaryDiffEqExponentialRKwas also rerun on Julia 1.12.5 after the rebase. The newMatrix-free SciMLOperator splittest passes; the run still reports the existingExpRK Autodifferror, which is independent of this change and left out of scope for this PR.