summaryrefslogtreecommitdiff
path: root/packages/sundials/src/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sundials/src/helpers.c')
-rw-r--r--packages/sundials/src/helpers.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/packages/sundials/src/helpers.c b/packages/sundials/src/helpers.c
index f3fe40b..420d3be 100644
--- a/packages/sundials/src/helpers.c
+++ b/packages/sundials/src/helpers.c
@@ -8,12 +8,6 @@
8#include <sundials/sundials_types.h> /* definition of type realtype */ 8#include <sundials/sundials_types.h> /* definition of type realtype */
9#include <sundials/sundials_math.h> 9#include <sundials/sundials_math.h>
10 10
11#include "farkode.h"
12
13#include <HsFFI.h>
14#include "Main_stub.h"
15
16
17/* Check function return value... 11/* Check function return value...
18 opt == 0 means SUNDIALS function allocates memory so check if 12 opt == 0 means SUNDIALS function allocates memory so check if
19 returned NULL pointer 13 returned NULL pointer
@@ -49,21 +43,6 @@ int check_flag(void *flagvalue, const char *funcname, int opt)
49 return 0; 43 return 0;
50} 44}
51 45
52/* Jacobian routine to compute J(t,y) = df/dy. */
53int Jac(realtype t, N_Vector y, N_Vector fy, SUNMatrix J,
54 void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3)
55{
56 realtype *rdata = (realtype *) user_data; /* cast user_data to realtype */
57 realtype lamda = rdata[0]; /* set shortcut for stiffness parameter */
58 realtype *Jdata = SUNDenseMatrix_Data(J);
59
60 /* Fill in Jacobian of f: set the first entry of the data array to set the (0,0) entry */
61 Jdata[0] = lamda;
62
63 return 0; /* return with success */
64}
65
66
67/* check the computed solution */ 46/* check the computed solution */
68int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) 47int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol)
69{ 48{