summaryrefslogtreecommitdiff
path: root/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs')
-rw-r--r--packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs b/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs
index 8b713c6..a8d418b 100644
--- a/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs
+++ b/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs
@@ -1,5 +1,3 @@
1{-# OPTIONS_GHC -Wall #-}
2
3{-# LANGUAGE QuasiQuotes #-} 1{-# LANGUAGE QuasiQuotes #-}
4{-# LANGUAGE TemplateHaskell #-} 2{-# LANGUAGE TemplateHaskell #-}
5{-# LANGUAGE MultiWayIf #-} 3{-# LANGUAGE MultiWayIf #-}
@@ -141,9 +139,9 @@ import Numeric.LinearAlgebra.HMatrix (Vector, Matrix, toList, (><),
141 subMatrix, rows, cols, toLists, 139 subMatrix, rows, cols, toLists,
142 size, subVector) 140 size, subVector)
143 141
144import qualified Types as T 142import qualified Numeric.Sundials.CLangToHaskellTypes as T
145import Arkode 143import Numeric.Sundials.Arkode
146import qualified Arkode as B 144import qualified Numeric.Sundials.Arkode as B
147import qualified Numeric.Sundials.ODEOpts as SO 145import qualified Numeric.Sundials.ODEOpts as SO
148 146
149 147
@@ -160,7 +158,7 @@ C.include "<arkode/arkode_direct.h>" -- access to ARKDls interface
160C.include "<sundials/sundials_types.h>" -- definition of type realtype 158C.include "<sundials/sundials_types.h>" -- definition of type realtype
161C.include "<sundials/sundials_math.h>" 159C.include "<sundials/sundials_math.h>"
162C.include "../../../helpers.h" 160C.include "../../../helpers.h"
163C.include "Arkode_hsc.h" 161C.include "Numeric/Sundials/Arkode_hsc.h"
164 162
165 163
166type Jacobian = Double -> Vector Double -> Matrix Double 164type Jacobian = Double -> Vector Double -> Matrix Double
@@ -448,7 +446,7 @@ solveOdeC method initStepSize jacH (absTols, relTol) fun f0 ts = unsafePerformIO
448 diagnostics :: V.Vector CLong <- createVector 10 -- FIXME 446 diagnostics :: V.Vector CLong <- createVector 10 -- FIXME
449 diagMut <- V.thaw diagnostics 447 diagMut <- V.thaw diagnostics
450 -- We need the types that sundials expects. These are tied together 448 -- We need the types that sundials expects. These are tied together
451 -- in 'Types'. FIXME: The Haskell type is currently empty! 449 -- in 'CLangToHaskellTypes'. FIXME: The Haskell type is currently empty!
452 let funIO :: CDouble -> Ptr T.SunVector -> Ptr T.SunVector -> Ptr () -> IO CInt 450 let funIO :: CDouble -> Ptr T.SunVector -> Ptr T.SunVector -> Ptr () -> IO CInt
453 funIO x y f _ptr = do 451 funIO x y f _ptr = do
454 -- Convert the pointer we get from C (y) to a vector, and then 452 -- Convert the pointer we get from C (y) to a vector, and then
@@ -516,7 +514,7 @@ solveOdeC method initStepSize jacH (absTols, relTol) fun f0 ts = unsafePerformIO
516 /* problem as fully implicit and set f_E to NULL and f_I to f. */ 514 /* problem as fully implicit and set f_E to NULL and f_I to f. */
517 515
518 /* Here we use the C types defined in helpers.h which tie up with */ 516 /* Here we use the C types defined in helpers.h which tie up with */
519 /* the Haskell types defined in Types */ 517 /* the Haskell types defined in CLangToHaskellTypes */
520 if ($(int method) < MIN_DIRK_NUM) { 518 if ($(int method) < MIN_DIRK_NUM) {
521 flag = ARKodeInit(arkode_mem, $fun:(int (* funIO) (double t, SunVector y[], SunVector dydt[], void * params)), NULL, T0, y); 519 flag = ARKodeInit(arkode_mem, $fun:(int (* funIO) (double t, SunVector y[], SunVector dydt[], void * params)), NULL, T0, y);
522 if (check_flag(&flag, "ARKodeInit", 1)) return 1; 520 if (check_flag(&flag, "ARKodeInit", 1)) return 1;