Skip to content

Commit

Permalink
swig
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Sep 28, 2024
1 parent 32cc2af commit a192243
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 152 deletions.
41 changes: 5 additions & 36 deletions src/arkode/fmod_int32/farkode_forcingstep_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
# ifndef snprintf
Expand Down Expand Up @@ -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);
Expand Down
28 changes: 8 additions & 20 deletions src/arkode/fmod_int32/farkode_forcingstep_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/arkode/fmod_int32/farkode_splittingstep_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand All @@ -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);
Expand Down
12 changes: 4 additions & 8 deletions src/arkode/fmod_int32/farkode_splittingstep_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
41 changes: 5 additions & 36 deletions src/arkode/fmod_int64/farkode_forcingstep_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
# ifndef snprintf
Expand Down Expand Up @@ -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);
Expand Down
28 changes: 8 additions & 20 deletions src/arkode/fmod_int64/farkode_forcingstep_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/arkode/fmod_int64/farkode_splittingstep_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand All @@ -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);
Expand Down
12 changes: 4 additions & 8 deletions src/arkode/fmod_int64/farkode_splittingstep_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit a192243

Please sign in to comment.