summaryrefslogtreecommitdiff
path: root/packages/sundials/src/Arkode.hsc
diff options
context:
space:
mode:
authorDominic Steinitz <dominic@steinitz.org>2018-03-30 14:15:26 +0100
committerDominic Steinitz <dominic@steinitz.org>2018-03-30 14:15:26 +0100
commit5bcc77b1e115a8c8eb94a1aa1a441618bfeb0b54 (patch)
tree1471fa78eaa57e1807019fe4f10b20d2e2c27a4f /packages/sundials/src/Arkode.hsc
parent94d26eb8ef7cf236127e9e51bb3c46348c4c6cfc (diff)
Improve naming
Diffstat (limited to 'packages/sundials/src/Arkode.hsc')
-rw-r--r--packages/sundials/src/Arkode.hsc46
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/sundials/src/Arkode.hsc b/packages/sundials/src/Arkode.hsc
new file mode 100644
index 0000000..59e701e
--- /dev/null
+++ b/packages/sundials/src/Arkode.hsc
@@ -0,0 +1,46 @@
1{-# LANGUAGE RecordWildCards #-}
2
3module Arkode where
4
5import Foreign
6import Foreign.C.Types
7import Foreign.C.String
8
9
10#include <stdio.h>
11#include <sundials/sundials_nvector.h>
12#include <nvector/nvector_serial.h>
13#include <arkode/arkode.h>
14
15#def typedef struct _generic_N_Vector SunVector;
16#def typedef struct _N_VectorContent_Serial SunContent;
17
18getContentPtr :: Storable a => Ptr b -> IO a
19getContentPtr ptr = (#peek SunVector, content) ptr
20
21getData :: Storable a => Ptr b -> IO a
22getData ptr = (#peek SunContent, data) ptr
23
24arkSMax :: Int
25arkSMax = #const ARK_S_MAX
26
27-- FIXME: We could just use inline-c instead
28sDIRK_2_1_2 :: Int
29sDIRK_2_1_2 = #const SDIRK_2_1_2
30-- #define BILLINGTON_3_3_2 13
31-- #define TRBDF2_3_3_2 14
32kVAERNO_4_2_3 :: Int
33kVAERNO_4_2_3 = #const KVAERNO_4_2_3
34-- #define ARK324L2SA_DIRK_4_2_3 16
35-- #define CASH_5_2_4 17
36-- #define CASH_5_3_4 18
37-- #define SDIRK_5_3_4 19
38-- #define KVAERNO_5_3_4 20
39-- #define ARK436L2SA_DIRK_6_3_4 21
40-- #define KVAERNO_7_4_5 22
41-- #define ARK548L2SA_DIRK_8_4_5 23
42
43-- #define DEFAULT_DIRK_2 SDIRK_2_1_2
44-- #define DEFAULT_DIRK_3 ARK324L2SA_DIRK_4_2_3
45-- #define DEFAULT_DIRK_4 SDIRK_5_3_4
46-- #define DEFAULT_DIRK_5 ARK548L2SA_DIRK_8_4_5