WIP: Initial IMEX tableau abstraction with generic perform_step! (ARS…#3196
WIP: Initial IMEX tableau abstraction with generic perform_step! (ARS…#3196singhharsh1708 wants to merge 12 commits intoSciML:masterfrom
Conversation
|
@ChrisRackauckas This PR introduces a prototype IMEX tableau abstraction and generic perform_step! dispatch.
|
ee82a23 to
86409c9
Compare
|
@ChrisRackauckas what about this is this working fine and has correct structure? |
|
It looks like a good start but it needs all of the details of the other SDIRK methods |
|
@ChrisRackauckas Migrated the full KenCarp/Kvaerno family to IMEXTableau and removed the per-method implementations. All tests are passing. |
| ) | ||
| end | ||
|
|
||
| abstract type OrdinaryDiffEqNewtonAdaptiveIMEXAlgorithm{CS, AD, FDT, ST, CJ} <: |
There was a problem hiding this comment.
top level should be in core.
| end | ||
|
|
||
| function alg_cache( | ||
| alg::OrdinaryDiffEqNewtonAdaptiveIMEXAlgorithm, u, rate_prototype, ::Type{uEltypeNoUnits}, |
There was a problem hiding this comment.
this doesn't cover all imex
| if integrator.f isa SplitFunction && !repeat_step && !integrator.last_stepfail | ||
| f_impl(zs[1], integrator.uprev, p, integrator.t) | ||
| zs[1] .*= dt |
| @@ -0,0 +1,1504 @@ | |||
| struct IMEXTableau{T, T2} | |||
| nlsolver.z = z₂ | ||
|
|
||
| @.. broadcast = false tmp = uprev + γ * z₁ | ||
| @.. broadcast = false tmp = uprev |
There was a problem hiding this comment.
also while updating these, please replace all uses of @.. broadcast=false with @.. (brodcast=false is the default)
| SFSDIRK4, SFSDIRK5, CFNLIRK3, SFSDIRK6, | ||
| SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA | ||
| SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA, | ||
| OrdinaryDiffEqNewtonAdaptiveIMEXAlgorithm, ARS343 |
There was a problem hiding this comment.
abstract types shouldn't export here.
Project.toml
Outdated
| CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" | ||
| DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" | ||
| DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" | ||
| DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" |
Project.toml
Outdated
| MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" | ||
| MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" | ||
| NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" | ||
| ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5" |
|
Looks generally good. Needs a lot more to get the rest of the IMEX methods, but it's probably good to merge a version with just these ESDIRKs supported. Left a bunch of comments. |
|
@ChrisRackauckas Addressed all review comments:
|
7e4ce55 to
333d24b
Compare
|
@ChrisRackauckas
|
Can you explain that a bit more? |
|
earlier ARS343 was using a placeholder embedded method for error estimation: |
|
The paper does not have an error estimator, so just don't make it adaptive. |
|
@ChrisRackauckas got it that makes sense, |
|
It doesn't look like it's not adaptive. It should set the trait based on whether |
|
@ChrisRackauckas updated ARS343 to set btilde = nothing so adaptivity is disabled via the tableau trait, and guarded the adaptive path accordingly. |
…-method implementations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lementation and remove per-method caches/perform_step
8cc211a to
b8bdd3f
Compare
|
@ChrisRackauckas migrated the remaining ESDIRK methods (ESDIRK54I8L2SA, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA) to the tableau-based implementation. |
|
one follow up question :Methods such as ImplicitEuler, Trapezoid, TRBDF2, SDIRK2, SDIRK22, Cash4, Hairer4, and Hairer42 have different structural properties (non-IMEX formulations and different stage structures), and may not directly fit into the current ESDIRK IMEX abstraction. Would it make sense to: |
|
IMO either is fine (but we probably want to do either as a separate PR. |
Summary
This PR introduces a unified IMEX tableau-based framework and migrates the KenCarp and Kvaerno IMEX SDIRK families to use it.
The goal is to define IMEX methods entirely via tableau coefficients, removing the need for per-method
perform_step!implementations and caches.Included in this PR
IMEXTableauabstraction (explicit + implicit Butcher arrays)Generic
perform_step!implementation for IMEX methodsMigration of:
Removal of all per-method caches and
perform_step!implementations for these methods (~2000 LOC reduction)ARS343 retained as a reference implementation
Verification
SplitODEProblem(both IIP and OOP)Notes
Checklist