Skip to content

Commit

Permalink
removed NoOp SUNAdaptController
Browse files Browse the repository at this point in the history
  • Loading branch information
drreynolds committed Nov 2, 2023
1 parent 6c2787d commit 1af95a9
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 562 deletions.
44 changes: 0 additions & 44 deletions include/sunadaptcontroller/sunadaptcontroller_noop.h

This file was deleted.

9 changes: 0 additions & 9 deletions scripts/shared
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ $tar $tarfile $distrobase/include/nvector/trilinos/SundialsTpetraVectorInterface
$tar $tarfile $distrobase/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp

$tar $tarfile $distrobase/include/sunadaptcontroller/sunadaptcontroller_imexgus.h
$tar $tarfile $distrobase/include/sunadaptcontroller/sunadaptcontroller_noop.h
$tar $tarfile $distrobase/include/sunadaptcontroller/sunadaptcontroller_soderlind.h

$tar $tarfile $distrobase/include/sunmatrix/sunmatrix_band.h
Expand Down Expand Up @@ -394,14 +393,6 @@ $tar $tarfile $distrobase/src/sunadaptcontroller/imexgus/fmod/CMakeLists.txt
$tar $tarfile $distrobase/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.c
$tar $tarfile $distrobase/src/sunadaptcontroller/imexgus/fmod/fsunadaptcontroller_imexgus_mod.f90

echo " --- Add sunadaptcontroller/noop module to $tarfile"

$tar $tarfile $distrobase/src/sunadaptcontroller/noop/CMakeLists.txt
$tar $tarfile $distrobase/src/sunadaptcontroller/noop/sunadaptcontroller_noop.c
$tar $tarfile $distrobase/src/sunadaptcontroller/noop/fmod/CMakeLists.txt
$tar $tarfile $distrobase/src/sunadaptcontroller/noop/fmod/fsunadaptcontroller_noop_mod.c
$tar $tarfile $distrobase/src/sunadaptcontroller/noop/fmod/fsunadaptcontroller_noop_mod.f90

echo " --- Add sunadaptcontroller/soderlind module to $tarfile"

$tar $tarfile $distrobase/src/sunadaptcontroller/soderlind/CMakeLists.txt
Expand Down
1 change: 0 additions & 1 deletion src/arkode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ sundials_add_library(sundials_arkode
sundials_sunmemsys_obj
sundials_nvecserial_obj
sundials_sunadaptcontrollerimexgus_obj
sundials_sunadaptcontrollernoop_obj
sundials_sunadaptcontrollersoderlind_obj
sundials_sunmatrixband_obj
sundials_sunmatrixdense_obj
Expand Down
47 changes: 0 additions & 47 deletions src/arkode/arkode_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <sundials/sundials_types.h>
#include <sunadaptcontroller/sunadaptcontroller_soderlind.h>
#include <sunadaptcontroller/sunadaptcontroller_imexgus.h>
#include <sunadaptcontroller/sunadaptcontroller_noop.h>


/*===============================================================
Expand Down Expand Up @@ -650,52 +649,6 @@ int arkSetFixedStep(void *arkode_mem, realtype hfixed)
}
ark_mem = (ARKodeMem) arkode_mem;

/* Remove current SUNAdaptController object
(delete if owned, and then nullify pointer) */
retval = SUNAdaptController_Space(ark_mem->hadapt_mem->hcontroller, &lenrw, &leniw);
if (retval == SUNADAPTCONTROLLER_SUCCESS) {
ark_mem->liw -= leniw;
ark_mem->lrw -= lenrw;
}
if (ark_mem->hadapt_mem->owncontroller) {
retval = SUNAdaptController_Destroy(ark_mem->hadapt_mem->hcontroller);
ark_mem->hadapt_mem->owncontroller = SUNFALSE;
if (retval != SUNADAPTCONTROLLER_SUCCESS) {
arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetFixedStep",
"SUNAdaptController_Destroy failure");
return(ARK_MEM_FAIL);
}
}
ark_mem->hadapt_mem->hcontroller = NULL;

/* If re-enabling time adaptivity, create default PID controller
and attach object to ARKODE.
Otherwise, create No-op controller and attach to ARKODE. */
C = NULL;
if (hfixed == ZERO)
{
C = SUNAdaptController_PID(ark_mem->sunctx);
if (C == NULL) {
arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetFixedStep",
"SUNAdaptController_PID allocation failure");
return(ARK_MEM_FAIL);
}
} else {
C = SUNAdaptController_NoOp(ark_mem->sunctx);
if (C == NULL) {
arkProcessError(ark_mem, ARK_MEM_FAIL, "ARKODE", "arkSetFixedStep",
"SUNAdaptController_NoOp allocation failure");
return(ARK_MEM_FAIL);
}
}
retval = SUNAdaptController_Space(C, &lenrw, &leniw);
if (retval == SUNADAPTCONTROLLER_SUCCESS) {
ark_mem->liw += leniw;
ark_mem->lrw += lenrw;
}
ark_mem->hadapt_mem->hcontroller = C;
ark_mem->hadapt_mem->owncontroller = SUNTRUE;

/* re-attach internal error weight functions if necessary */
if ((hfixed == ZERO) && (!ark_mem->user_efun)) {
if (ark_mem->itol == ARK_SV && ark_mem->Vabstol != NULL)
Expand Down
1 change: 0 additions & 1 deletion src/sunadaptcontroller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@

# required native matrices
add_subdirectory(imexgus)
add_subdirectory(noop)
add_subdirectory(soderlind)
29 changes: 0 additions & 29 deletions src/sunadaptcontroller/noop/CMakeLists.txt

This file was deleted.

25 changes: 0 additions & 25 deletions src/sunadaptcontroller/noop/fmod/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 1af95a9

Please sign in to comment.