From a1922436cb30beea4b7ae21633b588a0c98eb77c Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Fri, 27 Sep 2024 20:55:41 -0700 Subject: [PATCH] swig --- .../fmod_int32/farkode_forcingstep_mod.c | 41 +------ .../fmod_int32/farkode_forcingstep_mod.f90 | 28 ++--- .../fmod_int32/farkode_splittingstep_mod.c | 5 +- .../fmod_int32/farkode_splittingstep_mod.f90 | 12 +- .../fmod_int64/farkode_forcingstep_mod.c | 41 +------ .../fmod_int64/farkode_forcingstep_mod.f90 | 28 ++--- .../fmod_int64/farkode_splittingstep_mod.c | 5 +- .../fmod_int64/farkode_splittingstep_mod.f90 | 12 +- src/sundials/fmod_int32/fsundials_core_mod.c | 64 +++++++++- .../fmod_int32/fsundials_core_mod.f90 | 114 +++++++++++++++++- src/sundials/fmod_int64/fsundials_core_mod.c | 64 +++++++++- .../fmod_int64/fsundials_core_mod.f90 | 114 +++++++++++++++++- 12 files changed, 376 insertions(+), 152 deletions(-) diff --git a/src/arkode/fmod_int32/farkode_forcingstep_mod.c b/src/arkode/fmod_int32/farkode_forcingstep_mod.c index 09f5a679e7..2c4fc34ed0 100644 --- a/src/arkode/fmod_int32/farkode_forcingstep_mod.c +++ b/src/arkode/fmod_int32/farkode_forcingstep_mod.c @@ -178,21 +178,6 @@ { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } -enum { - SWIG_MEM_OWN = 0x01, - SWIG_MEM_RVALUE = 0x02, - SWIG_MEM_CONST = 0x04 -}; - - -#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ - if (!(SWIG_CLASS_WRAPPER).cptr) { \ - SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ - "Cannot pass null " TYPENAME " (class " FNAME ") " \ - "as a reference", RETURNNULL); \ - } - - #include #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) # ifndef snprintf @@ -220,33 +205,17 @@ enum { #include "arkode/arkode_forcingstep.h" - -typedef struct { - void* cptr; - int cmemflags; -} SwigClassWrapper; - - -SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { - SwigClassWrapper result; - result.cptr = NULL; - result.cmemflags = 0; - return result; -} - -SWIGEXPORT void * _wrap_FForcingStepCreate(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, double const *farg3, N_Vector farg4, void *farg5) { +SWIGEXPORT void * _wrap_FForcingStepCreate(void *farg1, void *farg2, double const *farg3, N_Vector farg4, void *farg5) { void * fresult ; - SUNStepper arg1 ; - SUNStepper arg2 ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepper arg2 = (SUNStepper) 0 ; sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; SUNContext arg5 = (SUNContext) 0 ; void *result = 0 ; - SWIG_check_nonnull(*farg1, "SUNStepper", "SWIGTYPE_p_SUNStepper", "ForcingStepCreate(SUNStepper,SUNStepper,sunrealtype,N_Vector,SUNContext)", return 0); - arg1 = *(SUNStepper *)(farg1->cptr); - SWIG_check_nonnull(*farg2, "SUNStepper", "SWIGTYPE_p_SUNStepper", "ForcingStepCreate(SUNStepper,SUNStepper,sunrealtype,N_Vector,SUNContext)", return 0); - arg2 = *(SUNStepper *)(farg2->cptr); + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepper)(farg2); arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (SUNContext)(farg5); diff --git a/src/arkode/fmod_int32/farkode_forcingstep_mod.f90 b/src/arkode/fmod_int32/farkode_forcingstep_mod.f90 index 99c8932478..ebeb517b66 100644 --- a/src/arkode/fmod_int32/farkode_forcingstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_forcingstep_mod.f90 @@ -26,17 +26,6 @@ module farkode_forcingstep_mod private ! DECLARATION CONSTRUCTS - - integer, parameter :: swig_cmem_own_bit = 0 - integer, parameter :: swig_cmem_rvalue_bit = 1 - integer, parameter :: swig_cmem_const_bit = 2 - type, bind(C) :: SwigClassWrapper - type(C_PTR), public :: cptr = C_NULL_PTR - integer(C_INT), public :: cmemflags = 0 - end type - type, public :: SWIGTYPE_p_SUNStepper - type(SwigClassWrapper), public :: swigdata - end type public :: FForcingStepCreate public :: FForcingStep_GetNumEvolves @@ -46,9 +35,8 @@ function swigc_FForcingStepCreate(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FForcingStepCreate") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(SwigClassWrapper) :: farg2 +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 real(C_DOUBLE), intent(in) :: farg3 type(C_PTR), value :: farg4 type(C_PTR), value :: farg5 @@ -74,20 +62,20 @@ function FForcingStepCreate(stepper1, stepper2, t0, y0, sunctx) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -type(SWIGTYPE_p_SUNStepper), intent(in) :: stepper1 -type(SWIGTYPE_p_SUNStepper), intent(in) :: stepper2 +type(C_PTR) :: stepper1 +type(C_PTR) :: stepper2 real(C_DOUBLE), intent(in) :: t0 type(N_Vector), target, intent(inout) :: y0 type(C_PTR) :: sunctx type(C_PTR) :: fresult -type(SwigClassWrapper) :: farg1 -type(SwigClassWrapper) :: farg2 +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 real(C_DOUBLE) :: farg3 type(C_PTR) :: farg4 type(C_PTR) :: farg5 -farg1 = stepper1%swigdata -farg2 = stepper2%swigdata +farg1 = stepper1 +farg2 = stepper2 farg3 = t0 farg4 = c_loc(y0) farg5 = sunctx diff --git a/src/arkode/fmod_int32/farkode_splittingstep_mod.c b/src/arkode/fmod_int32/farkode_splittingstep_mod.c index f343e4ce69..413a87802e 100644 --- a/src/arkode/fmod_int32/farkode_splittingstep_mod.c +++ b/src/arkode/fmod_int32/farkode_splittingstep_mod.c @@ -691,7 +691,7 @@ SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_SuzukiFractal(int c } -SWIGEXPORT void * _wrap_FSplittingStepCreate(SwigClassWrapper const *farg1, int const *farg2, double const *farg3, N_Vector farg4, void *farg5) { +SWIGEXPORT void * _wrap_FSplittingStepCreate(void *farg1, int const *farg2, double const *farg3, N_Vector farg4, void *farg5) { void * fresult ; SUNStepper *arg1 = (SUNStepper *) 0 ; int arg2 ; @@ -700,8 +700,7 @@ SWIGEXPORT void * _wrap_FSplittingStepCreate(SwigClassWrapper const *farg1, int SUNContext arg5 = (SUNContext) 0 ; void *result = 0 ; - SWIG_check_mutable(*farg1, "SUNStepper *", "SWIGTYPE_p_SUNStepper", "SplittingStepCreate(SUNStepper *,int,sunrealtype,N_Vector,SUNContext)", return 0); - arg1 = (SUNStepper *)(farg1->cptr); + arg1 = (SUNStepper *)(farg1); arg2 = (int)(*farg2); arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); diff --git a/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 b/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 index da68d91177..13f4e2b7be 100644 --- a/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 @@ -93,9 +93,6 @@ module farkode_splittingstep_mod public :: FSplittingStepCoefficients_ThirdOrderSuzuki public :: FSplittingStepCoefficients_TripleJump public :: FSplittingStepCoefficients_SuzukiFractal - type, public :: SWIGTYPE_p_SUNStepper - type(SwigClassWrapper), public :: swigdata - end type public :: FSplittingStepCreate public :: FSplittingStep_SetCoefficients public :: FSplittingStep_GetNumEvolves @@ -378,8 +375,7 @@ function swigc_FSplittingStepCreate(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FSplittingStepCreate") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 integer(C_INT), intent(in) :: farg2 real(C_DOUBLE), intent(in) :: farg3 type(C_PTR), value :: farg4 @@ -854,19 +850,19 @@ function FSplittingStepCreate(steppers, partitions, t0, y0, sunctx) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -class(SWIGTYPE_p_SUNStepper), intent(in) :: steppers +type(C_PTR), target, intent(inout) :: steppers integer(C_INT), intent(in) :: partitions real(C_DOUBLE), intent(in) :: t0 type(N_Vector), target, intent(inout) :: y0 type(C_PTR) :: sunctx type(C_PTR) :: fresult -type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg1 integer(C_INT) :: farg2 real(C_DOUBLE) :: farg3 type(C_PTR) :: farg4 type(C_PTR) :: farg5 -farg1 = steppers%swigdata +farg1 = c_loc(steppers) farg2 = partitions farg3 = t0 farg4 = c_loc(y0) diff --git a/src/arkode/fmod_int64/farkode_forcingstep_mod.c b/src/arkode/fmod_int64/farkode_forcingstep_mod.c index 09f5a679e7..2c4fc34ed0 100644 --- a/src/arkode/fmod_int64/farkode_forcingstep_mod.c +++ b/src/arkode/fmod_int64/farkode_forcingstep_mod.c @@ -178,21 +178,6 @@ { printf("In " DECL ": " MSG); assert(0); RETURNNULL; } -enum { - SWIG_MEM_OWN = 0x01, - SWIG_MEM_RVALUE = 0x02, - SWIG_MEM_CONST = 0x04 -}; - - -#define SWIG_check_nonnull(SWIG_CLASS_WRAPPER, TYPENAME, FNAME, FUNCNAME, RETURNNULL) \ - if (!(SWIG_CLASS_WRAPPER).cptr) { \ - SWIG_exception_impl(FUNCNAME, SWIG_TypeError, \ - "Cannot pass null " TYPENAME " (class " FNAME ") " \ - "as a reference", RETURNNULL); \ - } - - #include #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) # ifndef snprintf @@ -220,33 +205,17 @@ enum { #include "arkode/arkode_forcingstep.h" - -typedef struct { - void* cptr; - int cmemflags; -} SwigClassWrapper; - - -SWIGINTERN SwigClassWrapper SwigClassWrapper_uninitialized() { - SwigClassWrapper result; - result.cptr = NULL; - result.cmemflags = 0; - return result; -} - -SWIGEXPORT void * _wrap_FForcingStepCreate(SwigClassWrapper const *farg1, SwigClassWrapper const *farg2, double const *farg3, N_Vector farg4, void *farg5) { +SWIGEXPORT void * _wrap_FForcingStepCreate(void *farg1, void *farg2, double const *farg3, N_Vector farg4, void *farg5) { void * fresult ; - SUNStepper arg1 ; - SUNStepper arg2 ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepper arg2 = (SUNStepper) 0 ; sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; SUNContext arg5 = (SUNContext) 0 ; void *result = 0 ; - SWIG_check_nonnull(*farg1, "SUNStepper", "SWIGTYPE_p_SUNStepper", "ForcingStepCreate(SUNStepper,SUNStepper,sunrealtype,N_Vector,SUNContext)", return 0); - arg1 = *(SUNStepper *)(farg1->cptr); - SWIG_check_nonnull(*farg2, "SUNStepper", "SWIGTYPE_p_SUNStepper", "ForcingStepCreate(SUNStepper,SUNStepper,sunrealtype,N_Vector,SUNContext)", return 0); - arg2 = *(SUNStepper *)(farg2->cptr); + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepper)(farg2); arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (SUNContext)(farg5); diff --git a/src/arkode/fmod_int64/farkode_forcingstep_mod.f90 b/src/arkode/fmod_int64/farkode_forcingstep_mod.f90 index 99c8932478..ebeb517b66 100644 --- a/src/arkode/fmod_int64/farkode_forcingstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_forcingstep_mod.f90 @@ -26,17 +26,6 @@ module farkode_forcingstep_mod private ! DECLARATION CONSTRUCTS - - integer, parameter :: swig_cmem_own_bit = 0 - integer, parameter :: swig_cmem_rvalue_bit = 1 - integer, parameter :: swig_cmem_const_bit = 2 - type, bind(C) :: SwigClassWrapper - type(C_PTR), public :: cptr = C_NULL_PTR - integer(C_INT), public :: cmemflags = 0 - end type - type, public :: SWIGTYPE_p_SUNStepper - type(SwigClassWrapper), public :: swigdata - end type public :: FForcingStepCreate public :: FForcingStep_GetNumEvolves @@ -46,9 +35,8 @@ function swigc_FForcingStepCreate(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FForcingStepCreate") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 -type(SwigClassWrapper) :: farg2 +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 real(C_DOUBLE), intent(in) :: farg3 type(C_PTR), value :: farg4 type(C_PTR), value :: farg5 @@ -74,20 +62,20 @@ function FForcingStepCreate(stepper1, stepper2, t0, y0, sunctx) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -type(SWIGTYPE_p_SUNStepper), intent(in) :: stepper1 -type(SWIGTYPE_p_SUNStepper), intent(in) :: stepper2 +type(C_PTR) :: stepper1 +type(C_PTR) :: stepper2 real(C_DOUBLE), intent(in) :: t0 type(N_Vector), target, intent(inout) :: y0 type(C_PTR) :: sunctx type(C_PTR) :: fresult -type(SwigClassWrapper) :: farg1 -type(SwigClassWrapper) :: farg2 +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 real(C_DOUBLE) :: farg3 type(C_PTR) :: farg4 type(C_PTR) :: farg5 -farg1 = stepper1%swigdata -farg2 = stepper2%swigdata +farg1 = stepper1 +farg2 = stepper2 farg3 = t0 farg4 = c_loc(y0) farg5 = sunctx diff --git a/src/arkode/fmod_int64/farkode_splittingstep_mod.c b/src/arkode/fmod_int64/farkode_splittingstep_mod.c index f343e4ce69..413a87802e 100644 --- a/src/arkode/fmod_int64/farkode_splittingstep_mod.c +++ b/src/arkode/fmod_int64/farkode_splittingstep_mod.c @@ -691,7 +691,7 @@ SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_SuzukiFractal(int c } -SWIGEXPORT void * _wrap_FSplittingStepCreate(SwigClassWrapper const *farg1, int const *farg2, double const *farg3, N_Vector farg4, void *farg5) { +SWIGEXPORT void * _wrap_FSplittingStepCreate(void *farg1, int const *farg2, double const *farg3, N_Vector farg4, void *farg5) { void * fresult ; SUNStepper *arg1 = (SUNStepper *) 0 ; int arg2 ; @@ -700,8 +700,7 @@ SWIGEXPORT void * _wrap_FSplittingStepCreate(SwigClassWrapper const *farg1, int SUNContext arg5 = (SUNContext) 0 ; void *result = 0 ; - SWIG_check_mutable(*farg1, "SUNStepper *", "SWIGTYPE_p_SUNStepper", "SplittingStepCreate(SUNStepper *,int,sunrealtype,N_Vector,SUNContext)", return 0); - arg1 = (SUNStepper *)(farg1->cptr); + arg1 = (SUNStepper *)(farg1); arg2 = (int)(*farg2); arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); diff --git a/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 b/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 index da68d91177..13f4e2b7be 100644 --- a/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 @@ -93,9 +93,6 @@ module farkode_splittingstep_mod public :: FSplittingStepCoefficients_ThirdOrderSuzuki public :: FSplittingStepCoefficients_TripleJump public :: FSplittingStepCoefficients_SuzukiFractal - type, public :: SWIGTYPE_p_SUNStepper - type(SwigClassWrapper), public :: swigdata - end type public :: FSplittingStepCreate public :: FSplittingStep_SetCoefficients public :: FSplittingStep_GetNumEvolves @@ -378,8 +375,7 @@ function swigc_FSplittingStepCreate(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FSplittingStepCreate") & result(fresult) use, intrinsic :: ISO_C_BINDING -import :: swigclasswrapper -type(SwigClassWrapper) :: farg1 +type(C_PTR), value :: farg1 integer(C_INT), intent(in) :: farg2 real(C_DOUBLE), intent(in) :: farg3 type(C_PTR), value :: farg4 @@ -854,19 +850,19 @@ function FSplittingStepCreate(steppers, partitions, t0, y0, sunctx) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -class(SWIGTYPE_p_SUNStepper), intent(in) :: steppers +type(C_PTR), target, intent(inout) :: steppers integer(C_INT), intent(in) :: partitions real(C_DOUBLE), intent(in) :: t0 type(N_Vector), target, intent(inout) :: y0 type(C_PTR) :: sunctx type(C_PTR) :: fresult -type(SwigClassWrapper) :: farg1 +type(C_PTR) :: farg1 integer(C_INT) :: farg2 real(C_DOUBLE) :: farg3 type(C_PTR) :: farg4 type(C_PTR) :: farg5 -farg1 = steppers%swigdata +farg1 = c_loc(steppers) farg2 = partitions farg3 = t0 farg4 = c_loc(y0) diff --git a/src/sundials/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c index cd93f56314..b0a7ed7876 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.c +++ b/src/sundials/fmod_int32/fsundials_core_mod.c @@ -2782,15 +2782,29 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTimeFn(void *farg1, SUNStepperSetStopTim } -SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirectionFn(void *farg1, SUNStepperSetStepDirectionFn farg2) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; - SUNStepperSetForcingFn arg2 = (SUNStepperSetForcingFn) 0 ; + SUNStepperSetStepDirectionFn arg2 = (SUNStepperSetStepDirectionFn) 0 ; SUNErrCode result; arg1 = (SUNStepper)(farg1); - arg2 = (SUNStepperSetForcingFn)(farg2); - result = (SUNErrCode)SUNStepper_SetForcingFn(arg1,arg2); + arg2 = (SUNStepperSetStepDirectionFn)(farg2); + result = (SUNErrCode)SUNStepper_SetStepDirectionFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetGetStepDirectionFn(void *farg1, SUNStepperGetStepDirectionFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperGetStepDirectionFn arg2 = (SUNStepperGetStepDirectionFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperGetStepDirectionFn)(farg2); + result = (SUNErrCode)SUNStepper_SetGetStepDirectionFn(arg1,arg2); fresult = (SUNErrCode)(result); return fresult; } @@ -2886,6 +2900,48 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTime(void *farg1, double const *farg2) { } +SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetForcingFn arg2 = (SUNStepperSetForcingFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetForcingFn)(farg2); + result = (SUNErrCode)SUNStepper_SetForcingFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirection(void *farg1, double const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNStepper_SetStepDirection(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_GetStepDirection(void *farg1, double *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (SUNErrCode)SUNStepper_GetStepDirection(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, double const *farg3, void *farg4, int const *farg5) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index 42ab3464c8..fde9c4ba7b 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -553,12 +553,16 @@ module fsundials_core_mod public :: FSUNStepper_SetFullRhsFn public :: FSUNStepper_SetResetFn public :: FSUNStepper_SetStopTimeFn - public :: FSUNStepper_SetForcingFn + public :: FSUNStepper_SetStepDirectionFn + public :: FSUNStepper_SetGetStepDirectionFn public :: FSUNStepper_Evolve public :: FSUNStepper_OneStep public :: FSUNStepper_TryStep public :: FSUNStepper_Reset public :: FSUNStepper_SetStopTime + public :: FSUNStepper_SetForcingFn + public :: FSUNStepper_SetStepDirection + public :: FSUNStepper_GetStepDirection public :: FSUNStepper_SetForcing ! WRAPPER DECLARATIONS @@ -2147,8 +2151,17 @@ function swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & -bind(C, name="_wrap_FSUNStepper_SetForcingFn") & +function swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirectionFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetGetStepDirectionFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetGetStepDirectionFn") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -2211,6 +2224,33 @@ function swigc_FSUNStepper_SetStopTime(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetForcingFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirection") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_GetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_GetStepDirection") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FSUNStepper_SetForcing") & result(fresult) @@ -5121,7 +5161,7 @@ function FSUNStepper_SetStopTimeFn(stepper, fn) & swig_result = fresult end function -function FSUNStepper_SetForcingFn(stepper, fn) & +function FSUNStepper_SetStepDirectionFn(stepper, fn) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result @@ -5133,7 +5173,23 @@ function FSUNStepper_SetForcingFn(stepper, fn) & farg1 = stepper farg2 = fn -fresult = swigc_FSUNStepper_SetForcingFn(farg1, farg2) +fresult = swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetGetStepDirectionFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetGetStepDirectionFn(farg1, farg2) swig_result = fresult end function @@ -5247,6 +5303,54 @@ function FSUNStepper_SetStopTime(stepper, tstop) & swig_result = fresult end function +function FSUNStepper_SetForcingFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetForcingFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetStepDirection(stepper, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = stepper +farg2 = stepdir +fresult = swigc_FSUNStepper_SetStepDirection(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_GetStepDirection(stepper, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), dimension(*), target, intent(inout) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(stepdir(1)) +fresult = swigc_FSUNStepper_GetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FSUNStepper_SetForcing(stepper, tshift, tscale, forcing, nforcing) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/sundials/fmod_int64/fsundials_core_mod.c b/src/sundials/fmod_int64/fsundials_core_mod.c index a0e410c75b..814fda5df8 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.c +++ b/src/sundials/fmod_int64/fsundials_core_mod.c @@ -2782,15 +2782,29 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTimeFn(void *farg1, SUNStepperSetStopTim } -SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirectionFn(void *farg1, SUNStepperSetStepDirectionFn farg2) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; - SUNStepperSetForcingFn arg2 = (SUNStepperSetForcingFn) 0 ; + SUNStepperSetStepDirectionFn arg2 = (SUNStepperSetStepDirectionFn) 0 ; SUNErrCode result; arg1 = (SUNStepper)(farg1); - arg2 = (SUNStepperSetForcingFn)(farg2); - result = (SUNErrCode)SUNStepper_SetForcingFn(arg1,arg2); + arg2 = (SUNStepperSetStepDirectionFn)(farg2); + result = (SUNErrCode)SUNStepper_SetStepDirectionFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetGetStepDirectionFn(void *farg1, SUNStepperGetStepDirectionFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperGetStepDirectionFn arg2 = (SUNStepperGetStepDirectionFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperGetStepDirectionFn)(farg2); + result = (SUNErrCode)SUNStepper_SetGetStepDirectionFn(arg1,arg2); fresult = (SUNErrCode)(result); return fresult; } @@ -2886,6 +2900,48 @@ SWIGEXPORT int _wrap_FSUNStepper_SetStopTime(void *farg1, double const *farg2) { } +SWIGEXPORT int _wrap_FSUNStepper_SetForcingFn(void *farg1, SUNStepperSetForcingFn farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + SUNStepperSetForcingFn arg2 = (SUNStepperSetForcingFn) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (SUNStepperSetForcingFn)(farg2); + result = (SUNErrCode)SUNStepper_SetForcingFn(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_SetStepDirection(void *farg1, double const *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype arg2 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype)(*farg2); + result = (SUNErrCode)SUNStepper_SetStepDirection(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + +SWIGEXPORT int _wrap_FSUNStepper_GetStepDirection(void *farg1, double *farg2) { + int fresult ; + SUNStepper arg1 = (SUNStepper) 0 ; + sunrealtype *arg2 = (sunrealtype *) 0 ; + SUNErrCode result; + + arg1 = (SUNStepper)(farg1); + arg2 = (sunrealtype *)(farg2); + result = (SUNErrCode)SUNStepper_GetStepDirection(arg1,arg2); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, double const *farg3, void *farg4, int const *farg5) { int fresult ; SUNStepper arg1 = (SUNStepper) 0 ; diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index 34cc744eed..a9bfae9bfc 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -553,12 +553,16 @@ module fsundials_core_mod public :: FSUNStepper_SetFullRhsFn public :: FSUNStepper_SetResetFn public :: FSUNStepper_SetStopTimeFn - public :: FSUNStepper_SetForcingFn + public :: FSUNStepper_SetStepDirectionFn + public :: FSUNStepper_SetGetStepDirectionFn public :: FSUNStepper_Evolve public :: FSUNStepper_OneStep public :: FSUNStepper_TryStep public :: FSUNStepper_Reset public :: FSUNStepper_SetStopTime + public :: FSUNStepper_SetForcingFn + public :: FSUNStepper_SetStepDirection + public :: FSUNStepper_GetStepDirection public :: FSUNStepper_SetForcing ! WRAPPER DECLARATIONS @@ -2147,8 +2151,17 @@ function swigc_FSUNStepper_SetStopTimeFn(farg1, farg2) & integer(C_INT) :: fresult end function -function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & -bind(C, name="_wrap_FSUNStepper_SetForcingFn") & +function swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirectionFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetGetStepDirectionFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetGetStepDirectionFn") & result(fresult) use, intrinsic :: ISO_C_BINDING type(C_PTR), value :: farg1 @@ -2211,6 +2224,33 @@ function swigc_FSUNStepper_SetStopTime(farg1, farg2) & integer(C_INT) :: fresult end function +function swigc_FSUNStepper_SetForcingFn(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetForcingFn") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_SetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_SetStepDirection") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +real(C_DOUBLE), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + +function swigc_FSUNStepper_GetStepDirection(farg1, farg2) & +bind(C, name="_wrap_FSUNStepper_GetStepDirection") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_PTR), value :: farg2 +integer(C_INT) :: fresult +end function + function swigc_FSUNStepper_SetForcing(farg1, farg2, farg3, farg4, farg5) & bind(C, name="_wrap_FSUNStepper_SetForcing") & result(fresult) @@ -5121,7 +5161,7 @@ function FSUNStepper_SetStopTimeFn(stepper, fn) & swig_result = fresult end function -function FSUNStepper_SetForcingFn(stepper, fn) & +function FSUNStepper_SetStepDirectionFn(stepper, fn) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result @@ -5133,7 +5173,23 @@ function FSUNStepper_SetForcingFn(stepper, fn) & farg1 = stepper farg2 = fn -fresult = swigc_FSUNStepper_SetForcingFn(farg1, farg2) +fresult = swigc_FSUNStepper_SetStepDirectionFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetGetStepDirectionFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetGetStepDirectionFn(farg1, farg2) swig_result = fresult end function @@ -5247,6 +5303,54 @@ function FSUNStepper_SetStopTime(stepper, tstop) & swig_result = fresult end function +function FSUNStepper_SetForcingFn(stepper, fn) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +type(C_FUNPTR), intent(in), value :: fn +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 + +farg1 = stepper +farg2 = fn +fresult = swigc_FSUNStepper_SetForcingFn(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_SetStepDirection(stepper, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), intent(in) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +real(C_DOUBLE) :: farg2 + +farg1 = stepper +farg2 = stepdir +fresult = swigc_FSUNStepper_SetStepDirection(farg1, farg2) +swig_result = fresult +end function + +function FSUNStepper_GetStepDirection(stepper, stepdir) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: stepper +real(C_DOUBLE), dimension(*), target, intent(inout) :: stepdir +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_PTR) :: farg2 + +farg1 = stepper +farg2 = c_loc(stepdir(1)) +fresult = swigc_FSUNStepper_GetStepDirection(farg1, farg2) +swig_result = fresult +end function + function FSUNStepper_SetForcing(stepper, tshift, tscale, forcing, nforcing) & result(swig_result) use, intrinsic :: ISO_C_BINDING