Skip to content

Commit

Permalink
Update default controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Feb 19, 2025
1 parent 3a33c03 commit 2c1374c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/arkode/arkode_arkstep_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,12 @@ int arkStep_SetDefaults(ARKodeMem ark_mem)
return (ARK_MEM_FAIL);
}
}
ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx);
// TODO(SBR): is this necessary to set here?
ark_mem->hadapt_mem->hcontroller = SUNAdaptController_I(ark_mem->sunctx);
if (ark_mem->hadapt_mem->hcontroller == NULL)
{
arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
"SUNAdaptController_PID allocation failure");
"SUNAdaptController_I allocation failure");
return (ARK_MEM_FAIL);
}
ark_mem->hadapt_mem->owncontroller = SUNTRUE;
Expand Down
5 changes: 3 additions & 2 deletions src/arkode/arkode_erkstep_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,12 @@ int erkStep_SetDefaults(ARKodeMem ark_mem)
return (ARK_MEM_FAIL);
}
}
ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PI(ark_mem->sunctx);
// TODO(SBR): is this necessary to set here?
ark_mem->hadapt_mem->hcontroller = SUNAdaptController_I(ark_mem->sunctx);
if (ark_mem->hadapt_mem->hcontroller == NULL)
{
arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
"SUNAdaptController_PI allocation failure");
"SUNAdaptController_I allocation failure");
return (ARK_MEM_FAIL);
}
ark_mem->hadapt_mem->owncontroller = SUNTRUE;
Expand Down
4 changes: 2 additions & 2 deletions src/arkode/arkode_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3609,11 +3609,11 @@ int arkSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data)
C = NULL;
if (hfun == NULL)
{
C = SUNAdaptController_PID(ark_mem->sunctx);
C = SUNAdaptController_I(ark_mem->sunctx);
if (C == NULL)
{
arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
"SUNAdaptController_PID allocation failure");
"SUNAdaptController_I allocation failure");
return (ARK_MEM_FAIL);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/arkode/arkode_lsrkstep_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ int lsrkStep_SetDefaults(ARKodeMem ark_mem)
return (ARK_MEM_FAIL);
}
}
ark_mem->hadapt_mem->hcontroller = SUNAdaptController_PID(ark_mem->sunctx);
// TODO(SBR): is this necessary to set here?
ark_mem->hadapt_mem->hcontroller = SUNAdaptController_I(ark_mem->sunctx);
if (ark_mem->hadapt_mem->hcontroller == NULL)
{
arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
Expand Down

0 comments on commit 2c1374c

Please sign in to comment.