From 2e7859e825da0cf5b03b8108e49e4d6a8dd8ceb7 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Tue, 29 Oct 2024 15:19:52 -0700 Subject: [PATCH] Swig and format --- src/arkode/arkode_mristep.c | 16 +++++----------- src/arkode/arkode_sunstepper.c | 19 ++++++------------- src/arkode/fmod_int32/farkode_mod.f90 | 3 +++ src/arkode/fmod_int64/farkode_mod.f90 | 3 +++ .../fmod_int32/fsundials_core_mod.f90 | 3 --- .../fmod_int64/fsundials_core_mod.f90 | 3 --- src/sundials/sundials_stepper.c | 5 ++++- 7 files changed, 21 insertions(+), 31 deletions(-) diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index fbbaf58ed1..a078d19a33 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -2897,19 +2897,13 @@ int mriStepInnerStepper_FullRhsSUNStepper(MRIStepInnerStepper stepper, SUNFullRhsMode mode; switch (ark_mode) { - case ARK_FULLRHS_START: - mode = SUN_FULLRHS_START; - break; - case ARK_FULLRHS_END: - mode = SUN_FULLRHS_END; - break; - default: - mode = SUN_FULLRHS_OTHER; - break; + case ARK_FULLRHS_START: mode = SUN_FULLRHS_START; break; + case ARK_FULLRHS_END: mode = SUN_FULLRHS_END; break; + default: mode = SUN_FULLRHS_OTHER; break; } - SUNErrCode err = sunstepper->ops->fullrhs(sunstepper, t, y, f, mode); - stepper->last_flag = sunstepper->last_flag; + SUNErrCode err = sunstepper->ops->fullrhs(sunstepper, t, y, f, mode); + stepper->last_flag = sunstepper->last_flag; if (err != SUN_SUCCESS) { return ARK_SUNSTEPPER_ERR; } return ARK_SUCCESS; } diff --git a/src/arkode/arkode_sunstepper.c b/src/arkode/arkode_sunstepper.c index 251ba63095..417f8233f5 100644 --- a/src/arkode/arkode_sunstepper.c +++ b/src/arkode/arkode_sunstepper.c @@ -42,7 +42,8 @@ static SUNErrCode arkSUNStepperEvolve(SUNStepper stepper, sunrealtype tout, ----------------------------------------------------------------------------*/ static SUNErrCode arkSUNStepperFullRhs(SUNStepper stepper, sunrealtype t, - N_Vector y, N_Vector f, SUNFullRhsMode mode) + N_Vector y, N_Vector f, + SUNFullRhsMode mode) { SUNFunctionBegin(stepper->sunctx); /* extract the ARKODE memory struct */ @@ -53,18 +54,10 @@ static SUNErrCode arkSUNStepperFullRhs(SUNStepper stepper, sunrealtype t, int ark_mode; switch (mode) { - case SUN_FULLRHS_START: - ark_mode = ARK_FULLRHS_START; - break; - case SUN_FULLRHS_END: - ark_mode = ARK_FULLRHS_END; - break; - case SUN_FULLRHS_OTHER: - ark_mode = ARK_FULLRHS_OTHER; - break; - default: - ark_mode = -1; - break; + case SUN_FULLRHS_START: ark_mode = ARK_FULLRHS_START; break; + case SUN_FULLRHS_END: ark_mode = ARK_FULLRHS_END; break; + case SUN_FULLRHS_OTHER: ark_mode = ARK_FULLRHS_OTHER; break; + default: ark_mode = -1; break; } stepper->last_flag = ark_mem->step_fullrhs(ark_mem, t, y, f, ark_mode); diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index d84c7b2db5..8c3ddb3f3f 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -34,6 +34,9 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_ADAPT_EXP_GUS = 3_C_INT integer(C_INT), parameter, public :: ARK_ADAPT_IMP_GUS = 4_C_INT integer(C_INT), parameter, public :: ARK_ADAPT_IMEX_GUS = 5_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_START = 0_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_END = 1_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_OTHER = 2_C_INT integer(C_INT), parameter, public :: ARK_INTERP_MAX_DEGREE = 5_C_INT integer(C_INT), parameter, public :: ARK_INTERP_NONE = -1_C_INT integer(C_INT), parameter, public :: ARK_INTERP_HERMITE = 0_C_INT diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index 5ec913539a..fe6a62aafe 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -34,6 +34,9 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_ADAPT_EXP_GUS = 3_C_INT integer(C_INT), parameter, public :: ARK_ADAPT_IMP_GUS = 4_C_INT integer(C_INT), parameter, public :: ARK_ADAPT_IMEX_GUS = 5_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_START = 0_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_END = 1_C_INT + integer(C_INT), parameter, public :: ARK_FULLRHS_OTHER = 2_C_INT integer(C_INT), parameter, public :: ARK_INTERP_MAX_DEGREE = 5_C_INT integer(C_INT), parameter, public :: ARK_INTERP_NONE = -1_C_INT integer(C_INT), parameter, public :: ARK_INTERP_HERMITE = 0_C_INT diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index a808082a3f..a36ee8e8d9 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -543,9 +543,6 @@ module fsundials_core_mod public :: FSUNAdaptController_SetErrorBias public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_Space - integer(C_INT), parameter, public :: ARK_FULLRHS_START = 0_C_INT - integer(C_INT), parameter, public :: ARK_FULLRHS_END = 1_C_INT - integer(C_INT), parameter, public :: ARK_FULLRHS_OTHER = 2_C_INT ! typedef enum SUNFullRhsMode enum, bind(c) enumerator :: SUN_FULLRHS_START diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index 75f985c743..c778ddd1c6 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -543,9 +543,6 @@ module fsundials_core_mod public :: FSUNAdaptController_SetErrorBias public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_Space - integer(C_INT), parameter, public :: ARK_FULLRHS_START = 0_C_INT - integer(C_INT), parameter, public :: ARK_FULLRHS_END = 1_C_INT - integer(C_INT), parameter, public :: ARK_FULLRHS_OTHER = 2_C_INT ! typedef enum SUNFullRhsMode enum, bind(c) enumerator :: SUN_FULLRHS_START diff --git a/src/sundials/sundials_stepper.c b/src/sundials/sundials_stepper.c index 842aa9e22c..199a8896de 100644 --- a/src/sundials/sundials_stepper.c +++ b/src/sundials/sundials_stepper.c @@ -76,7 +76,10 @@ SUNErrCode SUNStepper_FullRhs(SUNStepper stepper, sunrealtype t, N_Vector v, N_Vector f, SUNFullRhsMode mode) { SUNFunctionBegin(stepper->sunctx); - if (stepper->ops->fullrhs) { return stepper->ops->fullrhs(stepper, t, v, f, mode); } + if (stepper->ops->fullrhs) + { + return stepper->ops->fullrhs(stepper, t, v, f, mode); + } return SUN_ERR_NOT_IMPLEMENTED; }