From aba268913fe203ccb10a3345d4313f347cf4cfec Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Wed, 17 Apr 2024 07:16:09 -0700 Subject: [PATCH] Bugfix: Make MRI step fail when inner stepper has a recoverable error (#456) Fixes a bug where an MRI method would use the (likely corrupted) result of an inner stepper which returned with a recoverable error. Once adaptivity is supported, this could be handled similarly to ARK methods. --------- Co-authored-by: David Gardner --- CHANGELOG.md | 3 +++ doc/shared/RecentChanges.rst | 3 +++ src/arkode/arkode_mristep.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 696e4b908a..588038928e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ Fixed a bug in some Fortran examples where `c_null_ptr` was passed as an argumen to a function pointer instead of `c_null_funptr`. This caused compilation issues with the Cray Fortran compiler. +Fixed a bug where `MRIStepEvolve` would not handle a recoverable error produced +from evolving the inner stepper. + Added CMake infrastructure that enables externally maintained addons/plugins to be *optionally* built with SUNDIALS. See the [Contributing Guide](./CONTRIBUTING.md) for more details. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 728d85a90a..f8e4a1c045 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -19,3 +19,6 @@ instead of ``SameMajorVersion``. This fixes the issue seen Fixed a bug in some Fortran examples where ``c_null_ptr`` was passed as an argument to a function pointer instead of ``c_null_funptr``. This caused compilation issues with the Cray Fortran compiler. + +Fixed a bug where :c:func:`MRIStepEvolve` would not handle a recoverable error +produced from evolving the inner stepper. diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index 25d1620834..c637516aa8 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -2139,7 +2139,7 @@ int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, int is) /* advance inner method in time */ retval = mriStepInnerStepper_Evolve(step_mem->stepper, t0, ark_mem->tcur, ark_mem->ycur); - if (retval < 0) { return (ARK_INNERSTEP_FAIL); } + if (retval != 0) { return (ARK_INNERSTEP_FAIL); } /* post inner evolve function (if supplied) */ if (step_mem->post_inner_evolve)