diff options
author | Dominic Steinitz <dominic@steinitz.org> | 2018-03-19 16:41:18 +0000 |
---|---|---|
committer | Dominic Steinitz <dominic@steinitz.org> | 2018-03-19 16:41:18 +0000 |
commit | 71903cf575c31a15f9385659445c65fd85d22246 (patch) | |
tree | a2c5795b34a9ed17fd25688d147f6b6326ee24cf /packages/sundials/src/helpers.c | |
parent | 15a2c146d677dea7c4e0d7a39cbd6c8e9edb658f (diff) |
Even more simplification
Diffstat (limited to 'packages/sundials/src/helpers.c')
-rw-r--r-- | packages/sundials/src/helpers.c | 21 |
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. */ | ||
53 | int 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 */ |
68 | int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) | 47 | int check_ans(N_Vector y, realtype t, realtype rtol, realtype atol) |
69 | { | 48 | { |