Skip to content

Commit

Permalink
Swig and format
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Oct 29, 2024
1 parent 76e4537 commit 2e7859e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 31 deletions.
16 changes: 5 additions & 11 deletions src/arkode/arkode_mristep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
19 changes: 6 additions & 13 deletions src/arkode/arkode_sunstepper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/arkode/fmod_int32/farkode_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/arkode/fmod_int64/farkode_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/sundials/fmod_int32/fsundials_core_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/sundials/fmod_int64/fsundials_core_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/sundials/sundials_stepper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2e7859e

Please sign in to comment.