Skip to content

Commit

Permalink
Bugfix: Make MRI step fail when inner stepper has a recoverable error (
Browse files Browse the repository at this point in the history
…#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 <gardner48@llnl.gov>
  • Loading branch information
Steven-Roberts and gardner48 committed Jun 20, 2024
1 parent 503c7ee commit d6380ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions doc/shared/RecentChanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion src/arkode/arkode_mristep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d6380ba

Please sign in to comment.