summaryrefslogtreecommitdiff
path: root/packages/sundials/src/helpers.c
diff options
context:
space:
mode:
authorDominic Steinitz <dominic@steinitz.org>2018-03-19 16:22:20 +0000
committerDominic Steinitz <dominic@steinitz.org>2018-03-19 16:22:20 +0000
commit15a2c146d677dea7c4e0d7a39cbd6c8e9edb658f (patch)
tree791db6e42312a7ec8c40a1a5e00b0dccfa6b206c /packages/sundials/src/helpers.c
parent5a51a987e014066d019473a68c1ceca9e30a348f (diff)
More removal of the Fortran way
Diffstat (limited to 'packages/sundials/src/helpers.c')
-rw-r--r--packages/sundials/src/helpers.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/packages/sundials/src/helpers.c b/packages/sundials/src/helpers.c
index 6162b71..f3fe40b 100644
--- a/packages/sundials/src/helpers.c
+++ b/packages/sundials/src/helpers.c
@@ -49,41 +49,6 @@ int check_flag(void *flagvalue, const char *funcname, int opt)
49 return 0; 49 return 0;
50} 50}
51 51
52/* f routine to compute the ODE RHS function f(t,y). */
53int f(realtype t, N_Vector y, N_Vector ydot, void *user_data)
54{
55 realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */
56 realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */
57 realtype u = NV_Ith_S(y,0); /* access current solution value */
58
59 /* fill in the RHS function: "NV_Ith_S" accesses the 0th entry of ydot */
60 NV_Ith_S(ydot,0) = lamda*u + 1.0/(1.0+t*t) - lamda*atan(t);
61
62 return 0; /* return with success */
63}
64
65int FARK_IMP_FUN(realtype *T, realtype *Y, realtype *YDOT,
66 long int *IPAR, realtype *RPAR, int *IER) {
67 multiEq(T, Y, YDOT, IPAR, RPAR, IER);
68 return 0;
69}
70
71/* C interface to user-supplied FORTRAN function FARKIFUN; see
72 farkode.h for further details */
73int FARKfi(realtype t, N_Vector y, N_Vector ydot, void *user_data) {
74
75 int ier;
76 realtype *ydata, *dydata;
77 FARKUserData ARK_userdata;
78 ydata = N_VGetArrayPointer(y);
79 dydata = N_VGetArrayPointer(ydot);
80 ARK_userdata = (FARKUserData) user_data;
81
82 FARK_IMP_FUN(&t, ydata, dydata, ARK_userdata->ipar,
83 ARK_userdata->rpar, &ier);
84 return(ier);
85}
86
87/* Jacobian routine to compute J(t,y) = df/dy. */ 52/* Jacobian routine to compute J(t,y) = df/dy. */
88int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J, 53int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J,
89 void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) 54 void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3)