diff --git a/CHANGELOG.md b/CHANGELOG.md index 2eb45e25b3..7932d0d00c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,11 @@ in any order. ### Bug Fixes +Fixed a bug in how MRIStep interacts with an MRIHTol SUNAdaptController object +(the previous version essentially just reverted to a decoupled multirate +controller). Removed the upper limit on `inner_max_tolfac` in +`SUNAdaptController_SetParams_MRIHTol`. + The shared library version numbers for the oneMKL dense linear solver and matrix as well as the PETSc SNES nonlinear solver have been corrected. diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 0afa8b684f..f28f94de12 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -21,6 +21,11 @@ method after :c:func:`KINInit`. Additionally, :c:func:`KINSetMAA` and **Bug Fixes** +Fixed a bug in how MRIStep interacts with an MRIHTol SUNAdaptController object +(the previous version essentially just reverted to a decoupled multirate +controller). Removed the upper limit on `inner_max_tolfac` in +:c:func:`SUNAdaptController_SetParams_MRIHTol`. + The shared library version numbers for the oneMKL dense linear solver and matrix as well as the PETSc SNES nonlinear solver have been corrected. diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst index fa9169e6e4..12b0f28dec 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_MRIHTol.rst @@ -153,9 +153,14 @@ also provides the following additional user-callable routines: :param C: the SUNAdaptController_MRIHTol object. :param inner_max_relch: the parameter :math:`relch_{\text{max}}` (must be :math:`\ge 1`). :param inner_min_tolfac: the parameter :math:`\text{tolfac}_{min}` (must be :math:`> 0`). - :param inner_max_tolfac: the parameter :math:`\text{tolfac}_{max}` (must be :math:`> 0` and :math:`\le 1`). + :param inner_max_tolfac: the parameter :math:`\text{tolfac}_{max}` (must be :math:`> 0`). :returns: :c:type:`SUNErrCode` indicating success or failure. + + .. versionchanged:: x.y.z + + Removed the requirement that ``inner_max_tolfac`` must be :math:`\le 1` + .. note:: diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index fb80e241fd..cdd0508fda 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -3571,6 +3571,11 @@ int mriStep_StageERKFast(ARKodeMem ark_mem, ARKodeMRIStepMem step_mem, __FILE__, "Unable to get accumulated error from the inner stepper"); return (ARK_INNERSTEP_FAIL); } + + /* scale the error estimate by 1/rtol to account for different inner/outer tolerances */ + step_mem->inner_dsm /= ark_mem->reltol; + SUNLogInfo(ARK_LOGGER, "accumulated-fast-error", "inner_dsm = %e", + step_mem->inner_dsm); } } diff --git a/src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c b/src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c index c615f75040..1cdf0c5516 100644 --- a/src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c +++ b/src/sunadaptcontroller/mrihtol/sunadaptcontroller_mrihtol.c @@ -236,8 +236,7 @@ SUNErrCode SUNAdaptController_SetParams_MRIHTol(SUNAdaptController C, MRIHTOL_INNER_MIN_TOLFAC(C) = INNER_MIN_TOLFAC; } else { MRIHTOL_INNER_MIN_TOLFAC(C) = inner_min_tolfac; } - if ((inner_max_tolfac <= SUN_RCONST(0.0)) || - (inner_max_tolfac > SUN_RCONST(1.0))) + if (inner_max_tolfac <= SUN_RCONST(0.0)) { MRIHTOL_INNER_MAX_TOLFAC(C) = INNER_MAX_TOLFAC; }