Skip to content

Commit

Permalink
add missing GetDky guard in stop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gardner48 committed May 12, 2024
1 parent d8f64f6 commit b358972
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/arkode/arkode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,7 @@ int ARKodeEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout,
{
N_VScale(ONE, ark_mem->yn, yout);
ark_mem->tretlast = *tret = ark_mem->tcur;
ark_mem->next_h = ark_mem->hprime;
istate = ARK_SUCCESS;
break;
}
Expand Down Expand Up @@ -2213,14 +2214,22 @@ int arkStopTests(ARKodeMem ark_mem, sunrealtype tout, N_Vector yout,
/* In ARK_NORMAL mode, test if tout was reached */
if ((itask == ARK_NORMAL) && ((ark_mem->tcur - tout) * ark_mem->h >= ZERO))
{
ark_mem->tretlast = *tret = tout;
*ier = ARKodeGetDky(ark_mem, tout, 0, yout);
if (*ier != ARK_SUCCESS)
if (ark_mem->interp)
{
arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__,
MSG_ARK_BAD_TOUT, tout);
*ier = ARK_ILL_INPUT;
return (1);
*ier = ARKodeGetDky(ark_mem, tout, 0, yout);
if (*ier != ARK_SUCCESS)
{
arkProcessError(ark_mem, ARK_ILL_INPUT, __LINE__, __func__, __FILE__,
MSG_ARK_BAD_TOUT, tout);
*ier = ARK_ILL_INPUT;
return (1);
}
ark_mem->tretlast = *tret = tout;
}
else
{
N_VScale(ONE, ark_mem->yn, yout);
ark_mem->tretlast = *tret = ark_mem->tcur;
}
*ier = ARK_SUCCESS;
return (1);
Expand Down

0 comments on commit b358972

Please sign in to comment.