From afdbd2e3c82fd507835593af19b7afdd2b4115d9 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 19 Aug 2020 21:10:16 -0700 Subject: [PATCH 1/2] run formatter --- src/API/api_overloads.jl | 186 +- src/API/arkode.jl | 2308 +++++++++++++++++++--- src/API/cvode.jl | 906 +++++++-- src/API/cvodes.jl | 2213 ++++++++++++++++++--- src/API/ida.jl | 807 +++++++- src/API/idas.jl | 2112 +++++++++++++++++--- src/API/kinsol.jl | 549 ++++- src/API/libsundials.jl | 520 ++++- src/API/nvector.jl | 830 +++++++- src/API/sunlinsol.jl | 1218 ++++++++++-- src/API/sunmatrix.jl | 350 +++- src/API/sunnonlinsol.jl | 346 +++- src/API/types_and_consts.jl | 6 - src/Sundials.jl | 22 +- src/common_interface/algorithms.jl | 442 +++-- src/common_interface/function_types.jl | 348 ++-- src/common_interface/integrator_types.jl | 154 +- src/common_interface/integrator_utils.jl | 283 +-- src/common_interface/solve.jl | 1449 ++++++++------ src/common_interface/verbosity.jl | 7 +- src/handle.jl | 67 +- src/nvector_wrapper.jl | 23 +- src/simple.jl | 97 +- src/types_and_consts_additions.jl | 30 +- test/arkstep_Roberts_dns.jl | 8 +- test/common_interface/arkode.jl | 61 +- test/common_interface/callbacks.jl | 60 +- test/common_interface/cvode.jl | 119 +- test/common_interface/errors.jl | 19 +- test/common_interface/ida.jl | 66 +- test/common_interface/iterators.jl | 7 +- test/common_interface/jacobians.jl | 92 +- test/common_interface/mass_matrix.jl | 74 +- test/cvode_Roberts_dns.jl | 55 +- test/cvode_Roberts_simplified.jl | 6 +- test/cvodes_dns.jl | 222 ++- test/erkstep_nonlin.jl | 6 +- test/handle_tests.jl | 26 +- test/ida_Heat2D.jl | 76 +- test/ida_Roberts_dns.jl | 41 +- test/ida_Roberts_simplified.jl | 10 +- test/kinsol_banded.jl | 5 +- test/kinsol_mkinTest.jl | 7 +- test/mri_twowaycouple.jl | 22 +- test/runtests.jl | 78 +- 45 files changed, 13140 insertions(+), 3193 deletions(-) diff --git a/src/API/api_overloads.jl b/src/API/api_overloads.jl index e814533c..ef8434a6 100644 --- a/src/API/api_overloads.jl +++ b/src/API/api_overloads.jl @@ -1,18 +1,25 @@ -for ff in names(@__MODULE__; all=true) +for ff in names(@__MODULE__; all = true) fname = string(ff) if occursin("SetLinearSolver", fname) && - !occursin("#", fname) && # filter out compiler generated names - !occursin("Dls", fname) && !occursin("Spils", fname) # filter out old names - @eval $ff(mem, LS::SUNLinearSolver, A::Ptr, args...) = $ff(mem, LS, convert(SUNMatrix, A), args...) + !occursin("#", fname) && # filter out compiler generated names + !occursin("Dls", fname) && + !occursin("Spils", fname) # filter out old names + @eval $ff(mem, LS::SUNLinearSolver, A::Ptr, args...) = + $ff(mem, LS, convert(SUNMatrix, A), args...) end end # Julia wrapper for header: sunlinsol_lapackband.h # Automatically generated using Clang.jl - function SUNLinSol_LapackBand(y::N_Vector, A::SUNMatrix) - ccall((:SUNLinSol_LapackBand, libsundials_sunlinsollapackband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNLinSol_LapackBand, libsundials_sunlinsollapackband), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNLinSol_LapackBand(y, A) @@ -21,7 +28,13 @@ function SUNLinSol_LapackBand(y, A) end function SUNLapackBand(y::N_Vector, A::SUNMatrix) - ccall((:SUNLapackBand, libsundials_sunlinsollapackband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNLapackBand, libsundials_sunlinsollapackband), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNLapackBand(y, A) @@ -30,23 +43,59 @@ function SUNLapackBand(y, A) end function SUNLinSolGetType_LapackBand(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_LapackBand, libsundials_sunlinsollapackband), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_LapackBand, libsundials_sunlinsollapackband), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_LapackBand(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_LapackBand, libsundials_sunlinsollapackband), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_LapackBand, libsundials_sunlinsollapackband), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_LapackBand(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_LapackBand, libsundials_sunlinsollapackband), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetup_LapackBand(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver, SUNMatrix), S, A) + ccall( + (:SUNLinSolSetup_LapackBand, libsundials_sunlinsollapackband), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) end -function SUNLinSolSolve_LapackBand(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) +function SUNLinSolSolve_LapackBand( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_LapackBand, libsundials_sunlinsollapackband), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_LapackBand(S, A, x, b, tol) @@ -56,22 +105,44 @@ function SUNLinSolSolve_LapackBand(S, A, x, b, tol) end function SUNLinSolLastFlag_LapackBand(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_LapackBand, libsundials_sunlinsollapackband), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_LapackBand, libsundials_sunlinsollapackband), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_LapackBand(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_LapackBand, libsundials_sunlinsollapackband), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_LapackBand(S::SUNLinearSolver) - ccall((:SUNLinSolFree_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolFree_LapackBand, libsundials_sunlinsollapackband), + Cint, + (SUNLinearSolver,), + S, + ) end # Julia wrapper for header: sunlinsol_lapackdense.h # Automatically generated using Clang.jl - function SUNLinSol_LapackDense(y::N_Vector, A::SUNMatrix) - ccall((:SUNLinSol_LapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNLinSol_LapackDense, libsundials_sunlinsollapackdense), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNLinSol_LapackDense(y, A) @@ -80,7 +151,13 @@ function SUNLinSol_LapackDense(y, A) end function SUNLapackDense(y::N_Vector, A::SUNMatrix) - ccall((:SUNLapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNLapackDense, libsundials_sunlinsollapackdense), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNLapackDense(y, A) @@ -89,23 +166,59 @@ function SUNLapackDense(y, A) end function SUNLinSolGetType_LapackDense(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_LapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_LapackDense, libsundials_sunlinsollapackdense), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_LapackDense(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_LapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_LapackDense, libsundials_sunlinsollapackdense), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_LapackDense(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_LapackDense, libsundials_sunlinsollapackdense), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetup_LapackDense(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver, SUNMatrix), S, A) + ccall( + (:SUNLinSolSetup_LapackDense, libsundials_sunlinsollapackdense), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) end -function SUNLinSolSolve_LapackDense(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) +function SUNLinSolSolve_LapackDense( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_LapackDense, libsundials_sunlinsollapackdense), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_LapackDense(S, A, x, b, tol) @@ -115,13 +228,30 @@ function SUNLinSolSolve_LapackDense(S, A, x, b, tol) end function SUNLinSolLastFlag_LapackDense(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_LapackDense, libsundials_sunlinsollapackdense), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_LapackDense, libsundials_sunlinsollapackdense), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_LapackDense(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_LapackDense, libsundials_sunlinsollapackdense), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_LapackDense(S::SUNLinearSolver) - ccall((:SUNLinSolFree_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolFree_LapackDense, libsundials_sunlinsollapackdense), + Cint, + (SUNLinearSolver,), + S, + ) end diff --git a/src/API/arkode.jl b/src/API/arkode.jl index f83fdffd..9a32249c 100644 --- a/src/API/arkode.jl +++ b/src/API/arkode.jl @@ -4,9 +4,16 @@ # Julia wrapper for header: arkode_arkstep.h # Automatically generated using Clang.jl - function ARKStepCreate(fe::ARKRhsFn, fi::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall((:ARKStepCreate, libsundials_arkode), ARKStepMemPtr, (ARKRhsFn, ARKRhsFn, realtype, N_Vector), fe, fi, t0, y0) + ccall( + (:ARKStepCreate, libsundials_arkode), + ARKStepMemPtr, + (ARKRhsFn, ARKRhsFn, realtype, N_Vector), + fe, + fi, + t0, + y0, + ) end function ARKStepCreate(fe, fi, t0, y0) @@ -14,8 +21,25 @@ function ARKStepCreate(fe, fi, t0, y0) ARKStepCreate(ARKRhsFn_wrapper(fe), ARKRhsFn_wrapper(fi), t0, convert(N_Vector, __y0)) end -function ARKStepResize(arkode_mem, ynew::N_Vector, hscale::realtype, t0::realtype, resize::ARKVecResizeFn, resize_data) - ccall((:ARKStepResize, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), arkode_mem, ynew, hscale, t0, resize, resize_data) +function ARKStepResize( + arkode_mem, + ynew::N_Vector, + hscale::realtype, + t0::realtype, + resize::ARKVecResizeFn, + resize_data, +) + ccall( + (:ARKStepResize, libsundials_arkode), + Cint, + (ARKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), + arkode_mem, + ynew, + hscale, + t0, + resize, + resize_data, + ) end function ARKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) @@ -24,20 +48,49 @@ function ARKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) end function ARKStepReInit(arkode_mem, fe::ARKRhsFn, fi::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall((:ARKStepReInit, libsundials_arkode), Cint, (ARKStepMemPtr, ARKRhsFn, ARKRhsFn, realtype, N_Vector), arkode_mem, fe, fi, t0, y0) + ccall( + (:ARKStepReInit, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKRhsFn, ARKRhsFn, realtype, N_Vector), + arkode_mem, + fe, + fi, + t0, + y0, + ) end function ARKStepReInit(arkode_mem, fe, fi, t0, y0) __y0 = convert(NVector, y0) - ARKStepReInit(arkode_mem, ARKRhsFn_wrapper(fe), ARKRhsFn_wrapper(fi), t0, convert(N_Vector, __y0)) + ARKStepReInit( + arkode_mem, + ARKRhsFn_wrapper(fe), + ARKRhsFn_wrapper(fi), + t0, + convert(N_Vector, __y0), + ) end function ARKStepSStolerances(arkode_mem, reltol::realtype, abstol::realtype) - ccall((:ARKStepSStolerances, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, realtype), arkode_mem, reltol, abstol) + ccall( + (:ARKStepSStolerances, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype, realtype), + arkode_mem, + reltol, + abstol, + ) end function ARKStepSVtolerances(arkode_mem, reltol::realtype, abstol::N_Vector) - ccall((:ARKStepSVtolerances, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, N_Vector), arkode_mem, reltol, abstol) + ccall( + (:ARKStepSVtolerances, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype, N_Vector), + arkode_mem, + reltol, + abstol, + ) end function ARKStepSVtolerances(arkode_mem, reltol, abstol) @@ -46,15 +99,33 @@ function ARKStepSVtolerances(arkode_mem, reltol, abstol) end function ARKStepWFtolerances(arkode_mem, efun::ARKEwtFn) - ccall((:ARKStepWFtolerances, libsundials_arkode), Cint, (ARKStepMemPtr, ARKEwtFn), arkode_mem, efun) + ccall( + (:ARKStepWFtolerances, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKEwtFn), + arkode_mem, + efun, + ) end function ARKStepResStolerance(arkode_mem, rabstol::realtype) - ccall((:ARKStepResStolerance, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, rabstol) + ccall( + (:ARKStepResStolerance, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + rabstol, + ) end function ARKStepResVtolerance(arkode_mem, rabstol::N_Vector) - ccall((:ARKStepResVtolerance, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, rabstol) + ccall( + (:ARKStepResVtolerance, libsundials_arkode), + Cint, + (ARKStepMemPtr, N_Vector), + arkode_mem, + rabstol, + ) end function ARKStepResVtolerance(arkode_mem, rabstol) @@ -63,23 +134,61 @@ function ARKStepResVtolerance(arkode_mem, rabstol) end function ARKStepResFtolerance(arkode_mem, rfun::ARKRwtFn) - ccall((:ARKStepResFtolerance, libsundials_arkode), Cint, (ARKStepMemPtr, ARKRwtFn), arkode_mem, rfun) + ccall( + (:ARKStepResFtolerance, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKRwtFn), + arkode_mem, + rfun, + ) end function ARKStepSetLinearSolver(arkode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:ARKStepSetLinearSolver, libsundials_arkode), Cint, (ARKStepMemPtr, SUNLinearSolver, SUNMatrix), arkode_mem, LS, A) -end - -function ARKStepSetMassLinearSolver(arkode_mem, LS::SUNLinearSolver, M::SUNMatrix, time_dep::Cint) - ccall((:ARKStepSetMassLinearSolver, libsundials_arkode), Cint, (ARKStepMemPtr, SUNLinearSolver, SUNMatrix, Cint), arkode_mem, LS, M, time_dep) + ccall( + (:ARKStepSetLinearSolver, libsundials_arkode), + Cint, + (ARKStepMemPtr, SUNLinearSolver, SUNMatrix), + arkode_mem, + LS, + A, + ) +end + +function ARKStepSetMassLinearSolver( + arkode_mem, + LS::SUNLinearSolver, + M::SUNMatrix, + time_dep::Cint, +) + ccall( + (:ARKStepSetMassLinearSolver, libsundials_arkode), + Cint, + (ARKStepMemPtr, SUNLinearSolver, SUNMatrix, Cint), + arkode_mem, + LS, + M, + time_dep, + ) end function ARKStepSetMassLinearSolver(arkode_mem, LS::SUNLinearSolver, M::SUNMatrix, time_dep) - ARKStepSetMassLinearSolver(arkode_mem, LS::SUNLinearSolver, M::SUNMatrix, convert(Cint,time_dep)) + ARKStepSetMassLinearSolver( + arkode_mem, + LS::SUNLinearSolver, + M::SUNMatrix, + convert(Cint, time_dep), + ) end function ARKStepRootInit(arkode_mem, nrtfn::Cint, g::ARKRootFn) - ccall((:ARKStepRootInit, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, ARKRootFn), arkode_mem, nrtfn, g) + ccall( + (:ARKStepRootInit, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint, ARKRootFn), + arkode_mem, + nrtfn, + g, + ) end function ARKStepRootInit(arkode_mem, nrtfn, g::ARKRootFn) @@ -91,11 +200,22 @@ function ARKStepSetDefaults(arkode_mem) end function ARKStepSetOptimalParams(arkode_mem) - ccall((:ARKStepSetOptimalParams, libsundials_arkode), Cint, (ARKStepMemPtr,), arkode_mem) + ccall( + (:ARKStepSetOptimalParams, libsundials_arkode), + Cint, + (ARKStepMemPtr,), + arkode_mem, + ) end function ARKStepSetOrder(arkode_mem, maxord::Cint) - ccall((:ARKStepSetOrder, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxord) + ccall( + (:ARKStepSetOrder, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + maxord, + ) end function ARKStepSetOrder(arkode_mem, maxord) @@ -103,7 +223,13 @@ function ARKStepSetOrder(arkode_mem, maxord) end function ARKStepSetInterpolantType(arkode_mem, itype::Cint) - ccall((:ARKStepSetInterpolantType, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, itype) + ccall( + (:ARKStepSetInterpolantType, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + itype, + ) end function ARKStepSetInterpolantType(arkode_mem, itype) @@ -111,7 +237,13 @@ function ARKStepSetInterpolantType(arkode_mem, itype) end function ARKStepSetInterpolantDegree(arkode_mem, degree::Cint) - ccall((:ARKStepSetInterpolantDegree, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, degree) + ccall( + (:ARKStepSetInterpolantDegree, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + degree, + ) end function ARKStepSetInterpolantDegree(arkode_mem, degree) @@ -119,7 +251,13 @@ function ARKStepSetInterpolantDegree(arkode_mem, degree) end function ARKStepSetDenseOrder(arkode_mem, dord::Cint) - ccall((:ARKStepSetDenseOrder, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, dord) + ccall( + (:ARKStepSetDenseOrder, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + dord, + ) end function ARKStepSetDenseOrder(arkode_mem, dord) @@ -127,11 +265,23 @@ function ARKStepSetDenseOrder(arkode_mem, dord) end function ARKStepSetNonlinearSolver(arkode_mem, NLS::SUNNonlinearSolver) - ccall((:ARKStepSetNonlinearSolver, libsundials_arkode), Cint, (ARKStepMemPtr, SUNNonlinearSolver), arkode_mem, NLS) + ccall( + (:ARKStepSetNonlinearSolver, libsundials_arkode), + Cint, + (ARKStepMemPtr, SUNNonlinearSolver), + arkode_mem, + NLS, + ) end function ARKStepSetLinear(arkode_mem, timedepend::Cint) - ccall((:ARKStepSetLinear, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, timedepend) + ccall( + (:ARKStepSetLinear, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + timedepend, + ) end function ARKStepSetLinear(arkode_mem, timedepend) @@ -155,7 +305,16 @@ function ARKStepSetImEx(arkode_mem) end function ARKStepSetTables(arkode_mem, q::Cint, p::Cint, Bi, Be) - ccall((:ARKStepSetTables, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, Cint, ARKodeButcherTable, ARKodeButcherTable), arkode_mem, q, p, Bi, Be) + ccall( + (:ARKStepSetTables, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint, Cint, ARKodeButcherTable, ARKodeButcherTable), + arkode_mem, + q, + p, + Bi, + Be, + ) end function ARKStepSetTables(arkode_mem, q, p, Bi, Be) @@ -163,7 +322,14 @@ function ARKStepSetTables(arkode_mem, q, p, Bi, Be) end function ARKStepSetTableNum(arkode_mem, itable::Cint, etable::Cint) - ccall((:ARKStepSetTableNum, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, Cint), arkode_mem, itable, etable) + ccall( + (:ARKStepSetTableNum, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint, Cint), + arkode_mem, + itable, + etable, + ) end function ARKStepSetTableNum(arkode_mem, itable, etable) @@ -171,47 +337,124 @@ function ARKStepSetTableNum(arkode_mem, itable, etable) end function ARKStepSetCFLFraction(arkode_mem, cfl_frac::realtype) - ccall((:ARKStepSetCFLFraction, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, cfl_frac) + ccall( + (:ARKStepSetCFLFraction, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + cfl_frac, + ) end function ARKStepSetSafetyFactor(arkode_mem, safety::realtype) - ccall((:ARKStepSetSafetyFactor, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, safety) + ccall( + (:ARKStepSetSafetyFactor, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + safety, + ) end function ARKStepSetErrorBias(arkode_mem, bias::realtype) - ccall((:ARKStepSetErrorBias, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, bias) + ccall( + (:ARKStepSetErrorBias, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + bias, + ) end function ARKStepSetMaxGrowth(arkode_mem, mx_growth::realtype) - ccall((:ARKStepSetMaxGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, mx_growth) + ccall( + (:ARKStepSetMaxGrowth, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + mx_growth, + ) end function ARKStepSetFixedStepBounds(arkode_mem, lb::realtype, ub::realtype) - ccall((:ARKStepSetFixedStepBounds, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, realtype), arkode_mem, lb, ub) -end - -function ARKStepSetAdaptivityMethod(arkode_mem, imethod::Cint, idefault::Cint, pq::Cint, adapt_params) - ccall((:ARKStepSetAdaptivityMethod, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), arkode_mem, imethod, idefault, pq, adapt_params) + ccall( + (:ARKStepSetFixedStepBounds, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype, realtype), + arkode_mem, + lb, + ub, + ) +end + +function ARKStepSetAdaptivityMethod( + arkode_mem, + imethod::Cint, + idefault::Cint, + pq::Cint, + adapt_params, +) + ccall( + (:ARKStepSetAdaptivityMethod, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), + arkode_mem, + imethod, + idefault, + pq, + adapt_params, + ) end function ARKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) - ARKStepSetAdaptivityMethod(arkode_mem, convert(Cint, imethod), convert(Cint, idefault), convert(Cint, pq), adapt_params) + ARKStepSetAdaptivityMethod( + arkode_mem, + convert(Cint, imethod), + convert(Cint, idefault), + convert(Cint, pq), + adapt_params, + ) end function ARKStepSetAdaptivityFn(arkode_mem, hfun::ARKAdaptFn, h_data) - ccall((:ARKStepSetAdaptivityFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), arkode_mem, hfun, h_data) + ccall( + (:ARKStepSetAdaptivityFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), + arkode_mem, + hfun, + h_data, + ) end function ARKStepSetMaxFirstGrowth(arkode_mem, etamx1::realtype) - ccall((:ARKStepSetMaxFirstGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, etamx1) + ccall( + (:ARKStepSetMaxFirstGrowth, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + etamx1, + ) end function ARKStepSetMaxEFailGrowth(arkode_mem, etamxf::realtype) - ccall((:ARKStepSetMaxEFailGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, etamxf) + ccall( + (:ARKStepSetMaxEFailGrowth, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + etamxf, + ) end function ARKStepSetSmallNumEFails(arkode_mem, small_nef::Cint) - ccall((:ARKStepSetSmallNumEFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, small_nef) + ccall( + (:ARKStepSetSmallNumEFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + small_nef, + ) end function ARKStepSetSmallNumEFails(arkode_mem, small_nef) @@ -219,31 +462,67 @@ function ARKStepSetSmallNumEFails(arkode_mem, small_nef) end function ARKStepSetMaxCFailGrowth(arkode_mem, etacf::realtype) - ccall((:ARKStepSetMaxCFailGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, etacf) + ccall( + (:ARKStepSetMaxCFailGrowth, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + etacf, + ) end function ARKStepSetNonlinCRDown(arkode_mem, crdown::realtype) - ccall((:ARKStepSetNonlinCRDown, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, crdown) + ccall( + (:ARKStepSetNonlinCRDown, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + crdown, + ) end function ARKStepSetNonlinRDiv(arkode_mem, rdiv::realtype) - ccall((:ARKStepSetNonlinRDiv, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, rdiv) + ccall( + (:ARKStepSetNonlinRDiv, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + rdiv, + ) end function ARKStepSetDeltaGammaMax(arkode_mem, dgmax::realtype) - ccall((:ARKStepSetDeltaGammaMax, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, dgmax) + ccall( + (:ARKStepSetDeltaGammaMax, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + dgmax, + ) end function ARKStepSetMaxStepsBetweenLSet(arkode_mem, msbp::Cint) - ccall((:ARKStepSetMaxStepsBetweenLSet, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, msbp) + ccall( + (:ARKStepSetMaxStepsBetweenLSet, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + msbp, + ) end function ARKStepSetMaxStepsBetweenLSet(arkode_mem, msbp) - ARKStepSetMaxStepsBetweenLSet(arkode_mem, convert(Cint,msbp)) + ARKStepSetMaxStepsBetweenLSet(arkode_mem, convert(Cint, msbp)) end function ARKStepSetPredictorMethod(arkode_mem, method::Cint) - ccall((:ARKStepSetPredictorMethod, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, method) + ccall( + (:ARKStepSetPredictorMethod, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + method, + ) end function ARKStepSetPredictorMethod(arkode_mem, method) @@ -251,11 +530,24 @@ function ARKStepSetPredictorMethod(arkode_mem, method) end function ARKStepSetStabilityFn(arkode_mem, EStab::ARKExpStabFn, estab_data) - ccall((:ARKStepSetStabilityFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), arkode_mem, EStab, estab_data) + ccall( + (:ARKStepSetStabilityFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), + arkode_mem, + EStab, + estab_data, + ) end function ARKStepSetMaxErrTestFails(arkode_mem, maxnef::Cint) - ccall((:ARKStepSetMaxErrTestFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxnef) + ccall( + (:ARKStepSetMaxErrTestFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + maxnef, + ) end function ARKStepSetMaxErrTestFails(arkode_mem, maxnef) @@ -263,7 +555,13 @@ function ARKStepSetMaxErrTestFails(arkode_mem, maxnef) end function ARKStepSetMaxNonlinIters(arkode_mem, maxcor::Cint) - ccall((:ARKStepSetMaxNonlinIters, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxcor) + ccall( + (:ARKStepSetMaxNonlinIters, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + maxcor, + ) end function ARKStepSetMaxNonlinIters(arkode_mem, maxcor) @@ -271,7 +569,13 @@ function ARKStepSetMaxNonlinIters(arkode_mem, maxcor) end function ARKStepSetMaxConvFails(arkode_mem, maxncf::Cint) - ccall((:ARKStepSetMaxConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxncf) + ccall( + (:ARKStepSetMaxConvFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + maxncf, + ) end function ARKStepSetMaxConvFails(arkode_mem, maxncf) @@ -279,11 +583,23 @@ function ARKStepSetMaxConvFails(arkode_mem, maxncf) end function ARKStepSetNonlinConvCoef(arkode_mem, nlscoef::realtype) - ccall((:ARKStepSetNonlinConvCoef, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, nlscoef) + ccall( + (:ARKStepSetNonlinConvCoef, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + nlscoef, + ) end function ARKStepSetConstraints(arkode_mem, constraints::N_Vector) - ccall((:ARKStepSetConstraints, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, constraints) + ccall( + (:ARKStepSetConstraints, libsundials_arkode), + Cint, + (ARKStepMemPtr, N_Vector), + arkode_mem, + constraints, + ) end function ARKStepSetConstraints(arkode_mem, constraints) @@ -292,7 +608,13 @@ function ARKStepSetConstraints(arkode_mem, constraints) end function ARKStepSetMaxNumSteps(arkode_mem, mxsteps::Clong) - ccall((:ARKStepSetMaxNumSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Clong), arkode_mem, mxsteps) + ccall( + (:ARKStepSetMaxNumSteps, libsundials_arkode), + Cint, + (ARKStepMemPtr, Clong), + arkode_mem, + mxsteps, + ) end function ARKStepSetMaxNumSteps(arkode_mem, mxsteps) @@ -300,7 +622,13 @@ function ARKStepSetMaxNumSteps(arkode_mem, mxsteps) end function ARKStepSetMaxHnilWarns(arkode_mem, mxhnil::Cint) - ccall((:ARKStepSetMaxHnilWarns, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, mxhnil) + ccall( + (:ARKStepSetMaxHnilWarns, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + mxhnil, + ) end function ARKStepSetMaxHnilWarns(arkode_mem, mxhnil) @@ -308,27 +636,63 @@ function ARKStepSetMaxHnilWarns(arkode_mem, mxhnil) end function ARKStepSetInitStep(arkode_mem, hin::realtype) - ccall((:ARKStepSetInitStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hin) + ccall( + (:ARKStepSetInitStep, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + hin, + ) end function ARKStepSetMinStep(arkode_mem, hmin::realtype) - ccall((:ARKStepSetMinStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hmin) + ccall( + (:ARKStepSetMinStep, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + hmin, + ) end function ARKStepSetMaxStep(arkode_mem, hmax::realtype) - ccall((:ARKStepSetMaxStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hmax) + ccall( + (:ARKStepSetMaxStep, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + hmax, + ) end function ARKStepSetStopTime(arkode_mem, tstop::realtype) - ccall((:ARKStepSetStopTime, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, tstop) + ccall( + (:ARKStepSetStopTime, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + tstop, + ) end function ARKStepSetFixedStep(arkode_mem, hfixed::realtype) - ccall((:ARKStepSetFixedStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hfixed) + ccall( + (:ARKStepSetFixedStep, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + hfixed, + ) end function ARKStepSetMaxNumConstrFails(arkode_mem, maxfails::Cint) - ccall((:ARKStepSetMaxNumConstrFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxfails) + ccall( + (:ARKStepSetMaxNumConstrFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Cint), + arkode_mem, + maxfails, + ) end function ARKStepSetMaxNumConstrFails(arkode_mem, maxfails) @@ -336,48 +700,114 @@ function ARKStepSetMaxNumConstrFails(arkode_mem, maxfails) end function ARKStepSetRootDirection(arkode_mem, rootdir) - ccall((:ARKStepSetRootDirection, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Cint}), arkode_mem, rootdir) + ccall( + (:ARKStepSetRootDirection, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Cint}), + arkode_mem, + rootdir, + ) end function ARKStepSetNoInactiveRootWarn(arkode_mem) - ccall((:ARKStepSetNoInactiveRootWarn, libsundials_arkode), Cint, (ARKStepMemPtr,), arkode_mem) + ccall( + (:ARKStepSetNoInactiveRootWarn, libsundials_arkode), + Cint, + (ARKStepMemPtr,), + arkode_mem, + ) end function ARKStepSetErrHandlerFn(arkode_mem, ehfun::ARKErrHandlerFn, eh_data) - ccall((:ARKStepSetErrHandlerFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), arkode_mem, ehfun, eh_data) + ccall( + (:ARKStepSetErrHandlerFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), + arkode_mem, + ehfun, + eh_data, + ) end function ARKStepSetErrFile(arkode_mem, errfp) - ccall((:ARKStepSetErrFile, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, errfp) + ccall( + (:ARKStepSetErrFile, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{FILE}), + arkode_mem, + errfp, + ) end function ARKStepSetUserData(arkode_mem, user_data) - ccall((:ARKStepSetUserData, libsundials_arkode), Cint, (ARKStepMemPtr, Any), arkode_mem, user_data) + ccall( + (:ARKStepSetUserData, libsundials_arkode), + Cint, + (ARKStepMemPtr, Any), + arkode_mem, + user_data, + ) end function ARKStepSetDiagnostics(arkode_mem, diagfp) - ccall((:ARKStepSetDiagnostics, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, diagfp) + ccall( + (:ARKStepSetDiagnostics, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{FILE}), + arkode_mem, + diagfp, + ) end #This should change to ARKPostProcessFn function ARKStepSetPostprocessStepFn(arkode_mem, ProcessStep::ARKPostProcessStepFn) - ccall((:ARKStepSetPostprocessStepFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKPostProcessStepFn), arkode_mem, ProcessStep) + ccall( + (:ARKStepSetPostprocessStepFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKPostProcessStepFn), + arkode_mem, + ProcessStep, + ) end function ARKStepSetStagePredictFn(arkode_mem, PredictStage::ARKStepStagePredictFn) - ccall((:ARKStepSetStagePredictFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKStepStagePredictFn), arkode_mem, PredictStage) + ccall( + (:ARKStepSetStagePredictFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKStepStagePredictFn), + arkode_mem, + PredictStage, + ) end function ARKStepSetJacFn(arkode_mem, jac::ARKLsJacFn) - ccall((:ARKStepSetJacFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsJacFn), arkode_mem, jac) + ccall( + (:ARKStepSetJacFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKLsJacFn), + arkode_mem, + jac, + ) end function ARKStepSetMassFn(arkode_mem, mass::ARKLsMassFn) - ccall((:ARKStepSetMassFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsMassFn), arkode_mem, mass) + ccall( + (:ARKStepSetMassFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKLsMassFn), + arkode_mem, + mass, + ) end function ARKStepSetMaxStepsBetweenJac(arkode_mem, msbj::Clong) - ccall((:ARKStepSetMaxStepsBetweenJac, libsundials_arkode), Cint, (ARKStepMemPtr, Clong), arkode_mem, msbj) + ccall( + (:ARKStepSetMaxStepsBetweenJac, libsundials_arkode), + Cint, + (ARKStepMemPtr, Clong), + arkode_mem, + msbj, + ) end function ARKStepSetMaxStepsBetweenJac(arkode_mem, msbj) @@ -385,35 +815,108 @@ function ARKStepSetMaxStepsBetweenJac(arkode_mem, msbj) end function ARKStepSetEpsLin(arkode_mem, eplifac::realtype) - ccall((:ARKStepSetEpsLin, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, eplifac) + ccall( + (:ARKStepSetEpsLin, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + eplifac, + ) end function ARKStepSetMassEpsLin(arkode_mem, eplifac::realtype) - ccall((:ARKStepSetMassEpsLin, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, eplifac) -end - -function ARKStepSetPreconditioner(arkode_mem, psetup::ARKLsPrecSetupFn, psolve::ARKLsPrecSolveFn) - ccall((:ARKStepSetPreconditioner, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsPrecSetupFn, ARKLsPrecSolveFn), arkode_mem, psetup, psolve) -end - -function ARKStepSetMassPreconditioner(arkode_mem, psetup::ARKLsMassPrecSetupFn, psolve::ARKLsMassPrecSolveFn) - ccall((:ARKStepSetMassPreconditioner, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsMassPrecSetupFn, ARKLsMassPrecSolveFn), arkode_mem, psetup, psolve) -end - -function ARKStepSetJacTimes(arkode_mem, jtsetup::ARKLsJacTimesSetupFn, jtimes::ARKLsJacTimesVecFn) - ccall((:ARKStepSetJacTimes, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsJacTimesSetupFn, ARKLsJacTimesVecFn), arkode_mem, jtsetup, jtimes) -end - -function ARKStepSetMassTimes(arkode_mem, msetup::ARKLsMassTimesSetupFn, mtimes::ARKLsMassTimesVecFn, mtimes_data) - ccall((:ARKStepSetMassTimes, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsMassTimesSetupFn, ARKLsMassTimesVecFn, Ptr{Cvoid}), arkode_mem, msetup, mtimes, mtimes_data) + ccall( + (:ARKStepSetMassEpsLin, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype), + arkode_mem, + eplifac, + ) +end + +function ARKStepSetPreconditioner( + arkode_mem, + psetup::ARKLsPrecSetupFn, + psolve::ARKLsPrecSolveFn, +) + ccall( + (:ARKStepSetPreconditioner, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKLsPrecSetupFn, ARKLsPrecSolveFn), + arkode_mem, + psetup, + psolve, + ) +end + +function ARKStepSetMassPreconditioner( + arkode_mem, + psetup::ARKLsMassPrecSetupFn, + psolve::ARKLsMassPrecSolveFn, +) + ccall( + (:ARKStepSetMassPreconditioner, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKLsMassPrecSetupFn, ARKLsMassPrecSolveFn), + arkode_mem, + psetup, + psolve, + ) +end + +function ARKStepSetJacTimes( + arkode_mem, + jtsetup::ARKLsJacTimesSetupFn, + jtimes::ARKLsJacTimesVecFn, +) + ccall( + (:ARKStepSetJacTimes, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKLsJacTimesSetupFn, ARKLsJacTimesVecFn), + arkode_mem, + jtsetup, + jtimes, + ) +end + +function ARKStepSetMassTimes( + arkode_mem, + msetup::ARKLsMassTimesSetupFn, + mtimes::ARKLsMassTimesVecFn, + mtimes_data, +) + ccall( + (:ARKStepSetMassTimes, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKLsMassTimesSetupFn, ARKLsMassTimesVecFn, Ptr{Cvoid}), + arkode_mem, + msetup, + mtimes, + mtimes_data, + ) end function ARKStepSetLinSysFn(arkode_mem, linsys::ARKLsLinSysFn) - ccall((:ARKStepSetLinSysFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsLinSysFn), arkode_mem, linsys) + ccall( + (:ARKStepSetLinSysFn, libsundials_arkode), + Cint, + (ARKStepMemPtr, ARKLsLinSysFn), + arkode_mem, + linsys, + ) end function ARKStepEvolve(arkode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall((:ARKStepEvolve, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), arkode_mem, tout, yout, tret, itask) + ccall( + (:ARKStepEvolve, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), + arkode_mem, + tout, + yout, + tret, + itask, + ) end function ARKStepEvolve(arkode_mem, tout, yout, tret, itask) @@ -421,9 +924,16 @@ function ARKStepEvolve(arkode_mem, tout, yout, tret, itask) ARKStepEvolve(arkode_mem, tout, convert(N_Vector, __yout), tret, convert(Cint, itask)) end - function ARKStepGetDky(arkode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:ARKStepGetDky, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, Cint, N_Vector), arkode_mem, t, k, dky) + ccall( + (:ARKStepGetDky, libsundials_arkode), + Cint, + (ARKStepMemPtr, realtype, Cint, N_Vector), + arkode_mem, + t, + k, + dky, + ) end function ARKStepGetDky(arkode_mem, t::realtype, k, dky) @@ -432,35 +942,85 @@ function ARKStepGetDky(arkode_mem, t::realtype, k, dky) end function ARKStepGetNumExpSteps(arkode_mem, expsteps) - ccall((:ARKStepGetNumExpSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, expsteps) + ccall( + (:ARKStepGetNumExpSteps, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + expsteps, + ) end function ARKStepGetNumAccSteps(arkode_mem, accsteps) - ccall((:ARKStepGetNumAccSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, accsteps) + ccall( + (:ARKStepGetNumAccSteps, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + accsteps, + ) end function ARKStepGetNumStepAttempts(arkode_mem, step_attempts) - ccall((:ARKStepGetNumStepAttempts, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, step_attempts) + ccall( + (:ARKStepGetNumStepAttempts, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + step_attempts, + ) end function ARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) - ccall((:ARKStepGetNumRhsEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, nfe_evals, nfi_evals) + ccall( + (:ARKStepGetNumRhsEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + nfe_evals, + nfi_evals, + ) end function ARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) - ccall((:ARKStepGetNumLinSolvSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nlinsetups) + ccall( + (:ARKStepGetNumLinSolvSetups, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nlinsetups, + ) end function ARKStepGetNumErrTestFails(arkode_mem, netfails) - ccall((:ARKStepGetNumErrTestFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, netfails) + ccall( + (:ARKStepGetNumErrTestFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + netfails, + ) end function ARKStepGetCurrentButcherTables(arkode_mem, Bi, Be) - ccall((:ARKStepGetCurrentButcherTables, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{ARKodeButcherTable}, Ptr{ARKodeButcherTable}), arkode_mem, Bi, Be) + ccall( + (:ARKStepGetCurrentButcherTables, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{ARKodeButcherTable}, Ptr{ARKodeButcherTable}), + arkode_mem, + Bi, + Be, + ) end function ARKStepGetEstLocalErrors(arkode_mem, ele::N_Vector) - ccall((:ARKStepGetEstLocalErrors, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, ele) + ccall( + (:ARKStepGetEstLocalErrors, libsundials_arkode), + Cint, + (ARKStepMemPtr, N_Vector), + arkode_mem, + ele, + ) end function ARKStepGetEstLocalErrors(arkode_mem, ele) @@ -469,43 +1029,104 @@ function ARKStepGetEstLocalErrors(arkode_mem, ele) end function ARKStepGetWorkSpace(arkode_mem, lenrw, leniw) - ccall((:ARKStepGetWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrw, leniw) + ccall( + (:ARKStepGetWorkSpace, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + lenrw, + leniw, + ) end function ARKStepGetNumSteps(arkode_mem, nsteps) - ccall((:ARKStepGetNumSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nsteps) + ccall( + (:ARKStepGetNumSteps, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nsteps, + ) end function ARKStepGetActualInitStep(arkode_mem, hinused) - ccall((:ARKStepGetActualInitStep, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, hinused) + ccall( + (:ARKStepGetActualInitStep, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{realtype}), + arkode_mem, + hinused, + ) end function ARKStepGetLastStep(arkode_mem, hlast) - ccall((:ARKStepGetLastStep, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, hlast) + ccall( + (:ARKStepGetLastStep, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{realtype}), + arkode_mem, + hlast, + ) end function ARKStepGetCurrentStep(arkode_mem, hcur) - ccall((:ARKStepGetCurrentStep, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, hcur) + ccall( + (:ARKStepGetCurrentStep, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{realtype}), + arkode_mem, + hcur, + ) end function ARKStepGetCurrentTime(arkode_mem, tcur) - ccall((:ARKStepGetCurrentTime, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, tcur) + ccall( + (:ARKStepGetCurrentTime, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{realtype}), + arkode_mem, + tcur, + ) end function ARKStepGetCurrentState(arkode_mem, ycur) - ccall((:ARKStepGetCurrentState, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{N_Vector}), arkode_mem, ycur) + ccall( + (:ARKStepGetCurrentState, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{N_Vector}), + arkode_mem, + ycur, + ) end function ARKStepGetCurrentGamma(arkode_mem, gamma) - ccall((:ARKStepGetCurrentGamma, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, gamma) + ccall( + (:ARKStepGetCurrentGamma, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{realtype}), + arkode_mem, + gamma, + ) end function ARKStepGetTolScaleFactor(arkode_mem, tolsfac) - ccall((:ARKStepGetTolScaleFactor, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, tolsfac) + ccall( + (:ARKStepGetTolScaleFactor, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{realtype}), + arkode_mem, + tolsfac, + ) end function ARKStepGetErrWeights(arkode_mem, eweight::N_Vector) - ccall((:ARKStepGetErrWeights, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, eweight) + ccall( + (:ARKStepGetErrWeights, libsundials_arkode), + Cint, + (ARKStepMemPtr, N_Vector), + arkode_mem, + eweight, + ) end function ARKStepGetErrWeights(arkode_mem, eweight) @@ -514,7 +1135,13 @@ function ARKStepGetErrWeights(arkode_mem, eweight) end function ARKStepGetResWeights(arkode_mem, rweight::N_Vector) - ccall((:ARKStepGetResWeights, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, rweight) + ccall( + (:ARKStepGetResWeights, libsundials_arkode), + Cint, + (ARKStepMemPtr, N_Vector), + arkode_mem, + rweight, + ) end function ARKStepGetResWeights(arkode_mem, rweight) @@ -523,15 +1150,33 @@ function ARKStepGetResWeights(arkode_mem, rweight) end function ARKStepGetNumGEvals(arkode_mem, ngevals) - ccall((:ARKStepGetNumGEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, ngevals) + ccall( + (:ARKStepGetNumGEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + ngevals, + ) end function ARKStepGetRootInfo(arkode_mem, rootsfound) - ccall((:ARKStepGetRootInfo, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Cint}), arkode_mem, rootsfound) + ccall( + (:ARKStepGetRootInfo, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Cint}), + arkode_mem, + rootsfound, + ) end function ARKStepGetNumConstrFails(arkode_mem, nconstrfails) - ccall((:ARKStepGetNumConstrFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nconstrfails) + ccall( + (:ARKStepGetNumConstrFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nconstrfails, + ) end function ARKStepGetReturnFlagName(flag::Clong) @@ -543,115 +1188,321 @@ function ARKStepGetReturnFlagName(flag) end function ARKStepWriteParameters(arkode_mem, fp) - ccall((:ARKStepWriteParameters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, fp) + ccall( + (:ARKStepWriteParameters, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{FILE}), + arkode_mem, + fp, + ) end function ARKStepWriteButcher(arkode_mem, fp) - ccall((:ARKStepWriteButcher, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, fp) -end - -function ARKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfe_evals, nfi_evals, nlinsetups, netfails) - ccall((:ARKStepGetTimestepperStats, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), arkode_mem, expsteps, accsteps, step_attempts, nfe_evals, nfi_evals, nlinsetups, netfails) + ccall( + (:ARKStepWriteButcher, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{FILE}), + arkode_mem, + fp, + ) +end + +function ARKStepGetTimestepperStats( + arkode_mem, + expsteps, + accsteps, + step_attempts, + nfe_evals, + nfi_evals, + nlinsetups, + netfails, +) + ccall( + (:ARKStepGetTimestepperStats, libsundials_arkode), + Cint, + ( + ARKStepMemPtr, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + ), + arkode_mem, + expsteps, + accsteps, + step_attempts, + nfe_evals, + nfi_evals, + nlinsetups, + netfails, + ) end function ARKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) - ccall((:ARKStepGetStepStats, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), arkode_mem, nsteps, hinused, hlast, hcur, tcur) + ccall( + (:ARKStepGetStepStats, libsundials_arkode), + Cint, + ( + ARKStepMemPtr, + Ptr{Clong}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + ), + arkode_mem, + nsteps, + hinused, + hlast, + hcur, + tcur, + ) end function ARKStepGetNumNonlinSolvIters(arkode_mem, nniters) - ccall((:ARKStepGetNumNonlinSolvIters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nniters) + ccall( + (:ARKStepGetNumNonlinSolvIters, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nniters, + ) end function ARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) - ccall((:ARKStepGetNumNonlinSolvConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nncfails) + ccall( + (:ARKStepGetNumNonlinSolvConvFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nncfails, + ) end function ARKStepGetNonlinSolvStats(arkode_mem, nniters, nncfails) - ccall((:ARKStepGetNonlinSolvStats, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, nniters, nncfails) + ccall( + (:ARKStepGetNonlinSolvStats, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + nniters, + nncfails, + ) end function ARKStepGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS) - ccall((:ARKStepGetLinWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwLS, leniwLS) + ccall( + (:ARKStepGetLinWorkSpace, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + lenrwLS, + leniwLS, + ) end function ARKStepGetNumJacEvals(arkode_mem, njevals) - ccall((:ARKStepGetNumJacEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, njevals) + ccall( + (:ARKStepGetNumJacEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + njevals, + ) end function ARKStepGetNumPrecEvals(arkode_mem, npevals) - ccall((:ARKStepGetNumPrecEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, npevals) + ccall( + (:ARKStepGetNumPrecEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + npevals, + ) end function ARKStepGetNumPrecSolves(arkode_mem, npsolves) - ccall((:ARKStepGetNumPrecSolves, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, npsolves) + ccall( + (:ARKStepGetNumPrecSolves, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + npsolves, + ) end function ARKStepGetNumLinIters(arkode_mem, nliters) - ccall((:ARKStepGetNumLinIters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nliters) + ccall( + (:ARKStepGetNumLinIters, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nliters, + ) end function ARKStepGetNumLinConvFails(arkode_mem, nlcfails) - ccall((:ARKStepGetNumLinConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nlcfails) + ccall( + (:ARKStepGetNumLinConvFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nlcfails, + ) end function ARKStepGetNumJTSetupEvals(arkode_mem, njtsetups) - ccall((:ARKStepGetNumJTSetupEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, njtsetups) + ccall( + (:ARKStepGetNumJTSetupEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + njtsetups, + ) end function ARKStepGetNumJtimesEvals(arkode_mem, njvevals) - ccall((:ARKStepGetNumJtimesEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, njvevals) + ccall( + (:ARKStepGetNumJtimesEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + njvevals, + ) end function ARKStepGetNumLinRhsEvals(arkode_mem, nfevalsLS) - ccall((:ARKStepGetNumLinRhsEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nfevalsLS) + ccall( + (:ARKStepGetNumLinRhsEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nfevalsLS, + ) end function ARKStepGetLastLinFlag(arkode_mem, flag) - ccall((:ARKStepGetLastLinFlag, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, flag) + ccall( + (:ARKStepGetLastLinFlag, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + flag, + ) end function ARKStepGetMassWorkSpace(arkode_mem, lenrwMLS, leniwMLS) - ccall((:ARKStepGetMassWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwMLS, leniwMLS) + ccall( + (:ARKStepGetMassWorkSpace, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + lenrwMLS, + leniwMLS, + ) end function ARKStepGetNumMassSetups(arkode_mem, nmsetups) - ccall((:ARKStepGetNumMassSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmsetups) + ccall( + (:ARKStepGetNumMassSetups, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmsetups, + ) end function ARKStepGetNumMassMultSetups(arkode_mem, nmvsetups) - ccall((:ARKStepGetNumMassMultSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmvsetups) + ccall( + (:ARKStepGetNumMassMultSetups, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmvsetups, + ) end function ARKStepGetNumMassMult(arkode_mem, nmvevals) - ccall((:ARKStepGetNumMassMult, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmvevals) + ccall( + (:ARKStepGetNumMassMult, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmvevals, + ) end function ARKStepGetNumMassSolves(arkode_mem, nmsolves) - ccall((:ARKStepGetNumMassSolves, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmsolves) + ccall( + (:ARKStepGetNumMassSolves, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmsolves, + ) end function ARKStepGetNumMassPrecEvals(arkode_mem, nmpevals) - ccall((:ARKStepGetNumMassPrecEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmpevals) + ccall( + (:ARKStepGetNumMassPrecEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmpevals, + ) end function ARKStepGetNumMassPrecSolves(arkode_mem, nmpsolves) - ccall((:ARKStepGetNumMassPrecSolves, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmpsolves) + ccall( + (:ARKStepGetNumMassPrecSolves, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmpsolves, + ) end function ARKStepGetNumMassIters(arkode_mem, nmiters) - ccall((:ARKStepGetNumMassIters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmiters) + ccall( + (:ARKStepGetNumMassIters, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmiters, + ) end function ARKStepGetNumMassConvFails(arkode_mem, nmcfails) - ccall((:ARKStepGetNumMassConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmcfails) + ccall( + (:ARKStepGetNumMassConvFails, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmcfails, + ) end function ARKStepGetNumMTSetups(arkode_mem, nmtsetups) - ccall((:ARKStepGetNumMTSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmtsetups) + ccall( + (:ARKStepGetNumMTSetups, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nmtsetups, + ) end function ARKStepGetLastMassFlag(arkode_mem, flag) - ccall((:ARKStepGetLastMassFlag, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, flag) + ccall( + (:ARKStepGetLastMassFlag, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + flag, + ) end function ARKStepGetLinReturnFlagName(flag::Clong) @@ -667,64 +1518,184 @@ function ARKStepFree(arkode_mem) end function ARKStepPrintMem(arkode_mem, outfile) - ccall((:ARKStepPrintMem, libsundials_arkode), Cvoid, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, outfile) + ccall( + (:ARKStepPrintMem, libsundials_arkode), + Cvoid, + (ARKStepMemPtr, Ptr{FILE}), + arkode_mem, + outfile, + ) end # Julia wrapper for header: arkode_bandpre.h # Automatically generated using Clang.jl - function ARKBandPrecInit(arkode_mem, N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall((:ARKBandPrecInit, libsundials_arkode), Cint, (ARKStepMemPtr, sunindextype, sunindextype, sunindextype), arkode_mem, N, mu, ml) + ccall( + (:ARKBandPrecInit, libsundials_arkode), + Cint, + (ARKStepMemPtr, sunindextype, sunindextype, sunindextype), + arkode_mem, + N, + mu, + ml, + ) end function ARKBandPrecGetWorkSpace(arkode_mem, lenrwLS, leniwLS) - ccall((:ARKBandPrecGetWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwLS, leniwLS) + ccall( + (:ARKBandPrecGetWorkSpace, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + lenrwLS, + leniwLS, + ) end function ARKBandPrecGetNumRhsEvals(arkode_mem, nfevalsBP) - ccall((:ARKBandPrecGetNumRhsEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nfevalsBP) + ccall( + (:ARKBandPrecGetNumRhsEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + nfevalsBP, + ) end # Julia wrapper for header: arkode_bbdpre.h # Automatically generated using Clang.jl - -function ARKBBDPrecInit(arkode_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dqrely::realtype, gloc::ARKLocalFn, cfn::ARKCommFn) - ccall((:ARKBBDPrecInit, libsundials_arkode), Cint, (ARKStepMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, ARKLocalFn, ARKCommFn), arkode_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) -end - -function ARKBBDPrecReInit(arkode_mem, mudq::sunindextype, mldq::sunindextype, dqrely::realtype) - ccall((:ARKBBDPrecReInit, libsundials_arkode), Cint, (ARKStepMemPtr, sunindextype, sunindextype, realtype), arkode_mem, mudq, mldq, dqrely) +function ARKBBDPrecInit( + arkode_mem, + Nlocal::sunindextype, + mudq::sunindextype, + mldq::sunindextype, + mukeep::sunindextype, + mlkeep::sunindextype, + dqrely::realtype, + gloc::ARKLocalFn, + cfn::ARKCommFn, +) + ccall( + (:ARKBBDPrecInit, libsundials_arkode), + Cint, + ( + ARKStepMemPtr, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + ARKLocalFn, + ARKCommFn, + ), + arkode_mem, + Nlocal, + mudq, + mldq, + mukeep, + mlkeep, + dqrely, + gloc, + cfn, + ) +end + +function ARKBBDPrecReInit( + arkode_mem, + mudq::sunindextype, + mldq::sunindextype, + dqrely::realtype, +) + ccall( + (:ARKBBDPrecReInit, libsundials_arkode), + Cint, + (ARKStepMemPtr, sunindextype, sunindextype, realtype), + arkode_mem, + mudq, + mldq, + dqrely, + ) end function ARKBBDPrecGetWorkSpace(arkode_mem, lenrwBBDP, leniwBBDP) - ccall((:ARKBBDPrecGetWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwBBDP, leniwBBDP) + ccall( + (:ARKBBDPrecGetWorkSpace, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + lenrwBBDP, + leniwBBDP, + ) end function ARKBBDPrecGetNumGfnEvals(arkode_mem, ngevalsBBDP) - ccall((:ARKBBDPrecGetNumGfnEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, ngevalsBBDP) + ccall( + (:ARKBBDPrecGetNumGfnEvals, libsundials_arkode), + Cint, + (ARKStepMemPtr, Ptr{Clong}), + arkode_mem, + ngevalsBBDP, + ) end # Julia wrapper for header: arkode_butcher.h # Automatically generated using Clang.jl - function ARKodeButcherTable_Alloc(stages, embedded) - ccall((:ARKodeButcherTable_Alloc, libsundials_arkode), ARKodeButcherTable, (Cint, Cint), stages, embedded) + ccall( + (:ARKodeButcherTable_Alloc, libsundials_arkode), + ARKodeButcherTable, + (Cint, Cint), + stages, + embedded, + ) end function ARKodeButcherTable_Create(s, q::Cint, p::Cint, c::Cint, A, b, d) - ccall((:ARKodeButcherTable_Create, libsundials_arkode), ARKodeButcherTable, (Cint, Cint, Cint, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), s, q, p, c, A, b, d) + ccall( + (:ARKodeButcherTable_Create, libsundials_arkode), + ARKodeButcherTable, + (Cint, Cint, Cint, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), + s, + q, + p, + c, + A, + b, + d, + ) end function ARKodeButcherTable_Create(s, q, p, c, A, b, d) - ARKodeButcherTable_Create(convert(Cint,s), convert(Cint,q), convert(Cint,p), convert(Cint, c), A, b, d) + ARKodeButcherTable_Create( + convert(Cint, s), + convert(Cint, q), + convert(Cint, p), + convert(Cint, c), + A, + b, + d, + ) end function ARKodeButcherTable_Copy(B) - ccall((:ARKodeButcherTable_Copy, libsundials_arkode), ARKodeButcherTable, (ARKodeButcherTable,), B) + ccall( + (:ARKodeButcherTable_Copy, libsundials_arkode), + ARKodeButcherTable, + (ARKodeButcherTable,), + B, + ) end function ARKodeButcherTable_Space(B, liw, lrw) - ccall((:ARKodeButcherTable_Space, libsundials_arkode), Cvoid, (ARKodeButcherTable, Ptr{sunindextype}, Ptr{sunindextype}), B, liw, lrw) + ccall( + (:ARKodeButcherTable_Space, libsundials_arkode), + Cvoid, + (ARKodeButcherTable, Ptr{sunindextype}, Ptr{sunindextype}), + B, + liw, + lrw, + ) end function ARKodeButcherTable_Free(B) @@ -732,22 +1703,49 @@ function ARKodeButcherTable_Free(B) end function ARKodeButcherTable_Write(B, outfile) - ccall((:ARKodeButcherTable_Write, libsundials_arkode), Cvoid, (ARKodeButcherTable, Ptr{Cint}), B, outfile) + ccall( + (:ARKodeButcherTable_Write, libsundials_arkode), + Cvoid, + (ARKodeButcherTable, Ptr{Cint}), + B, + outfile, + ) end function ARKodeButcherTable_CheckOrder(B, q, p, outfile) - ccall((:ARKodeButcherTable_CheckOrder, libsundials_arkode), Cint, (ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), B, q, p, outfile) + ccall( + (:ARKodeButcherTable_CheckOrder, libsundials_arkode), + Cint, + (ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + B, + q, + p, + outfile, + ) end function ARKodeButcherTable_CheckARKOrder(B1, B2, q, p, outfile) - ccall((:ARKodeButcherTable_CheckARKOrder, libsundials_arkode), Cint, (ARKodeButcherTable, ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), B1, B2, q, p, outfile) + ccall( + (:ARKodeButcherTable_CheckARKOrder, libsundials_arkode), + Cint, + (ARKodeButcherTable, ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + B1, + B2, + q, + p, + outfile, + ) end # Julia wrapper for header: arkode_butcher_dirk.h # Automatically generated using Clang.jl - function ARKodeButcherTable_LoadDIRK(imethod::Cint) - ccall((:ARKodeButcherTable_LoadDIRK, libsundials_arkode), ARKodeButcherTable, (Cint,), imethod) + ccall( + (:ARKodeButcherTable_LoadDIRK, libsundials_arkode), + ARKodeButcherTable, + (Cint,), + imethod, + ) end function ARKodeButcherTable_LoadDIRK(imethod) @@ -757,13 +1755,17 @@ end # Julia wrapper for header: arkode_butcher_erk.h # Automatically generated using Clang.jl - function ARKodeButcherTable_LoadERK(imethod::Cint) - ccall((:ARKodeButcherTable_LoadERK, libsundials_arkode), ARKodeButcherTable, (Cint,), imethod) + ccall( + (:ARKodeButcherTable_LoadERK, libsundials_arkode), + ARKodeButcherTable, + (Cint,), + imethod, + ) end function ARKodeButcherTable_LoadERK(imethod) - ARKodeButcherTable_LoadERK(convert(Cint,imethod)) + ARKodeButcherTable_LoadERK(convert(Cint, imethod)) end # Julia wrapper for header: arkode_erkstep.h # Automatically generated using Clang.jl @@ -775,7 +1777,14 @@ end # Automatically generated using Clang.jl function ERKStepCreate(f::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall((:ERKStepCreate, libsundials_arkode), ERKStepMemPtr, (ARKRhsFn, realtype, N_Vector), f, t0, y0) + ccall( + (:ERKStepCreate, libsundials_arkode), + ERKStepMemPtr, + (ARKRhsFn, realtype, N_Vector), + f, + t0, + y0, + ) end function ERKStepCreate(f, t0, y0) @@ -783,8 +1792,25 @@ function ERKStepCreate(f, t0, y0) ERKStepCreate(ARKRhsFn_wrapper(f), t0, convert(N_Vector, __y0)) end -function ERKStepResize(arkode_mem, ynew::N_Vector, hscale::realtype, t0::realtype, resize::ARKVecResizeFn, resize_data) - ccall((:ERKStepResize, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), arkode_mem, ynew, hscale, t0, resize, resize_data) +function ERKStepResize( + arkode_mem, + ynew::N_Vector, + hscale::realtype, + t0::realtype, + resize::ARKVecResizeFn, + resize_data, +) + ccall( + (:ERKStepResize, libsundials_arkode), + Cint, + (ERKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), + arkode_mem, + ynew, + hscale, + t0, + resize, + resize_data, + ) end function ERKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) @@ -793,7 +1819,15 @@ function ERKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) end function ERKStepReInit(arkode_mem, f::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall((:ERKStepReInit, libsundials_arkode), Cint, (ERKStepMemPtr, ARKRhsFn, realtype, N_Vector), arkode_mem, f, t0, y0) + ccall( + (:ERKStepReInit, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKRhsFn, realtype, N_Vector), + arkode_mem, + f, + t0, + y0, + ) end function ARKStepReInit(arkode_mem, f, t0, y0) @@ -802,11 +1836,25 @@ function ARKStepReInit(arkode_mem, f, t0, y0) end function ERKStepSStolerances(arkode_mem, reltol::realtype, abstol::realtype) - ccall((:ERKStepSStolerances, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, realtype), arkode_mem, reltol, abstol) + ccall( + (:ERKStepSStolerances, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype, realtype), + arkode_mem, + reltol, + abstol, + ) end function ERKStepSVtolerances(arkode_mem, reltol::realtype, abstol::N_Vector) - ccall((:ERKStepSVtolerances, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, N_Vector), arkode_mem, reltol, abstol) + ccall( + (:ERKStepSVtolerances, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype, N_Vector), + arkode_mem, + reltol, + abstol, + ) end function ERKStepSVtolerances(arkode_mem, reltol, abstol) @@ -815,11 +1863,24 @@ function ERKStepSVtolerances(arkode_mem, reltol, abstol) end function ERKStepWFtolerances(arkode_mem, efun::ARKEwtFn) - ccall((:ERKStepWFtolerances, libsundials_arkode), Cint, (ERKStepMemPtr, ARKEwtFn), arkode_mem, efun) + ccall( + (:ERKStepWFtolerances, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKEwtFn), + arkode_mem, + efun, + ) end function ERKStepRootInit(arkode_mem, nrtfn::Cint, g::ARKRootFn) - ccall((:ERKStepRootInit, libsundials_arkode), Cint, (ERKStepMemPtr, Cint, ARKRootFn), arkode_mem, nrtfn, g) + ccall( + (:ERKStepRootInit, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint, ARKRootFn), + arkode_mem, + nrtfn, + g, + ) end function ERKStepRootInit(arkode_mem, nrtfn, g::ARKRootFn) @@ -831,7 +1892,13 @@ function ERKStepSetDefaults(arkode_mem) end function ERKStepSetOrder(arkode_mem, maxord::Cint) - ccall((:ERKStepSetOrder, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, maxord) + ccall( + (:ERKStepSetOrder, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + maxord, + ) end function ERKStepSetOrder(arkode_mem, maxord) @@ -839,7 +1906,13 @@ function ERKStepSetOrder(arkode_mem, maxord) end function ERKStepSetInterpolantType(arkode_mem, itype::Cint) - ccall((:ERKStepSetInterpolantType, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, itype) + ccall( + (:ERKStepSetInterpolantType, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + itype, + ) end function ERKStepSetInterpolantType(arkode_mem, itype) @@ -847,7 +1920,13 @@ function ERKStepSetInterpolantType(arkode_mem, itype) end function ERKStepSetInterpolantDegree(arkode_mem, degree::Cint) - ccall((:ERKStepSetInterpolantDegree, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, degree) + ccall( + (:ERKStepSetInterpolantDegree, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + degree, + ) end function ERKStepSetInterpolantDegree(arkode_mem, degree) @@ -855,7 +1934,13 @@ function ERKStepSetInterpolantDegree(arkode_mem, degree) end function ERKStepSetDenseOrder(arkode_mem, dord::Cint) - ccall((:ERKStepSetDenseOrder, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, dord) + ccall( + (:ERKStepSetDenseOrder, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + dord, + ) end function ERKStepSetDenseOrder(arkode_mem, maxord) @@ -863,11 +1948,23 @@ function ERKStepSetDenseOrder(arkode_mem, maxord) end function ERKStepSetTable(arkode_mem, B) - ccall((:ERKStepSetTable, libsundials_arkode), Cint, (ERKStepMemPtr, ARKodeButcherTable), arkode_mem, B) + ccall( + (:ERKStepSetTable, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKodeButcherTable), + arkode_mem, + B, + ) end function ERKStepSetTableNum(arkode_mem, itable::Cint) - ccall((:ERKStepSetTableNum, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, itable) + ccall( + (:ERKStepSetTableNum, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + itable, + ) end function ERKStepSetTableNum(arkode_mem, itable) @@ -875,47 +1972,124 @@ function ERKStepSetTableNum(arkode_mem, itable) end function ERKStepSetCFLFraction(arkode_mem, cfl_frac::realtype) - ccall((:ERKStepSetCFLFraction, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, cfl_frac) + ccall( + (:ERKStepSetCFLFraction, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + cfl_frac, + ) end function ERKStepSetSafetyFactor(arkode_mem, safety::realtype) - ccall((:ERKStepSetSafetyFactor, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, safety) + ccall( + (:ERKStepSetSafetyFactor, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + safety, + ) end function ERKStepSetErrorBias(arkode_mem, bias::realtype) - ccall((:ERKStepSetErrorBias, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, bias) + ccall( + (:ERKStepSetErrorBias, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + bias, + ) end function ERKStepSetMaxGrowth(arkode_mem, mx_growth::realtype) - ccall((:ERKStepSetMaxGrowth, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, mx_growth) + ccall( + (:ERKStepSetMaxGrowth, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + mx_growth, + ) end function ERKStepSetFixedStepBounds(arkode_mem, lb::realtype, ub::realtype) - ccall((:ERKStepSetFixedStepBounds, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, realtype), arkode_mem, lb, ub) -end - -function ERKStepSetAdaptivityMethod(arkode_mem,imethod::Cint, idefault::Cint, pq::Cint, adapt_params) - ccall((:ERKStepSetAdaptivityMethod, libsundials_arkode), Cint, (ERKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), arkode_mem, imethod, idefault, pq, adapt_params) + ccall( + (:ERKStepSetFixedStepBounds, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype, realtype), + arkode_mem, + lb, + ub, + ) +end + +function ERKStepSetAdaptivityMethod( + arkode_mem, + imethod::Cint, + idefault::Cint, + pq::Cint, + adapt_params, +) + ccall( + (:ERKStepSetAdaptivityMethod, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), + arkode_mem, + imethod, + idefault, + pq, + adapt_params, + ) end function ERKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) - ERKStepSetAdaptivityMethod(arkode_mem, convert(Cint, imethod), convert(Cint, idefault), convert(Cint, pq), adapt_params) + ERKStepSetAdaptivityMethod( + arkode_mem, + convert(Cint, imethod), + convert(Cint, idefault), + convert(Cint, pq), + adapt_params, + ) end function ERKStepSetAdaptivityFn(arkode_mem, hfun::ARKAdaptFn, h_data) - ccall((:ERKStepSetAdaptivityFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), arkode_mem, hfun, h_data) + ccall( + (:ERKStepSetAdaptivityFn, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), + arkode_mem, + hfun, + h_data, + ) end function ERKStepSetMaxFirstGrowth(arkode_mem, etamx1::realtype) - ccall((:ERKStepSetMaxFirstGrowth, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, etamx1) + ccall( + (:ERKStepSetMaxFirstGrowth, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + etamx1, + ) end function ERKStepSetMaxEFailGrowth(arkode_mem, etamxf::realtype) - ccall((:ERKStepSetMaxEFailGrowth, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, etamxf) + ccall( + (:ERKStepSetMaxEFailGrowth, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + etamxf, + ) end function ERKStepSetSmallNumEFails(arkode_mem, small_nef::Cint) - ccall((:ERKStepSetSmallNumEFails, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, small_nef) + ccall( + (:ERKStepSetSmallNumEFails, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + small_nef, + ) end function ERKStepSetSmallNumEFails(arkode_mem, small_nef) @@ -924,11 +2098,24 @@ end # Note ARKExpStabFn not implemented in Julia function ERKStepSetStabilityFn(arkode_mem, EStab, estab_data) - ccall((:ERKStepSetStabilityFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), arkode_mem, EStab, estab_data) + ccall( + (:ERKStepSetStabilityFn, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), + arkode_mem, + EStab, + estab_data, + ) end function ERKStepSetMaxErrTestFails(arkode_mem, maxnef::Cint) - ccall((:ERKStepSetMaxErrTestFails, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, maxnef) + ccall( + (:ERKStepSetMaxErrTestFails, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + maxnef, + ) end function ERKStepSetMaxErrTestFails(arkode_mem, maxnef) @@ -936,7 +2123,13 @@ function ERKStepSetMaxErrTestFails(arkode_mem, maxnef) end function ERKStepSetConstraints(arkode_mem, constraints::N_Vector) - ccall((:ERKStepSetConstraints, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector), arkode_mem, constraints) + ccall( + (:ERKStepSetConstraints, libsundials_arkode), + Cint, + (ERKStepMemPtr, N_Vector), + arkode_mem, + constraints, + ) end function ERKStepSetConstraints(arkode_mem, constraints) @@ -945,11 +2138,23 @@ function ERKStepSetConstraints(arkode_mem, constraints) end function ERKStepSetMaxNumSteps(arkode_mem, mxsteps::Clong) - ccall((:ERKStepSetMaxNumSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Clong), arkode_mem, mxsteps) + ccall( + (:ERKStepSetMaxNumSteps, libsundials_arkode), + Cint, + (ERKStepMemPtr, Clong), + arkode_mem, + mxsteps, + ) end function ERKStepSetMaxHnilWarns(arkode_mem, mxhnil::Cint) - ccall((:ERKStepSetMaxHnilWarns, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, mxhnil) + ccall( + (:ERKStepSetMaxHnilWarns, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + mxhnil, + ) end function ERKStepSetMaxHnilWarns(arkode_mem, mxhnil) @@ -957,27 +2162,63 @@ function ERKStepSetMaxHnilWarns(arkode_mem, mxhnil) end function ERKStepSetInitStep(arkode_mem, hin::realtype) - ccall((:ERKStepSetInitStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hin) + ccall( + (:ERKStepSetInitStep, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + hin, + ) end function ERKStepSetMinStep(arkode_mem, hmin::realtype) - ccall((:ERKStepSetMinStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hmin) + ccall( + (:ERKStepSetMinStep, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + hmin, + ) end function ERKStepSetMaxStep(arkode_mem, hmax::realtype) - ccall((:ERKStepSetMaxStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hmax) + ccall( + (:ERKStepSetMaxStep, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + hmax, + ) end function ERKStepSetStopTime(arkode_mem, tstop::realtype) - ccall((:ERKStepSetStopTime, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, tstop) + ccall( + (:ERKStepSetStopTime, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + tstop, + ) end function ERKStepSetFixedStep(arkode_mem, hfixed::realtype) - ccall((:ERKStepSetFixedStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hfixed) + ccall( + (:ERKStepSetFixedStep, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype), + arkode_mem, + hfixed, + ) end function ERKStepSetMaxNumConstrFails(arkode_mem, maxfails::Cint) - ccall((:ERKStepSetMaxNumConstrFails, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, maxfails) + ccall( + (:ERKStepSetMaxNumConstrFails, libsundials_arkode), + Cint, + (ERKStepMemPtr, Cint), + arkode_mem, + maxfails, + ) end function ERKStepSetMaxNumConstrFails(arkode_mem, maxfails) @@ -985,40 +2226,97 @@ function ERKStepSetMaxNumConstrFails(arkode_mem, maxfails) end function ERKStepSetRootDirection(arkode_mem, rootdir) - ccall((:ERKStepSetRootDirection, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Cint}), arkode_mem, rootdir) + ccall( + (:ERKStepSetRootDirection, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Cint}), + arkode_mem, + rootdir, + ) end function ERKStepSetNoInactiveRootWarn(arkode_mem) - ccall((:ERKStepSetNoInactiveRootWarn, libsundials_arkode), Cint, (ERKStepMemPtr,), arkode_mem) + ccall( + (:ERKStepSetNoInactiveRootWarn, libsundials_arkode), + Cint, + (ERKStepMemPtr,), + arkode_mem, + ) end function ERKStepSetErrHandlerFn(arkode_mem, ehfun::ARKErrHandlerFn, eh_data) - ccall((:ERKStepSetErrHandlerFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), arkode_mem, ehfun, eh_data) + ccall( + (:ERKStepSetErrHandlerFn, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), + arkode_mem, + ehfun, + eh_data, + ) end function ERKStepSetErrFile(arkode_mem, errfp) - ccall((:ERKStepSetErrFile, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, errfp) + ccall( + (:ERKStepSetErrFile, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{FILE}), + arkode_mem, + errfp, + ) end function ERKStepSetUserData(arkode_mem, user_data) - ccall((:ERKStepSetUserData, libsundials_arkode), Cint, (ERKStepMemPtr, Any), arkode_mem, user_data) + ccall( + (:ERKStepSetUserData, libsundials_arkode), + Cint, + (ERKStepMemPtr, Any), + arkode_mem, + user_data, + ) end function ERKStepSetDiagnostics(arkode_mem, diagfp) - ccall((:ERKStepSetDiagnostics, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, diagfp) + ccall( + (:ERKStepSetDiagnostics, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{FILE}), + arkode_mem, + diagfp, + ) end #Note, this const was before ARKPostProcessStepFn and now ARKPostProcessFn function ERKStepSetPostprocessStepFn(arkode_mem, ProcessStep::ARKPostProcessFn) - ccall((:ERKStepSetPostprocessStepFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStep) + ccall( + (:ERKStepSetPostprocessStepFn, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKPostProcessFn), + arkode_mem, + ProcessStep, + ) end function ERKStepSetPostprocessStageFn(arkode_mem, ProcessStage::ARKPostProcessFn) - ccall((:ERKStepSetPostprocessStageFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStage) + ccall( + (:ERKStepSetPostprocessStageFn, libsundials_arkode), + Cint, + (ERKStepMemPtr, ARKPostProcessFn), + arkode_mem, + ProcessStage, + ) end function ERKStepEvolve(arkode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall((:ERKStepEvolve, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), arkode_mem, tout, yout, tret, itask) + ccall( + (:ERKStepEvolve, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), + arkode_mem, + tout, + yout, + tret, + itask, + ) end function ERKStepEvolve(arkode_mem, tout, yout, tret, itask) @@ -1027,7 +2325,15 @@ function ERKStepEvolve(arkode_mem, tout, yout, tret, itask) end function ERKStepGetDky(arkode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:ERKStepGetDky, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, Cint, N_Vector), arkode_mem, t, k, dky) + ccall( + (:ERKStepGetDky, libsundials_arkode), + Cint, + (ERKStepMemPtr, realtype, Cint, N_Vector), + arkode_mem, + t, + k, + dky, + ) end function ERKStepGetDky(arkode_mem, t::realtype, k, dky) @@ -1036,31 +2342,73 @@ function ERKStepGetDky(arkode_mem, t::realtype, k, dky) end function ERKStepGetNumExpSteps(arkode_mem, expsteps) - ccall((:ERKStepGetNumExpSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, expsteps) + ccall( + (:ERKStepGetNumExpSteps, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + expsteps, + ) end function ERKStepGetNumAccSteps(arkode_mem, accsteps) - ccall((:ERKStepGetNumAccSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, accsteps) + ccall( + (:ERKStepGetNumAccSteps, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + accsteps, + ) end function ERKStepGetNumStepAttempts(arkode_mem, step_attempts) - ccall((:ERKStepGetNumStepAttempts, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, step_attempts) + ccall( + (:ERKStepGetNumStepAttempts, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + step_attempts, + ) end function ERKStepGetNumRhsEvals(arkode_mem, nfevals) - ccall((:ERKStepGetNumRhsEvals, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, nfevals) + ccall( + (:ERKStepGetNumRhsEvals, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + nfevals, + ) end function ERKStepGetNumErrTestFails(arkode_mem, netfails) - ccall((:ERKStepGetNumErrTestFails, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, netfails) + ccall( + (:ERKStepGetNumErrTestFails, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + netfails, + ) end function ERKStepGetCurrentButcherTable(arkode_mem, B) - ccall((:ERKStepGetCurrentButcherTable, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{ARKodeButcherTable}), arkode_mem, B) + ccall( + (:ERKStepGetCurrentButcherTable, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{ARKodeButcherTable}), + arkode_mem, + B, + ) end function ERKStepGetEstLocalErrors(arkode_mem, ele::N_Vector) - ccall((:ERKStepGetEstLocalErrors, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector), arkode_mem, ele) + ccall( + (:ERKStepGetEstLocalErrors, libsundials_arkode), + Cint, + (ERKStepMemPtr, N_Vector), + arkode_mem, + ele, + ) end function ERKStepGetEstLocalErrors(arkode_mem, ele) @@ -1069,35 +2417,84 @@ function ERKStepGetEstLocalErrors(arkode_mem, ele) end function ERKStepGetWorkSpace(arkode_mem, lenrw, leniw) - ccall((:ERKStepGetWorkSpace, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrw, leniw) + ccall( + (:ERKStepGetWorkSpace, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + lenrw, + leniw, + ) end function ERKStepGetNumSteps(arkode_mem, nsteps) - ccall((:ERKStepGetNumSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, nsteps) + ccall( + (:ERKStepGetNumSteps, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + nsteps, + ) end function ERKStepGetActualInitStep(arkode_mem, hinused) - ccall((:ERKStepGetActualInitStep, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, hinused) + ccall( + (:ERKStepGetActualInitStep, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{realtype}), + arkode_mem, + hinused, + ) end function ERKStepGetLastStep(arkode_mem, hlast) - ccall((:ERKStepGetLastStep, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, hlast) + ccall( + (:ERKStepGetLastStep, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{realtype}), + arkode_mem, + hlast, + ) end function ERKStepGetCurrentStep(arkode_mem, hcur) - ccall((:ERKStepGetCurrentStep, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, hcur) + ccall( + (:ERKStepGetCurrentStep, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{realtype}), + arkode_mem, + hcur, + ) end function ERKStepGetCurrentTime(arkode_mem, tcur) - ccall((:ERKStepGetCurrentTime, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, tcur) + ccall( + (:ERKStepGetCurrentTime, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{realtype}), + arkode_mem, + tcur, + ) end function ERKStepGetTolScaleFactor(arkode_mem, tolsfac) - ccall((:ERKStepGetTolScaleFactor, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, tolsfac) + ccall( + (:ERKStepGetTolScaleFactor, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{realtype}), + arkode_mem, + tolsfac, + ) end function ERKStepGetErrWeights(arkode_mem, eweight::N_Vector) - ccall((:ERKStepGetErrWeights, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector), arkode_mem, eweight) + ccall( + (:ERKStepGetErrWeights, libsundials_arkode), + Cint, + (ERKStepMemPtr, N_Vector), + arkode_mem, + eweight, + ) end function ERKStepGetErrWeights(arkode_mem, eweight) @@ -1106,15 +2503,33 @@ function ERKStepGetErrWeights(arkode_mem, eweight) end function ERKStepGetNumGEvals(arkode_mem, ngevals) - ccall((:ERKStepGetNumGEvals, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, ngevals) + ccall( + (:ERKStepGetNumGEvals, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + ngevals, + ) end function ERKStepGetRootInfo(arkode_mem, rootsfound) - ccall((:ERKStepGetRootInfo, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Cint}), arkode_mem, rootsfound) + ccall( + (:ERKStepGetRootInfo, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Cint}), + arkode_mem, + rootsfound, + ) end function ERKStepGetNumConstrFails(arkode_mem, nconstrfails) - ccall((:ERKStepGetNumConstrFails, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, nconstrfails) + ccall( + (:ERKStepGetNumConstrFails, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}), + arkode_mem, + nconstrfails, + ) end function ERKStepGetReturnFlagName(flag::Clong) @@ -1122,19 +2537,65 @@ function ERKStepGetReturnFlagName(flag::Clong) end function ERKStepWriteParameters(arkode_mem, fp) - ccall((:ERKStepWriteParameters, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, fp) + ccall( + (:ERKStepWriteParameters, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{FILE}), + arkode_mem, + fp, + ) end function ERKStepWriteButcher(arkode_mem, fp) - ccall((:ERKStepWriteButcher, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, fp) -end - -function ERKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfevals, netfails) - ccall((:ERKStepGetTimestepperStats, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), arkode_mem, expsteps, accsteps, step_attempts, nfevals, netfails) + ccall( + (:ERKStepWriteButcher, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{FILE}), + arkode_mem, + fp, + ) +end + +function ERKStepGetTimestepperStats( + arkode_mem, + expsteps, + accsteps, + step_attempts, + nfevals, + netfails, +) + ccall( + (:ERKStepGetTimestepperStats, libsundials_arkode), + Cint, + (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + expsteps, + accsteps, + step_attempts, + nfevals, + netfails, + ) end function ERKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) - ccall((:ERKStepGetStepStats, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), arkode_mem, nsteps, hinused, hlast, hcur, tcur) + ccall( + (:ERKStepGetStepStats, libsundials_arkode), + Cint, + ( + ERKStepMemPtr, + Ptr{Clong}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + ), + arkode_mem, + nsteps, + hinused, + hlast, + hcur, + tcur, + ) end function ERKStepFree(arkode_mem) @@ -1142,7 +2603,13 @@ function ERKStepFree(arkode_mem) end function ERKStepPrintMem(arkode_mem, outfile) - ccall((:ERKStepPrintMem, libsundials_arkode), Cvoid, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, outfile) + ccall( + (:ERKStepPrintMem, libsundials_arkode), + Cvoid, + (ERKStepMemPtr, Ptr{FILE}), + arkode_mem, + outfile, + ) end # Julia wrapper for header: arkode_ls.h # Automatically generated using Clang.jl @@ -1150,18 +2617,47 @@ end # Julia wrapper for header: arkode_mristep.h # Automatically generated using Clang.jl - -function MRIStepCreate(fs::ARKRhsFn, t0::realtype, y0::N_Vector, inner_step_id, inner_step_mem) - ccall((:MRIStepCreate, libsundials_arkode), MRIStepMemPtr, (ARKRhsFn, realtype, N_Vector, Sundials.MRISTEP_ID, Ptr{Cvoid}), fs, t0, y0, inner_step_id, inner_step_mem) +function MRIStepCreate( + fs::ARKRhsFn, + t0::realtype, + y0::N_Vector, + inner_step_id, + inner_step_mem, +) + ccall( + (:MRIStepCreate, libsundials_arkode), + MRIStepMemPtr, + (ARKRhsFn, realtype, N_Vector, Sundials.MRISTEP_ID, Ptr{Cvoid}), + fs, + t0, + y0, + inner_step_id, + inner_step_mem, + ) end function MRIStepCreate(fs, t0::realtype, y0, inner_step_mem) __y0 = convert(NVector, y0) - return MRIStepCreate(ARKRhsFn_wrapper(fs), t0, convert(N_Vector, __y0), Sundials.MRISTEP_ARKSTEP, inner_step_mem) + return MRIStepCreate( + ARKRhsFn_wrapper(fs), + t0, + convert(N_Vector, __y0), + Sundials.MRISTEP_ARKSTEP, + inner_step_mem, + ) end function MRIStepResize(arkode_mem, ynew::N_Vector, t0::realtype, resize, resize_data) - ccall((:MRIStepResize, libsundials_arkode), Cint, (MRIStepMemPtr, N_Vector, realtype, ARKVecResizeFn, Ptr{Cvoid}), arkode_mem, ynew, t0, resize, resize_data) + ccall( + (:MRIStepResize, libsundials_arkode), + Cint, + (MRIStepMemPtr, N_Vector, realtype, ARKVecResizeFn, Ptr{Cvoid}), + arkode_mem, + ynew, + t0, + resize, + resize_data, + ) end function MRIStepResize(arkode_mem, ynew, t0::realtype, resize, resize_data) @@ -1170,7 +2666,15 @@ function MRIStepResize(arkode_mem, ynew, t0::realtype, resize, resize_data) end function MRIStepReInit(arkode_mem, fs::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall((:MRIStepReInit, libsundials_arkode), Cint, (MRIStepMemPtr, ARKRhsFn, realtype, N_Vector), arkode_mem, fs, t0, y0) + ccall( + (:MRIStepReInit, libsundials_arkode), + Cint, + (MRIStepMemPtr, ARKRhsFn, realtype, N_Vector), + arkode_mem, + fs, + t0, + y0, + ) end function MRIStepReInit(arkode_mem, fs, t0, y0) @@ -1179,7 +2683,14 @@ function MRIStepReInit(arkode_mem, fs, t0, y0) end function MRIStepRootInit(arkode_mem, nrtfn::Cint, g::ARKRootFn) - ccall((:MRIStepRootInit, libsundials_arkode), Cint, (MRIStepMemPtr, Cint, ARKRootFn), arkode_mem, nrtfn, g) + ccall( + (:MRIStepRootInit, libsundials_arkode), + Cint, + (MRIStepMemPtr, Cint, ARKRootFn), + arkode_mem, + nrtfn, + g, + ) end function MRIStepRootInit(arkode_mem, nrtfn, g::ARKRootFn) @@ -1191,7 +2702,13 @@ function MRIStepSetDefaults(arkode_mem) end function MRIStepSetInterpolantType(arkode_mem, itype::Cint) - ccall((:MRIStepSetInterpolantType, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, itype) + ccall( + (:MRIStepSetInterpolantType, libsundials_arkode), + Cint, + (MRIStepMemPtr, Cint), + arkode_mem, + itype, + ) end function MRIStepSetInterpolantType(arkode_mem, itype) @@ -1199,7 +2716,13 @@ function MRIStepSetInterpolantType(arkode_mem, itype) end function MRIStepSetInterpolantDegree(arkode_mem, degree::Cint) - ccall((:MRIStepSetInterpolantDegree, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, degree) + ccall( + (:MRIStepSetInterpolantDegree, libsundials_arkode), + Cint, + (MRIStepMemPtr, Cint), + arkode_mem, + degree, + ) end function MRIStepSetInterpolantDegree(arkode_mem, degree) @@ -1207,7 +2730,13 @@ function MRIStepSetInterpolantDegree(arkode_mem, degree) end function MRIStepSetDenseOrder(arkode_mem, dord::Cint) - ccall((:MRIStepSetDenseOrder, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, dord) + ccall( + (:MRIStepSetDenseOrder, libsundials_arkode), + Cint, + (MRIStepMemPtr, Cint), + arkode_mem, + dord, + ) end function MRIStepDenseSetOrder(arkode_mem, dord) @@ -1215,7 +2744,14 @@ function MRIStepDenseSetOrder(arkode_mem, dord) end function MRIStepSetTable(arkode_mem, q::Cint, B) - ccall((:MRIStepSetTable, libsundials_arkode), Cint, (MRIStepMemPtr, Cint, ARKodeButcherTable), arkode_mem, q, B) + ccall( + (:MRIStepSetTable, libsundials_arkode), + Cint, + (MRIStepMemPtr, Cint, ARKodeButcherTable), + arkode_mem, + q, + B, + ) end function MRIStepSetTable(arkode_mem, q, B) @@ -1223,7 +2759,13 @@ function MRIStepSetTable(arkode_mem, q, B) end function MRIStepSetTableNum(arkode_mem, itable::Cint) - ccall((:MRIStepSetTableNum, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, itable) + ccall( + (:MRIStepSetTableNum, libsundials_arkode), + Cint, + (MRIStepMemPtr, Cint), + arkode_mem, + itable, + ) end function MRIStepSetTableNum(arkode_mem, itable) @@ -1231,11 +2773,23 @@ function MRIStepSetTableNum(arkode_mem, itable) end function MRIStepSetMaxNumSteps(arkode_mem, mxsteps::Clong) - ccall((:MRIStepSetMaxNumSteps, libsundials_arkode), Cint, (MRIStepMemPtr, Clong), arkode_mem, mxsteps) + ccall( + (:MRIStepSetMaxNumSteps, libsundials_arkode), + Cint, + (MRIStepMemPtr, Clong), + arkode_mem, + mxsteps, + ) end function MRIStepSetMaxHnilWarns(arkode_mem, mxhnil::Cint) - ccall((:MRIStepSetMaxHnilWarns, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, mxhnil) + ccall( + (:MRIStepSetMaxHnilWarns, libsundials_arkode), + Cint, + (MRIStepMemPtr, Cint), + arkode_mem, + mxhnil, + ) end function MRIStepSetMaxHnilWarns(arkode_mem, mxhnil) @@ -1243,58 +2797,139 @@ function MRIStepSetMaxHnilWarns(arkode_mem, mxhnil) end function MRIStepSetStopTime(arkode_mem, tstop) - ccall((:MRIStepSetStopTime, libsundials_arkode), Cint, (MRIStepMemPtr, realtype), arkode_mem, tstop) + ccall( + (:MRIStepSetStopTime, libsundials_arkode), + Cint, + (MRIStepMemPtr, realtype), + arkode_mem, + tstop, + ) end function MRIStepSetFixedStep(arkode_mem, hsfixed::realtype) - ccall((:MRIStepSetFixedStep, libsundials_arkode), Cint, (MRIStepMemPtr, realtype), arkode_mem, hsfixed) + ccall( + (:MRIStepSetFixedStep, libsundials_arkode), + Cint, + (MRIStepMemPtr, realtype), + arkode_mem, + hsfixed, + ) end function MRIStepSetRootDirection(arkode_mem, rootdir) - ccall((:MRIStepSetRootDirection, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Cint}), arkode_mem, rootdir) + ccall( + (:MRIStepSetRootDirection, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{Cint}), + arkode_mem, + rootdir, + ) end function MRIStepSetNoInactiveRootWarn(arkode_mem) - ccall((:MRIStepSetNoInactiveRootWarn, libsundials_arkode), Cint, (MRIStepMemPtr,), arkode_mem) + ccall( + (:MRIStepSetNoInactiveRootWarn, libsundials_arkode), + Cint, + (MRIStepMemPtr,), + arkode_mem, + ) end function MRIStepSetErrHandlerFn(arkode_mem, ehfun::ARKErrHandlerFn, eh_data) - ccall((:MRIStepSetErrHandlerFn, libsundials_arkode), Cint, (MRIStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), arkode_mem, ehfun, eh_data) + ccall( + (:MRIStepSetErrHandlerFn, libsundials_arkode), + Cint, + (MRIStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), + arkode_mem, + ehfun, + eh_data, + ) end function MRIStepSetErrFile(arkode_mem, errfp) - ccall((:MRIStepSetErrFile, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, errfp) + ccall( + (:MRIStepSetErrFile, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{FILE}), + arkode_mem, + errfp, + ) end function MRIStepSetUserData(arkode_mem, user_data) - ccall((:MRIStepSetUserData, libsundials_arkode), Cint, (MRIStepMemPtr, Any), arkode_mem, user_data) + ccall( + (:MRIStepSetUserData, libsundials_arkode), + Cint, + (MRIStepMemPtr, Any), + arkode_mem, + user_data, + ) end function MRIStepSetDiagnostics(arkode_mem, diagfp) - ccall((:MRIStepSetDiagnostics, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, diagfp) + ccall( + (:MRIStepSetDiagnostics, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{FILE}), + arkode_mem, + diagfp, + ) end #new ARKPostProcessFn type. Before it was ARKPostProcessStepFn function MRIStepSetPostprocessStepFn(arkode_mem, ProcessStep::ARKPostProcessFn) - ccall((:MRIStepSetPostprocessStepFn, libsundials_arkode), Cint, (MRIStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStep) + ccall( + (:MRIStepSetPostprocessStepFn, libsundials_arkode), + Cint, + (MRIStepMemPtr, ARKPostProcessFn), + arkode_mem, + ProcessStep, + ) end function MRIStepSetPostprocessStageFn(arkode_mem, ProcessStage::ARKPostProcessFn) - ccall((:MRIStepSetPostprocessStageFn, libsundials_arkode), Cint, (MRIStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStage) + ccall( + (:MRIStepSetPostprocessStageFn, libsundials_arkode), + Cint, + (MRIStepMemPtr, ARKPostProcessFn), + arkode_mem, + ProcessStage, + ) end #This one does not have MRIStepPreInnerFn function MRIStepSetPreInnerFn(arkode_mem, prefn::MRIStepPreInnerFn) - ccall((:MRIStepSetPreInnerFn, libsundials_arkode), Cint, (MRIStepMemPtr, MRIStepPreInnerFn), arkode_mem, prefn) + ccall( + (:MRIStepSetPreInnerFn, libsundials_arkode), + Cint, + (MRIStepMemPtr, MRIStepPreInnerFn), + arkode_mem, + prefn, + ) end #This one does not have MRIStepPostInnerFn function MRIStepSetPostInnerFn(arkode_mem, postfn::MRIStepPostInnerFn) - ccall((:MRIStepSetPostInnerFn, libsundials_arkode), Cint, (MRIStepMemPtr, MRIStepPostInnerFn), arkode_mem, postfn) + ccall( + (:MRIStepSetPostInnerFn, libsundials_arkode), + Cint, + (MRIStepMemPtr, MRIStepPostInnerFn), + arkode_mem, + postfn, + ) end function MRIStepEvolve(arkode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall((:MRIStepEvolve, libsundials_arkode), Cint, (MRIStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), arkode_mem, tout, yout, tret, itask) + ccall( + (:MRIStepEvolve, libsundials_arkode), + Cint, + (MRIStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), + arkode_mem, + tout, + yout, + tret, + itask, + ) end function MRIStepEvolve(arkode_mem, tout, yout, tret, itask) @@ -1303,7 +2938,15 @@ function MRIStepEvolve(arkode_mem, tout, yout, tret, itask) end function MRIStepGetDky(arkode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:MRIStepGetDky, libsundials_arkode), Cint, (MRIStepMemPtr, realtype, Cint, N_Vector), arkode_mem, t, k, dky) + ccall( + (:MRIStepGetDky, libsundials_arkode), + Cint, + (MRIStepMemPtr, realtype, Cint, N_Vector), + arkode_mem, + t, + k, + dky, + ) end function MRIStepGetDky(arkode_mem, t::realtype, k, dky) @@ -1312,43 +2955,104 @@ function MRIStepGetDky(arkode_mem, t::realtype, k, dky) end function MRIStepGetNumRhsEvals(arkode_mem, nfs_evals) - ccall((:MRIStepGetNumRhsEvals, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}), arkode_mem, nfs_evals) + ccall( + (:MRIStepGetNumRhsEvals, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{Clong}), + arkode_mem, + nfs_evals, + ) end function MRIStepGetCurrentButcherTables(arkode_mem, B) - ccall((:MRIStepGetCurrentButcherTables, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{ARKodeButcherTable}), arkode_mem, B) + ccall( + (:MRIStepGetCurrentButcherTables, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{ARKodeButcherTable}), + arkode_mem, + B, + ) end function MRIStepGetWorkSpace(arkode_mem, lenrw, leniw) - ccall((:MRIStepGetWorkSpace, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrw, leniw) + ccall( + (:MRIStepGetWorkSpace, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{Clong}, Ptr{Clong}), + arkode_mem, + lenrw, + leniw, + ) end function MRIStepGetNumSteps(arkode_mem, nssteps) - ccall((:MRIStepGetNumSteps, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}), arkode_mem, nssteps) + ccall( + (:MRIStepGetNumSteps, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{Clong}), + arkode_mem, + nssteps, + ) end function MRIStepGetLastStep(arkode_mem, hlast) - ccall((:MRIStepGetLastStep, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{realtype}), arkode_mem, hlast) + ccall( + (:MRIStepGetLastStep, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{realtype}), + arkode_mem, + hlast, + ) end function MRIStepGetCurrentTime(arkode_mem, tcur) - ccall((:MRIStepGetCurrentTime, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{realtype}), arkode_mem, tcur) + ccall( + (:MRIStepGetCurrentTime, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{realtype}), + arkode_mem, + tcur, + ) end function MRIStepGetCurrentState(arkode_mem, ycur) - ccall((:MRIStepGetCurrentState, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{N_Vector}), arkode_mem, ycur) + ccall( + (:MRIStepGetCurrentState, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{N_Vector}), + arkode_mem, + ycur, + ) end function MRIStepGetNumGEvals(arkode_mem, ngevals) - ccall((:MRIStepGetNumGEvals, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}), arkode_mem, ngevals) + ccall( + (:MRIStepGetNumGEvals, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{Clong}), + arkode_mem, + ngevals, + ) end function MRIStepGetRootInfo(arkode_mem, rootsfound) - ccall((:MRIStepGetRootInfo, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Cint}), arkode_mem, rootsfound) + ccall( + (:MRIStepGetRootInfo, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{Cint}), + arkode_mem, + rootsfound, + ) end function MRIStepGetLastInnerStepFlag(arkode_mem, flag) - ccall((:MRIStepGetLastInnerStepFlag, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Cint}), arkode_mem, flag) + ccall( + (:MRIStepGetLastInnerStepFlag, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{Cint}), + arkode_mem, + flag, + ) end function MRIStepGetReturnFlagName(flag) @@ -1356,11 +3060,23 @@ function MRIStepGetReturnFlagName(flag) end function MRIStepWriteParameters(arkode_mem, fp) - ccall((:MRIStepWriteParameters, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, fp) + ccall( + (:MRIStepWriteParameters, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{FILE}), + arkode_mem, + fp, + ) end function MRIStepWriteButcher(arkode_mem, fp) - ccall((:MRIStepWriteButcher, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, fp) + ccall( + (:MRIStepWriteButcher, libsundials_arkode), + Cint, + (MRIStepMemPtr, Ptr{FILE}), + arkode_mem, + fp, + ) end function MRIStepFree(arkode_mem) @@ -1368,5 +3084,11 @@ function MRIStepFree(arkode_mem) end function MRIStepPrintMem(arkode_mem, outfile) - ccall((:MRIStepPrintMem, libsundials_arkode), Cvoid, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, outfile) + ccall( + (:MRIStepPrintMem, libsundials_arkode), + Cvoid, + (MRIStepMemPtr, Ptr{FILE}), + arkode_mem, + outfile, + ) end diff --git a/src/API/cvode.jl b/src/API/cvode.jl index 5b39ff37..8f70d07a 100644 --- a/src/API/cvode.jl +++ b/src/API/cvode.jl @@ -1,7 +1,6 @@ # Julia wrapper for header: cvode.h # Automatically generated using Clang.jl - function CVodeCreate(lmm::Cint) ccall((:CVodeCreate, libsundials_cvode), CVODEMemPtr, (Cint,), lmm) end @@ -11,7 +10,15 @@ function CVodeCreate(lmm) end function CVodeInit(cvode_mem, f::CVRhsFn, t0::realtype, y0::N_Vector) - ccall((:CVodeInit, libsundials_cvode), Cint, (CVODEMemPtr, CVRhsFn, realtype, N_Vector), cvode_mem, f, t0, y0) + ccall( + (:CVodeInit, libsundials_cvode), + Cint, + (CVODEMemPtr, CVRhsFn, realtype, N_Vector), + cvode_mem, + f, + t0, + y0, + ) end function CVodeInit(cvode_mem, f, t0, y0) @@ -20,7 +27,14 @@ function CVodeInit(cvode_mem, f, t0, y0) end function CVodeReInit(cvode_mem, t0::realtype, y0::N_Vector) - ccall((:CVodeReInit, libsundials_cvode), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, t0, y0) + ccall( + (:CVodeReInit, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype, N_Vector), + cvode_mem, + t0, + y0, + ) end function CVodeReInit(cvode_mem, t0, y0) @@ -29,11 +43,25 @@ function CVodeReInit(cvode_mem, t0, y0) end function CVodeSStolerances(cvode_mem, reltol::realtype, abstol::realtype) - ccall((:CVodeSStolerances, libsundials_cvode), Cint, (CVODEMemPtr, realtype, realtype), cvode_mem, reltol, abstol) + ccall( + (:CVodeSStolerances, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype, realtype), + cvode_mem, + reltol, + abstol, + ) end function CVodeSVtolerances(cvode_mem, reltol::realtype, abstol::N_Vector) - ccall((:CVodeSVtolerances, libsundials_cvode), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, reltol, abstol) + ccall( + (:CVodeSVtolerances, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype, N_Vector), + cvode_mem, + reltol, + abstol, + ) end function CVodeSVtolerances(cvode_mem, reltol, abstol) @@ -42,23 +70,54 @@ function CVodeSVtolerances(cvode_mem, reltol, abstol) end function CVodeWFtolerances(cvode_mem, efun::CVEwtFn) - ccall((:CVodeWFtolerances, libsundials_cvode), Cint, (CVODEMemPtr, CVEwtFn), cvode_mem, efun) + ccall( + (:CVodeWFtolerances, libsundials_cvode), + Cint, + (CVODEMemPtr, CVEwtFn), + cvode_mem, + efun, + ) end function CVodeSetErrHandlerFn(cvode_mem, ehfun::CVErrHandlerFn, eh_data) - ccall((:CVodeSetErrHandlerFn, libsundials_cvode), Cint, (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), cvode_mem, ehfun, eh_data) + ccall( + (:CVodeSetErrHandlerFn, libsundials_cvode), + Cint, + (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), + cvode_mem, + ehfun, + eh_data, + ) end function CVodeSetErrFile(cvode_mem, errfp) - ccall((:CVodeSetErrFile, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{FILE}), cvode_mem, errfp) + ccall( + (:CVodeSetErrFile, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{FILE}), + cvode_mem, + errfp, + ) end function CVodeSetUserData(cvode_mem, user_data) - ccall((:CVodeSetUserData, libsundials_cvode), Cint, (CVODEMemPtr, Any), cvode_mem, user_data) + ccall( + (:CVodeSetUserData, libsundials_cvode), + Cint, + (CVODEMemPtr, Any), + cvode_mem, + user_data, + ) end function CVodeSetMaxOrd(cvode_mem, maxord::Cint) - ccall((:CVodeSetMaxOrd, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxord) + ccall( + (:CVodeSetMaxOrd, libsundials_cvode), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxord, + ) end function CVodeSetMaxOrd(cvode_mem, maxord) @@ -66,7 +125,13 @@ function CVodeSetMaxOrd(cvode_mem, maxord) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps::Clong) - ccall((:CVodeSetMaxNumSteps, libsundials_cvode), Cint, (CVODEMemPtr, Clong), cvode_mem, mxsteps) + ccall( + (:CVodeSetMaxNumSteps, libsundials_cvode), + Cint, + (CVODEMemPtr, Clong), + cvode_mem, + mxsteps, + ) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps) @@ -74,7 +139,13 @@ function CVodeSetMaxNumSteps(cvode_mem, mxsteps) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil::Clong) - ccall((:CVodeSetMaxHnilWarns, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, mxhnil) + ccall( + (:CVodeSetMaxHnilWarns, libsundials_cvode), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + mxhnil, + ) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) @@ -82,7 +153,13 @@ function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) end function CVodeSetStabLimDet(cvode_mem, stldet::Cint) - ccall((:CVodeSetStabLimDet, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, stldet) + ccall( + (:CVodeSetStabLimDet, libsundials_cvode), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + stldet, + ) end function CVodeSetStabLimDet(cvode_mem, stldet) @@ -90,23 +167,53 @@ function CVodeSetStabLimDet(cvode_mem, stldet) end function CVodeSetInitStep(cvode_mem, hin::realtype) - ccall((:CVodeSetInitStep, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, hin) + ccall( + (:CVodeSetInitStep, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + hin, + ) end function CVodeSetMinStep(cvode_mem, hmin::realtype) - ccall((:CVodeSetMinStep, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, hmin) + ccall( + (:CVodeSetMinStep, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + hmin, + ) end function CVodeSetMaxStep(cvode_mem, hmax::realtype) - ccall((:CVodeSetMaxStep, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, hmax) + ccall( + (:CVodeSetMaxStep, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + hmax, + ) end function CVodeSetStopTime(cvode_mem, tstop::realtype) - ccall((:CVodeSetStopTime, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, tstop) + ccall( + (:CVodeSetStopTime, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + tstop, + ) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef::Cint) - ccall((:CVodeSetMaxErrTestFails, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxnef) + ccall( + (:CVodeSetMaxErrTestFails, libsundials_cvode), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxnef, + ) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef) @@ -114,7 +221,13 @@ function CVodeSetMaxErrTestFails(cvode_mem, maxnef) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor::Cint) - ccall((:CVodeSetMaxNonlinIters, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxcor) + ccall( + (:CVodeSetMaxNonlinIters, libsundials_cvode), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxcor, + ) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor) @@ -122,7 +235,13 @@ function CVodeSetMaxNonlinIters(cvode_mem, maxcor) end function CVodeSetMaxConvFails(cvode_mem, maxncf::Cint) - ccall((:CVodeSetMaxConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxncf) + ccall( + (:CVodeSetMaxConvFails, libsundials_cvode), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxncf, + ) end function CVodeSetMaxConvFails(cvode_mem, maxncf) @@ -130,11 +249,23 @@ function CVodeSetMaxConvFails(cvode_mem, maxncf) end function CVodeSetNonlinConvCoef(cvode_mem, nlscoef::realtype) - ccall((:CVodeSetNonlinConvCoef, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, nlscoef) + ccall( + (:CVodeSetNonlinConvCoef, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + nlscoef, + ) end function CVodeSetConstraints(cvode_mem, constraints::N_Vector) - ccall((:CVodeSetConstraints, libsundials_cvode), Cint, (CVODEMemPtr, N_Vector), cvode_mem, constraints) + ccall( + (:CVodeSetConstraints, libsundials_cvode), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + constraints, + ) end function CVodeSetConstraints(cvode_mem, constraints) @@ -143,11 +274,24 @@ function CVodeSetConstraints(cvode_mem, constraints) end function CVodeSetNonlinearSolver(cvode_mem, NLS::SUNNonlinearSolver) - ccall((:CVodeSetNonlinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) + ccall( + (:CVodeSetNonlinearSolver, libsundials_cvode), + Cint, + (CVODEMemPtr, SUNNonlinearSolver), + cvode_mem, + NLS, + ) end function CVodeRootInit(cvode_mem, nrtfn::Cint, g::CVRootFn) - ccall((:CVodeRootInit, libsundials_cvode), Cint, (CVODEMemPtr, Cint, CVRootFn), cvode_mem, nrtfn, g) + ccall( + (:CVodeRootInit, libsundials_cvode), + Cint, + (CVODEMemPtr, Cint, CVRootFn), + cvode_mem, + nrtfn, + g, + ) end function CVodeRootInit(cvode_mem, nrtfn, g) @@ -155,7 +299,13 @@ function CVodeRootInit(cvode_mem, nrtfn, g) end function CVodeSetRootDirection(cvode_mem, rootdir) - ccall((:CVodeSetRootDirection, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootdir) + ccall( + (:CVodeSetRootDirection, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + rootdir, + ) end function CVodeSetNoInactiveRootWarn(cvode_mem) @@ -163,7 +313,16 @@ function CVodeSetNoInactiveRootWarn(cvode_mem) end function CVode(cvode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall((:CVode, libsundials_cvode), Cint, (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), cvode_mem, tout, yout, tret, itask) + ccall( + (:CVode, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), + cvode_mem, + tout, + yout, + tret, + itask, + ) end function CVode(cvode_mem, tout, yout::N_Vector, tret, itask) @@ -172,7 +331,15 @@ function CVode(cvode_mem, tout, yout::N_Vector, tret, itask) end function CVodeGetDky(cvode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:CVodeGetDky, libsundials_cvode), Cint, (CVODEMemPtr, realtype, Cint, N_Vector), cvode_mem, t, k, dky) + ccall( + (:CVodeGetDky, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype, Cint, N_Vector), + cvode_mem, + t, + k, + dky, + ) end function CVodeGetDky(cvode_mem, t, k, dky) @@ -181,67 +348,164 @@ function CVodeGetDky(cvode_mem, t, k, dky) end function CVodeGetWorkSpace(cvode_mem, lenrw, leniw) - ccall((:CVodeGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrw, leniw) + ccall( + (:CVodeGetWorkSpace, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrw, + leniw, + ) end function CVodeGetNumSteps(cvode_mem, nsteps) - ccall((:CVodeGetNumSteps, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nsteps) + ccall( + (:CVodeGetNumSteps, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nsteps, + ) end function CVodeGetNumRhsEvals(cvode_mem, nfevals) - ccall((:CVodeGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevals) + ccall( + (:CVodeGetNumRhsEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevals, + ) end function CVodeGetNumLinSolvSetups(cvode_mem, nlinsetups) - ccall((:CVodeGetNumLinSolvSetups, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlinsetups) + ccall( + (:CVodeGetNumLinSolvSetups, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nlinsetups, + ) end function CVodeGetNumErrTestFails(cvode_mem, netfails) - ccall((:CVodeGetNumErrTestFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, netfails) + ccall( + (:CVodeGetNumErrTestFails, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + netfails, + ) end function CVodeGetLastOrder(cvode_mem, qlast) - ccall((:CVodeGetLastOrder, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qlast) + ccall( + (:CVodeGetLastOrder, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + qlast, + ) end function CVodeGetCurrentOrder(cvode_mem, qcur) - ccall((:CVodeGetCurrentOrder, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qcur) + ccall( + (:CVodeGetCurrentOrder, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + qcur, + ) end function CVodeGetCurrentGamma(cvode_mem, gamma) - ccall((:CVodeGetCurrentGamma, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, gamma) + ccall( + (:CVodeGetCurrentGamma, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + gamma, + ) end function CVodeGetNumStabLimOrderReds(cvode_mem, nslred) - ccall((:CVodeGetNumStabLimOrderReds, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nslred) + ccall( + (:CVodeGetNumStabLimOrderReds, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nslred, + ) end function CVodeGetActualInitStep(cvode_mem, hinused) - ccall((:CVodeGetActualInitStep, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hinused) + ccall( + (:CVodeGetActualInitStep, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + hinused, + ) end function CVodeGetLastStep(cvode_mem, hlast) - ccall((:CVodeGetLastStep, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hlast) + ccall( + (:CVodeGetLastStep, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + hlast, + ) end function CVodeGetCurrentStep(cvode_mem, hcur) - ccall((:CVodeGetCurrentStep, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hcur) + ccall( + (:CVodeGetCurrentStep, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + hcur, + ) end function CVodeGetCurrentState(cvode_mem, y) - ccall((:CVodeGetCurrentState, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, y) + ccall( + (:CVodeGetCurrentState, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{N_Vector}), + cvode_mem, + y, + ) end function CVodeGetCurrentTime(cvode_mem, tcur) - ccall((:CVodeGetCurrentTime, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tcur) + ccall( + (:CVodeGetCurrentTime, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + tcur, + ) end function CVodeGetTolScaleFactor(cvode_mem, tolsfac) - ccall((:CVodeGetTolScaleFactor, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tolsfac) + ccall( + (:CVodeGetTolScaleFactor, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + tolsfac, + ) end function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) - ccall((:CVodeGetErrWeights, libsundials_cvode), Cint, (CVODEMemPtr, N_Vector), cvode_mem, eweight) + ccall( + (:CVodeGetErrWeights, libsundials_cvode), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + eweight, + ) end function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) @@ -250,7 +514,13 @@ function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) end function CVodeGetEstLocalErrors(cvode_mem, ele::N_Vector) - ccall((:CVodeGetEstLocalErrors, libsundials_cvode), Cint, (CVODEMemPtr, N_Vector), cvode_mem, ele) + ccall( + (:CVodeGetEstLocalErrors, libsundials_cvode), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + ele, + ) end function CVodeGetEstLocalErrors(cvode_mem, ele) @@ -259,27 +529,97 @@ function CVodeGetEstLocalErrors(cvode_mem, ele) end function CVodeGetNumGEvals(cvode_mem, ngevals) - ccall((:CVodeGetNumGEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevals) + ccall( + (:CVodeGetNumGEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + ngevals, + ) end function CVodeGetRootInfo(cvode_mem, rootsfound) - ccall((:CVodeGetRootInfo, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootsfound) -end - -function CVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) - ccall((:CVodeGetIntegratorStats, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall( + (:CVodeGetRootInfo, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + rootsfound, + ) +end + +function CVodeGetIntegratorStats( + cvode_mem, + nsteps, + nfevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, +) + ccall( + (:CVodeGetIntegratorStats, libsundials_cvode), + Cint, + ( + CVODEMemPtr, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Cint}, + Ptr{Cint}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + ), + cvode_mem, + nsteps, + nfevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, + ) end function CVodeGetNumNonlinSolvIters(cvode_mem, nniters) - ccall((:CVodeGetNumNonlinSolvIters, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nniters) + ccall( + (:CVodeGetNumNonlinSolvIters, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nniters, + ) end function CVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) - ccall((:CVodeGetNumNonlinSolvConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nncfails) + ccall( + (:CVodeGetNumNonlinSolvConvFails, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nncfails, + ) end function CVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) - ccall((:CVodeGetNonlinSolvStats, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nniters, nncfails) + ccall( + (:CVodeGetNonlinSolvStats, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + nniters, + nncfails, + ) end function CVodeGetReturnFlagName(flag::Clong) @@ -296,55 +636,151 @@ end # Julia wrapper for header: cvode_bandpre.h # Automatically generated using Clang.jl - function CVBandPrecInit(cvode_mem, N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall((:CVBandPrecInit, libsundials_cvode), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype), cvode_mem, N, mu, ml) + ccall( + (:CVBandPrecInit, libsundials_cvode), + Cint, + (CVODEMemPtr, sunindextype, sunindextype, sunindextype), + cvode_mem, + N, + mu, + ml, + ) end function CVBandPrecGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVBandPrecGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVBandPrecGetWorkSpace, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVBandPrecGetNumRhsEvals(cvode_mem, nfevalsBP) - ccall((:CVBandPrecGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsBP) + ccall( + (:CVBandPrecGetNumRhsEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsBP, + ) end # Julia wrapper for header: cvode_bbdpre.h # Automatically generated using Clang.jl - -function CVBBDPrecInit(cvode_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dqrely::realtype, gloc::CVLocalFn, cfn::CVCommFn) - ccall((:CVBBDPrecInit, libsundials_cvode), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, CVLocalFn, CVCommFn), cvode_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) -end - -function CVBBDPrecReInit(cvode_mem, mudq::sunindextype, mldq::sunindextype, dqrely::realtype) - ccall((:CVBBDPrecReInit, libsundials_cvode), Cint, (CVODEMemPtr, sunindextype, sunindextype, realtype), cvode_mem, mudq, mldq, dqrely) +function CVBBDPrecInit( + cvode_mem, + Nlocal::sunindextype, + mudq::sunindextype, + mldq::sunindextype, + mukeep::sunindextype, + mlkeep::sunindextype, + dqrely::realtype, + gloc::CVLocalFn, + cfn::CVCommFn, +) + ccall( + (:CVBBDPrecInit, libsundials_cvode), + Cint, + ( + CVODEMemPtr, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + CVLocalFn, + CVCommFn, + ), + cvode_mem, + Nlocal, + mudq, + mldq, + mukeep, + mlkeep, + dqrely, + gloc, + cfn, + ) +end + +function CVBBDPrecReInit( + cvode_mem, + mudq::sunindextype, + mldq::sunindextype, + dqrely::realtype, +) + ccall( + (:CVBBDPrecReInit, libsundials_cvode), + Cint, + (CVODEMemPtr, sunindextype, sunindextype, realtype), + cvode_mem, + mudq, + mldq, + dqrely, + ) end function CVBBDPrecGetWorkSpace(cvode_mem, lenrwBBDP, leniwBBDP) - ccall((:CVBBDPrecGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwBBDP, leniwBBDP) + ccall( + (:CVBBDPrecGetWorkSpace, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwBBDP, + leniwBBDP, + ) end function CVBBDPrecGetNumGfnEvals(cvode_mem, ngevalsBBDP) - ccall((:CVBBDPrecGetNumGfnEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevalsBBDP) + ccall( + (:CVBBDPrecGetNumGfnEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + ngevalsBBDP, + ) end # Julia wrapper for header: cvode_diag.h # Automatically generated using Clang.jl - function CVDiag(cvode_mem) ccall((:CVDiag, libsundials_cvode), Cint, (CVODEMemPtr,), cvode_mem) end function CVDiagGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVDiagGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVDiagGetWorkSpace, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVDiagGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVDiagGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVDiagGetNumRhsEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVDiagGetLastFlag(cvode_mem, flag) - ccall((:CVDiagGetLastFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVDiagGetLastFlag, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVDiagGetReturnFlagName(flag::Clong) @@ -357,29 +793,66 @@ end # Julia wrapper for header: cvode_direct.h # Automatically generated using Clang.jl - function CVDlsSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:CVDlsSetLinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) + ccall( + (:CVDlsSetLinearSolver, libsundials_cvode), + Cint, + (CVODEMemPtr, SUNLinearSolver, SUNMatrix), + cvode_mem, + LS, + A, + ) end function CVDlsSetJacFn(cvode_mem, jac::CVDlsJacFn) - ccall((:CVDlsSetJacFn, libsundials_cvode), Cint, (CVODEMemPtr, CVDlsJacFn), cvode_mem, jac) + ccall( + (:CVDlsSetJacFn, libsundials_cvode), + Cint, + (CVODEMemPtr, CVDlsJacFn), + cvode_mem, + jac, + ) end function CVDlsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVDlsGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVDlsGetWorkSpace, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVDlsGetNumJacEvals(cvode_mem, njevals) - ccall((:CVDlsGetNumJacEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) + ccall( + (:CVDlsGetNumJacEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njevals, + ) end function CVDlsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVDlsGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVDlsGetNumRhsEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVDlsGetLastFlag(cvode_mem, flag) - ccall((:CVDlsGetLastFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVDlsGetLastFlag, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVDlsGetReturnFlagName(flag::Clong) @@ -392,17 +865,35 @@ end # Julia wrapper for header: cvode_ls.h # Automatically generated using Clang.jl - function CVodeSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:CVodeSetLinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) + ccall( + (:CVodeSetLinearSolver, libsundials_cvode), + Cint, + (CVODEMemPtr, SUNLinearSolver, SUNMatrix), + cvode_mem, + LS, + A, + ) end function CVodeSetJacFn(cvode_mem, jac::CVLsJacFn) - ccall((:CVodeSetJacFn, libsundials_cvode), Cint, (CVODEMemPtr, CVLsJacFn), cvode_mem, jac) + ccall( + (:CVodeSetJacFn, libsundials_cvode), + Cint, + (CVODEMemPtr, CVLsJacFn), + cvode_mem, + jac, + ) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj::Clong) - ccall((:CVodeSetMaxStepsBetweenJac, libsundials_cvode), Cint, (CVODEMemPtr, Clong), cvode_mem, msbj) + ccall( + (:CVodeSetMaxStepsBetweenJac, libsundials_cvode), + Cint, + (CVODEMemPtr, Clong), + cvode_mem, + msbj, + ) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) @@ -410,59 +901,150 @@ function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) end function CVodeSetEpsLin(cvode_mem, eplifac::realtype) - ccall((:CVodeSetEpsLin, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) + ccall( + (:CVodeSetEpsLin, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + eplifac, + ) end function CVodeSetPreconditioner(cvode_mem, pset::CVLsPrecSetupFn, psolve::CVLsPrecSolveFn) - ccall((:CVodeSetPreconditioner, libsundials_cvode), Cint, (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), cvode_mem, pset, psolve) -end - -function CVodeSetJacTimes(cvode_mem, jtsetup::CVLsJacTimesSetupFn, jtimes::CVLsJacTimesVecFn) - ccall((:CVodeSetJacTimes, libsundials_cvode), Cint, (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), cvode_mem, jtsetup, jtimes) + ccall( + (:CVodeSetPreconditioner, libsundials_cvode), + Cint, + (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), + cvode_mem, + pset, + psolve, + ) +end + +function CVodeSetJacTimes( + cvode_mem, + jtsetup::CVLsJacTimesSetupFn, + jtimes::CVLsJacTimesVecFn, +) + ccall( + (:CVodeSetJacTimes, libsundials_cvode), + Cint, + (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), + cvode_mem, + jtsetup, + jtimes, + ) end function CVodeSetLinSysFn(cvode_mem, linsys::CVLsLinSysFn) - ccall((:CVodeSetLinSysFn, libsundials_cvode), Cint, (CVODEMemPtr, CVLsLinSysFn), cvode_mem, linsys) + ccall( + (:CVodeSetLinSysFn, libsundials_cvode), + Cint, + (CVODEMemPtr, CVLsLinSysFn), + cvode_mem, + linsys, + ) end function CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVodeGetLinWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVodeGetLinWorkSpace, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVodeGetNumJacEvals(cvode_mem, njevals) - ccall((:CVodeGetNumJacEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) + ccall( + (:CVodeGetNumJacEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njevals, + ) end function CVodeGetNumPrecEvals(cvode_mem, npevals) - ccall((:CVodeGetNumPrecEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) + ccall( + (:CVodeGetNumPrecEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npevals, + ) end function CVodeGetNumPrecSolves(cvode_mem, npsolves) - ccall((:CVodeGetNumPrecSolves, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) + ccall( + (:CVodeGetNumPrecSolves, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npsolves, + ) end function CVodeGetNumLinIters(cvode_mem, nliters) - ccall((:CVodeGetNumLinIters, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) + ccall( + (:CVodeGetNumLinIters, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nliters, + ) end function CVodeGetNumLinConvFails(cvode_mem, nlcfails) - ccall((:CVodeGetNumLinConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) + ccall( + (:CVodeGetNumLinConvFails, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nlcfails, + ) end function CVodeGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall((:CVodeGetNumJTSetupEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) + ccall( + (:CVodeGetNumJTSetupEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njtsetups, + ) end function CVodeGetNumJtimesEvals(cvode_mem, njvevals) - ccall((:CVodeGetNumJtimesEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) + ccall( + (:CVodeGetNumJtimesEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njvevals, + ) end function CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVodeGetNumLinRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVodeGetNumLinRhsEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVodeGetLastLinFlag(cvode_mem, flag) - ccall((:CVodeGetLastLinFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVodeGetLastLinFlag, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVodeGetLinReturnFlagName(flag::Clong) @@ -475,57 +1057,145 @@ end # Julia wrapper for header: cvode_spils.h # Automatically generated using Clang.jl - function CVSpilsSetLinearSolver(cvode_mem, LS::SUNLinearSolver) - ccall((:CVSpilsSetLinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNLinearSolver), cvode_mem, LS) + ccall( + (:CVSpilsSetLinearSolver, libsundials_cvode), + Cint, + (CVODEMemPtr, SUNLinearSolver), + cvode_mem, + LS, + ) end function CVSpilsSetEpsLin(cvode_mem, eplifac::realtype) - ccall((:CVSpilsSetEpsLin, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) -end - -function CVSpilsSetPreconditioner(cvode_mem, pset::CVSpilsPrecSetupFn, psolve::CVSpilsPrecSolveFn) - ccall((:CVSpilsSetPreconditioner, libsundials_cvode), Cint, (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), cvode_mem, pset, psolve) -end - -function CVSpilsSetJacTimes(cvode_mem, jtsetup::CVSpilsJacTimesSetupFn, jtimes::CVSpilsJacTimesVecFn) - ccall((:CVSpilsSetJacTimes, libsundials_cvode), Cint, (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), cvode_mem, jtsetup, jtimes) + ccall( + (:CVSpilsSetEpsLin, libsundials_cvode), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + eplifac, + ) +end + +function CVSpilsSetPreconditioner( + cvode_mem, + pset::CVSpilsPrecSetupFn, + psolve::CVSpilsPrecSolveFn, +) + ccall( + (:CVSpilsSetPreconditioner, libsundials_cvode), + Cint, + (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), + cvode_mem, + pset, + psolve, + ) +end + +function CVSpilsSetJacTimes( + cvode_mem, + jtsetup::CVSpilsJacTimesSetupFn, + jtimes::CVSpilsJacTimesVecFn, +) + ccall( + (:CVSpilsSetJacTimes, libsundials_cvode), + Cint, + (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), + cvode_mem, + jtsetup, + jtimes, + ) end function CVSpilsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVSpilsGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVSpilsGetWorkSpace, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVSpilsGetNumPrecEvals(cvode_mem, npevals) - ccall((:CVSpilsGetNumPrecEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) + ccall( + (:CVSpilsGetNumPrecEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npevals, + ) end function CVSpilsGetNumPrecSolves(cvode_mem, npsolves) - ccall((:CVSpilsGetNumPrecSolves, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) + ccall( + (:CVSpilsGetNumPrecSolves, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npsolves, + ) end function CVSpilsGetNumLinIters(cvode_mem, nliters) - ccall((:CVSpilsGetNumLinIters, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) + ccall( + (:CVSpilsGetNumLinIters, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nliters, + ) end function CVSpilsGetNumConvFails(cvode_mem, nlcfails) - ccall((:CVSpilsGetNumConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) + ccall( + (:CVSpilsGetNumConvFails, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nlcfails, + ) end function CVSpilsGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall((:CVSpilsGetNumJTSetupEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) + ccall( + (:CVSpilsGetNumJTSetupEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njtsetups, + ) end function CVSpilsGetNumJtimesEvals(cvode_mem, njvevals) - ccall((:CVSpilsGetNumJtimesEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) + ccall( + (:CVSpilsGetNumJtimesEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njvevals, + ) end function CVSpilsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVSpilsGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVSpilsGetNumRhsEvals, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVSpilsGetLastFlag(cvode_mem, flag) - ccall((:CVSpilsGetLastFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVSpilsGetLastFlag, libsundials_cvode), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVSpilsGetReturnFlagName(flag::Clong) diff --git a/src/API/cvodes.jl b/src/API/cvodes.jl index 2ba85ed7..a48a7423 100644 --- a/src/API/cvodes.jl +++ b/src/API/cvodes.jl @@ -1,7 +1,6 @@ # Julia wrapper for header: cvodes.h # Automatically generated using Clang.jl - function CVodeCreate(lmm::Cint) ccall((:CVodeCreate, libsundials_cvodes), CVODEMemPtr, (Cint,), lmm) end @@ -11,7 +10,15 @@ function CVodeCreate(lmm) end function CVodeInit(cvode_mem, f::CVRhsFn, t0::realtype, y0::N_Vector) - ccall((:CVodeInit, libsundials_cvodes), Cint, (CVODEMemPtr, CVRhsFn, realtype, N_Vector), cvode_mem, f, t0, y0) + ccall( + (:CVodeInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVRhsFn, realtype, N_Vector), + cvode_mem, + f, + t0, + y0, + ) end function CVodeInit(cvode_mem, f, t0::realtype, y0) @@ -20,7 +27,14 @@ function CVodeInit(cvode_mem, f, t0::realtype, y0) end function CVodeReInit(cvode_mem, t0::realtype, y0::N_Vector) - ccall((:CVodeReInit, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, t0, y0) + ccall( + (:CVodeReInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, N_Vector), + cvode_mem, + t0, + y0, + ) end function CVodeReInit(cvode_mem, t0::realtype, y0) @@ -29,11 +43,25 @@ function CVodeReInit(cvode_mem, t0::realtype, y0) end function CVodeSStolerances(cvode_mem, reltol::realtype, abstol::realtype) - ccall((:CVodeSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, realtype), cvode_mem, reltol, abstol) + ccall( + (:CVodeSStolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, realtype), + cvode_mem, + reltol, + abstol, + ) end function CVodeSVtolerances(cvode_mem, reltol::realtype, abstol::N_Vector) - ccall((:CVodeSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, reltol, abstol) + ccall( + (:CVodeSVtolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, N_Vector), + cvode_mem, + reltol, + abstol, + ) end function CVodeSVtolerances(cvode_mem, reltol, abstol) @@ -42,23 +70,54 @@ function CVodeSVtolerances(cvode_mem, reltol, abstol) end function CVodeWFtolerances(cvode_mem, efun::CVEwtFn) - ccall((:CVodeWFtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, CVEwtFn), cvode_mem, efun) + ccall( + (:CVodeWFtolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVEwtFn), + cvode_mem, + efun, + ) end function CVodeSetErrHandlerFn(cvode_mem, ehfun::CVErrHandlerFn, eh_data) - ccall((:CVodeSetErrHandlerFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), cvode_mem, ehfun, eh_data) + ccall( + (:CVodeSetErrHandlerFn, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), + cvode_mem, + ehfun, + eh_data, + ) end function CVodeSetErrFile(cvode_mem, errfp) - ccall((:CVodeSetErrFile, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{FILE}), cvode_mem, errfp) + ccall( + (:CVodeSetErrFile, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{FILE}), + cvode_mem, + errfp, + ) end function CVodeSetUserData(cvode_mem, user_data) - ccall((:CVodeSetUserData, libsundials_cvodes), Cint, (CVODEMemPtr, Any), cvode_mem, user_data) + ccall( + (:CVodeSetUserData, libsundials_cvodes), + Cint, + (CVODEMemPtr, Any), + cvode_mem, + user_data, + ) end function CVodeSetMaxOrd(cvode_mem, maxord::Cint) - ccall((:CVodeSetMaxOrd, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxord) + ccall( + (:CVodeSetMaxOrd, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxord, + ) end function CVodeSetMaxOrd(cvode_mem, maxord) @@ -66,7 +125,13 @@ function CVodeSetMaxOrd(cvode_mem, maxord) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps::Clong) - ccall((:CVodeSetMaxNumSteps, libsundials_cvodes), Cint, (CVODEMemPtr, Clong), cvode_mem, mxsteps) + ccall( + (:CVodeSetMaxNumSteps, libsundials_cvodes), + Cint, + (CVODEMemPtr, Clong), + cvode_mem, + mxsteps, + ) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps) @@ -74,7 +139,13 @@ function CVodeSetMaxNumSteps(cvode_mem, mxsteps) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil::Cint) - ccall((:CVodeSetMaxHnilWarns, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, mxhnil) + ccall( + (:CVodeSetMaxHnilWarns, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + mxhnil, + ) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) @@ -82,7 +153,13 @@ function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) end function CVodeSetStabLimDet(cvode_mem, stldet::Cint) - ccall((:CVodeSetStabLimDet, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, stldet) + ccall( + (:CVodeSetStabLimDet, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + stldet, + ) end function CVodeSetStabLimDet(cvode_mem, stldet) @@ -90,23 +167,53 @@ function CVodeSetStabLimDet(cvode_mem, stldet) end function CVodeSetInitStep(cvode_mem, hin::realtype) - ccall((:CVodeSetInitStep, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, hin) + ccall( + (:CVodeSetInitStep, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + hin, + ) end function CVodeSetMinStep(cvode_mem, hmin::realtype) - ccall((:CVodeSetMinStep, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, hmin) + ccall( + (:CVodeSetMinStep, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + hmin, + ) end function CVodeSetMaxStep(cvode_mem, hmax::realtype) - ccall((:CVodeSetMaxStep, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, hmax) + ccall( + (:CVodeSetMaxStep, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + hmax, + ) end function CVodeSetStopTime(cvode_mem, tstop::realtype) - ccall((:CVodeSetStopTime, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, tstop) + ccall( + (:CVodeSetStopTime, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + tstop, + ) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef::Cint) - ccall((:CVodeSetMaxErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxnef) + ccall( + (:CVodeSetMaxErrTestFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxnef, + ) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef) @@ -114,7 +221,13 @@ function CVodeSetMaxErrTestFails(cvode_mem, maxnef) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor::Cint) - ccall((:CVodeSetMaxNonlinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxcor) + ccall( + (:CVodeSetMaxNonlinIters, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxcor, + ) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor) @@ -122,7 +235,13 @@ function CVodeSetMaxNonlinIters(cvode_mem, maxcor) end function CVodeSetMaxConvFails(cvode_mem, maxncf::Cint) - ccall((:CVodeSetMaxConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxncf) + ccall( + (:CVodeSetMaxConvFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxncf, + ) end function CVodeSetMaxConvFails(cvode_mem, maxncf) @@ -130,11 +249,23 @@ function CVodeSetMaxConvFails(cvode_mem, maxncf) end function CVodeSetNonlinConvCoef(cvode_mem, nlscoef::realtype) - ccall((:CVodeSetNonlinConvCoef, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, nlscoef) + ccall( + (:CVodeSetNonlinConvCoef, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + nlscoef, + ) end function CVodeSetConstraints(cvode_mem, constraints::N_Vector) - ccall((:CVodeSetConstraints, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, constraints) + ccall( + (:CVodeSetConstraints, libsundials_cvodes), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + constraints, + ) end function CVodeSetConstraints(cvode_mem, constraints) @@ -143,11 +274,24 @@ function CVodeSetConstraints(cvode_mem, constraints) end function CVodeSetNonlinearSolver(cvode_mem, NLS::SUNNonlinearSolver) - ccall((:CVodeSetNonlinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) + ccall( + (:CVodeSetNonlinearSolver, libsundials_cvodes), + Cint, + (CVODEMemPtr, SUNNonlinearSolver), + cvode_mem, + NLS, + ) end function CVodeRootInit(cvode_mem, nrtfn::Cint, g::CVRootFn) - ccall((:CVodeRootInit, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVRootFn), cvode_mem, nrtfn, g) + ccall( + (:CVodeRootInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVRootFn), + cvode_mem, + nrtfn, + g, + ) end function CVodeRootInit(cvode_mem, nrtfn, g) @@ -155,15 +299,35 @@ function CVodeRootInit(cvode_mem, nrtfn, g) end function CVodeSetRootDirection(cvode_mem, rootdir) - ccall((:CVodeSetRootDirection, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootdir) + ccall( + (:CVodeSetRootDirection, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + rootdir, + ) end function CVodeSetNoInactiveRootWarn(cvode_mem) - ccall((:CVodeSetNoInactiveRootWarn, libsundials_cvodes), Cint, (CVODEMemPtr,), cvode_mem) + ccall( + (:CVodeSetNoInactiveRootWarn, libsundials_cvodes), + Cint, + (CVODEMemPtr,), + cvode_mem, + ) end function CVode(cvode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall((:CVode, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), cvode_mem, tout, yout, tret, itask) + ccall( + (:CVode, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), + cvode_mem, + tout, + yout, + tret, + itask, + ) end function CVode(cvode_mem, tout, yout, tret, itask) @@ -172,7 +336,15 @@ function CVode(cvode_mem, tout, yout, tret, itask) end function CVodeGetDky(cvode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:CVodeGetDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, N_Vector), cvode_mem, t, k, dky) + ccall( + (:CVodeGetDky, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Cint, N_Vector), + cvode_mem, + t, + k, + dky, + ) end function CVodeGetDky(cvode_mem, t, k, dky) @@ -181,75 +353,184 @@ function CVodeGetDky(cvode_mem, t, k, dky) end function CVodeGetWorkSpace(cvode_mem, lenrw, leniw) - ccall((:CVodeGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrw, leniw) + ccall( + (:CVodeGetWorkSpace, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrw, + leniw, + ) end function CVodeGetNumSteps(cvode_mem, nsteps) - ccall((:CVodeGetNumSteps, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nsteps) + ccall( + (:CVodeGetNumSteps, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nsteps, + ) end function CVodeGetNumRhsEvals(cvode_mem, nfevals) - ccall((:CVodeGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevals) + ccall( + (:CVodeGetNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevals, + ) end function CVodeGetNumLinSolvSetups(cvode_mem, nlinsetups) - ccall((:CVodeGetNumLinSolvSetups, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlinsetups) + ccall( + (:CVodeGetNumLinSolvSetups, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nlinsetups, + ) end function CVodeGetNumErrTestFails(cvode_mem, netfails) - ccall((:CVodeGetNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, netfails) + ccall( + (:CVodeGetNumErrTestFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + netfails, + ) end function CVodeGetLastOrder(cvode_mem, qlast) - ccall((:CVodeGetLastOrder, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qlast) + ccall( + (:CVodeGetLastOrder, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + qlast, + ) end function CVodeGetCurrentOrder(cvode_mem, qcur) - ccall((:CVodeGetCurrentOrder, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qcur) + ccall( + (:CVodeGetCurrentOrder, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + qcur, + ) end function CVodeGetCurrentGamma(cvode_mem, gamma) - ccall((:CVodeGetCurrentGamma, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, gamma) + ccall( + (:CVodeGetCurrentGamma, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + gamma, + ) end function CVodeGetNumStabLimOrderReds(cvode_mem, nslred) - ccall((:CVodeGetNumStabLimOrderReds, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nslred) + ccall( + (:CVodeGetNumStabLimOrderReds, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nslred, + ) end function CVodeGetActualInitStep(cvode_mem, hinused) - ccall((:CVodeGetActualInitStep, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hinused) + ccall( + (:CVodeGetActualInitStep, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + hinused, + ) end function CVodeGetLastStep(cvode_mem, hlast) - ccall((:CVodeGetLastStep, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hlast) + ccall( + (:CVodeGetLastStep, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + hlast, + ) end function CVodeGetCurrentStep(cvode_mem, hcur) - ccall((:CVodeGetCurrentStep, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hcur) + ccall( + (:CVodeGetCurrentStep, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + hcur, + ) end function CVodeGetCurrentState(cvode_mem, y) - ccall((:CVodeGetCurrentState, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, y) + ccall( + (:CVodeGetCurrentState, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{N_Vector}), + cvode_mem, + y, + ) end function CVodeGetCurrentStateSens(cvode_mem, yS) - ccall((:CVodeGetCurrentStateSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Ptr{N_Vector}}), cvode_mem, yS) + ccall( + (:CVodeGetCurrentStateSens, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Ptr{N_Vector}}), + cvode_mem, + yS, + ) end function CVodeGetCurrentSensSolveIndex(cvode_mem, index) - ccall((:CVodeGetCurrentSensSolveIndex, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, index) + ccall( + (:CVodeGetCurrentSensSolveIndex, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + index, + ) end function CVodeGetCurrentTime(cvode_mem, tcur) - ccall((:CVodeGetCurrentTime, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tcur) + ccall( + (:CVodeGetCurrentTime, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + tcur, + ) end function CVodeGetTolScaleFactor(cvode_mem, tolsfac) - ccall((:CVodeGetTolScaleFactor, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tolsfac) + ccall( + (:CVodeGetTolScaleFactor, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}), + cvode_mem, + tolsfac, + ) end function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) - ccall((:CVodeGetErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, eweight) + ccall( + (:CVodeGetErrWeights, libsundials_cvodes), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + eweight, + ) end function CVodeGetErrWeights(cvode_mem, eweight) @@ -258,7 +539,13 @@ function CVodeGetErrWeights(cvode_mem, eweight) end function CVodeGetEstLocalErrors(cvode_mem, ele::N_Vector) - ccall((:CVodeGetEstLocalErrors, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, ele) + ccall( + (:CVodeGetEstLocalErrors, libsundials_cvodes), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + ele, + ) end function CVodeGetEstLocalErrors(cvode_mem, ele) @@ -267,27 +554,97 @@ function CVodeGetEstLocalErrors(cvode_mem, ele) end function CVodeGetNumGEvals(cvode_mem, ngevals) - ccall((:CVodeGetNumGEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevals) + ccall( + (:CVodeGetNumGEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + ngevals, + ) end function CVodeGetRootInfo(cvode_mem, rootsfound) - ccall((:CVodeGetRootInfo, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootsfound) -end - -function CVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) - ccall((:CVodeGetIntegratorStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall( + (:CVodeGetRootInfo, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Cint}), + cvode_mem, + rootsfound, + ) +end + +function CVodeGetIntegratorStats( + cvode_mem, + nsteps, + nfevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, +) + ccall( + (:CVodeGetIntegratorStats, libsundials_cvodes), + Cint, + ( + CVODEMemPtr, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Cint}, + Ptr{Cint}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + ), + cvode_mem, + nsteps, + nfevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, + ) end function CVodeGetNumNonlinSolvIters(cvode_mem, nniters) - ccall((:CVodeGetNumNonlinSolvIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nniters) + ccall( + (:CVodeGetNumNonlinSolvIters, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nniters, + ) end function CVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) - ccall((:CVodeGetNumNonlinSolvConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nncfails) + ccall( + (:CVodeGetNumNonlinSolvConvFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nncfails, + ) end function CVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) - ccall((:CVodeGetNonlinSolvStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nniters, nncfails) + ccall( + (:CVodeGetNonlinSolvStats, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + nniters, + nncfails, + ) end function CVodeGetReturnFlagName(flag::Clong) @@ -303,7 +660,14 @@ function CVodeFree(cvode_mem) end function CVodeQuadInit(cvode_mem, fQ::CVQuadRhsFn, yQ0::N_Vector) - ccall((:CVodeQuadInit, libsundials_cvodes), Cint, (CVODEMemPtr, CVQuadRhsFn, N_Vector), cvode_mem, fQ, yQ0) + ccall( + (:CVodeQuadInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVQuadRhsFn, N_Vector), + cvode_mem, + fQ, + yQ0, + ) end function CVodeQuadInit(cvode_mem, fQ, yQ0) @@ -312,7 +676,13 @@ function CVodeQuadInit(cvode_mem, fQ, yQ0) end function CVodeQuadReInit(cvode_mem, yQ0::N_Vector) - ccall((:CVodeQuadReInit, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, yQ0) + ccall( + (:CVodeQuadReInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + yQ0, + ) end function CVodeQuadReInit(cvode_mem, yQ0) @@ -321,11 +691,25 @@ function CVodeQuadReInit(cvode_mem, yQ0) end function CVodeQuadSStolerances(cvode_mem, reltolQ::realtype, abstolQ::realtype) - ccall((:CVodeQuadSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, realtype), cvode_mem, reltolQ, abstolQ) + ccall( + (:CVodeQuadSStolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, realtype), + cvode_mem, + reltolQ, + abstolQ, + ) end function CVodeQuadSVtolerances(cvode_mem, reltolQ::realtype, abstolQ::N_Vector) - ccall((:CVodeQuadSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, reltolQ, abstolQ) + ccall( + (:CVodeQuadSVtolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, N_Vector), + cvode_mem, + reltolQ, + abstolQ, + ) end function CVodeQuadSVtolerances(cvode_mem, reltolQ, abstolQ) @@ -334,7 +718,13 @@ function CVodeQuadSVtolerances(cvode_mem, reltolQ, abstolQ) end function CVodeSetQuadErrCon(cvode_mem, errconQ::Cint) - ccall((:CVodeSetQuadErrCon, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, errconQ) + ccall( + (:CVodeSetQuadErrCon, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + errconQ, + ) end function CVodeSetQuadErrCon(cvode_mem, errconQ) @@ -342,7 +732,14 @@ function CVodeSetQuadErrCon(cvode_mem, errconQ) end function CVodeGetQuad(cvode_mem, tret, yQout::N_Vector) - ccall((:CVodeGetQuad, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, N_Vector), cvode_mem, tret, yQout) + ccall( + (:CVodeGetQuad, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}, N_Vector), + cvode_mem, + tret, + yQout, + ) end function CVodeGetQuad(cvode_mem, tret, yQout) @@ -351,7 +748,15 @@ function CVodeGetQuad(cvode_mem, tret, yQout) end function CVodeGetQuadDky(cvode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:CVodeGetQuadDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, N_Vector), cvode_mem, t, k, dky) + ccall( + (:CVodeGetQuadDky, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Cint, N_Vector), + cvode_mem, + t, + k, + dky, + ) end function CVodeGetQuadDky(cvode_mem, t, k, dky) @@ -360,15 +765,33 @@ function CVodeGetQuadDky(cvode_mem, t, k, dky) end function CVodeGetQuadNumRhsEvals(cvode_mem, nfQevals) - ccall((:CVodeGetQuadNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfQevals) + ccall( + (:CVodeGetQuadNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfQevals, + ) end function CVodeGetQuadNumErrTestFails(cvode_mem, nQetfails) - ccall((:CVodeGetQuadNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nQetfails) + ccall( + (:CVodeGetQuadNumErrTestFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nQetfails, + ) end function CVodeGetQuadErrWeights(cvode_mem, eQweight::N_Vector) - ccall((:CVodeGetQuadErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, eQweight) + ccall( + (:CVodeGetQuadErrWeights, libsundials_cvodes), + Cint, + (CVODEMemPtr, N_Vector), + cvode_mem, + eQweight, + ) end function CVodeGetQuadErrWeights(cvode_mem, eQweight) @@ -377,7 +800,14 @@ function CVodeGetQuadErrWeights(cvode_mem, eQweight) end function CVodeGetQuadStats(cvode_mem, nfQevals, nQetfails) - ccall((:CVodeGetQuadStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nfQevals, nQetfails) + ccall( + (:CVodeGetQuadStats, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + nfQevals, + nQetfails, + ) end function CVodeQuadFree(cvode_mem) @@ -385,7 +815,16 @@ function CVodeQuadFree(cvode_mem) end function CVodeSensInit(cvode_mem, Ns::Cint, ism::Cint, fS::CVSensRhsFn, yS0) - ccall((:CVodeSensInit, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint, CVSensRhsFn, Ptr{N_Vector}), cvode_mem, Ns, ism, fS, yS0) + ccall( + (:CVodeSensInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Cint, CVSensRhsFn, Ptr{N_Vector}), + cvode_mem, + Ns, + ism, + fS, + yS0, + ) end function CVodeSensInit(cvode_mem, Ns, ism, fS, yS0) @@ -393,7 +832,16 @@ function CVodeSensInit(cvode_mem, Ns, ism, fS, yS0) end function CVodeSensInit1(cvode_mem, Ns::Cint, ism::Cint, fS1::CVSensRhs1Fn, yS0) - ccall((:CVodeSensInit1, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint, CVSensRhs1Fn, Ptr{N_Vector}), cvode_mem, Ns, ism, fS1, yS0) + ccall( + (:CVodeSensInit1, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Cint, CVSensRhs1Fn, Ptr{N_Vector}), + cvode_mem, + Ns, + ism, + fS1, + yS0, + ) end function CVodeSensInit1(cvode_mem, Ns, ism, fS1, yS0) @@ -401,7 +849,14 @@ function CVodeSensInit1(cvode_mem, Ns, ism, fS1, yS0) end function CVodeSensReInit(cvode_mem, ism::Cint, yS0) - ccall((:CVodeSensReInit, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{N_Vector}), cvode_mem, ism, yS0) + ccall( + (:CVodeSensReInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Ptr{N_Vector}), + cvode_mem, + ism, + yS0, + ) end function CVodeSensReInit(cvode_mem, ism, yS0) @@ -409,11 +864,25 @@ function CVodeSensReInit(cvode_mem, ism, yS0) end function CVodeSensSStolerances(cvode_mem, reltolS::realtype, abstolS) - ccall((:CVodeSensSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{realtype}), cvode_mem, reltolS, abstolS) + ccall( + (:CVodeSensSStolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Ptr{realtype}), + cvode_mem, + reltolS, + abstolS, + ) end function CVodeSensSVtolerances(cvode_mem, reltolS::realtype, abstolS) - ccall((:CVodeSensSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{N_Vector}), cvode_mem, reltolS, abstolS) + ccall( + (:CVodeSensSVtolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Ptr{N_Vector}), + cvode_mem, + reltolS, + abstolS, + ) end function CVodeSensEEtolerances(cvode_mem) @@ -421,7 +890,14 @@ function CVodeSensEEtolerances(cvode_mem) end function CVodeSetSensDQMethod(cvode_mem, DQtype::Cint, DQrhomax::realtype) - ccall((:CVodeSetSensDQMethod, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, DQtype, DQrhomax) + ccall( + (:CVodeSetSensDQMethod, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype), + cvode_mem, + DQtype, + DQrhomax, + ) end function CVodeSetSensDQMethod(cvode_mem, DQtype, DQrhomax) @@ -429,7 +905,13 @@ function CVodeSetSensDQMethod(cvode_mem, DQtype, DQrhomax) end function CVodeSetSensErrCon(cvode_mem, errconS::Cint) - ccall((:CVodeSetSensErrCon, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, errconS) + ccall( + (:CVodeSetSensErrCon, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + errconS, + ) end function CVodeSetSensErrCon(cvode_mem, errconS) @@ -437,7 +919,13 @@ function CVodeSetSensErrCon(cvode_mem, errconS) end function CVodeSetSensMaxNonlinIters(cvode_mem, maxcorS::Cint) - ccall((:CVodeSetSensMaxNonlinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxcorS) + ccall( + (:CVodeSetSensMaxNonlinIters, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + maxcorS, + ) end function CVodeSetSensMaxNonlinIters(cvode_mem, maxcorS) @@ -445,19 +933,45 @@ function CVodeSetSensMaxNonlinIters(cvode_mem, maxcorS) end function CVodeSetSensParams(cvode_mem, p, pbar, plist) - ccall((:CVodeSetSensParams, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), cvode_mem, p, pbar, plist) + ccall( + (:CVodeSetSensParams, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), + cvode_mem, + p, + pbar, + plist, + ) end function CVodeSetNonlinearSolverSensSim(cvode_mem, NLS::SUNNonlinearSolver) - ccall((:CVodeSetNonlinearSolverSensSim, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) + ccall( + (:CVodeSetNonlinearSolverSensSim, libsundials_cvodes), + Cint, + (CVODEMemPtr, SUNNonlinearSolver), + cvode_mem, + NLS, + ) end function CVodeSetNonlinearSolverSensStg(cvode_mem, NLS::SUNNonlinearSolver) - ccall((:CVodeSetNonlinearSolverSensStg, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) + ccall( + (:CVodeSetNonlinearSolverSensStg, libsundials_cvodes), + Cint, + (CVODEMemPtr, SUNNonlinearSolver), + cvode_mem, + NLS, + ) end function CVodeSetNonlinearSolverSensStg1(cvode_mem, NLS::SUNNonlinearSolver) - ccall((:CVodeSetNonlinearSolverSensStg1, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) + ccall( + (:CVodeSetNonlinearSolverSensStg1, libsundials_cvodes), + Cint, + (CVODEMemPtr, SUNNonlinearSolver), + cvode_mem, + NLS, + ) end function CVodeSensToggleOff(cvode_mem) @@ -465,11 +979,26 @@ function CVodeSensToggleOff(cvode_mem) end function CVodeGetSens(cvode_mem, tret, ySout) - ccall((:CVodeGetSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), cvode_mem, tret, ySout) + ccall( + (:CVodeGetSens, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), + cvode_mem, + tret, + ySout, + ) end function CVodeGetSens1(cvode_mem, tret, is::Cint, ySout::N_Vector) - ccall((:CVodeGetSens1, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), cvode_mem, tret, is, ySout) + ccall( + (:CVodeGetSens1, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), + cvode_mem, + tret, + is, + ySout, + ) end function CVodeGetSens1(cvode_mem, tret, is, ySout) @@ -478,7 +1007,15 @@ function CVodeGetSens1(cvode_mem, tret, is, ySout) end function CVodeGetSensDky(cvode_mem, t::realtype, k::Cint, dkyA) - ccall((:CVodeGetSensDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), cvode_mem, t, k, dkyA) + ccall( + (:CVodeGetSensDky, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), + cvode_mem, + t, + k, + dkyA, + ) end function CVodeGetSensDky(cvode_mem, t, k, dkyA) @@ -486,56 +1023,141 @@ function CVodeGetSensDky(cvode_mem, t, k, dkyA) end function CVodeGetSensDky1(cvode_mem, t::realtype, k::Cint, is::Cint, dky::N_Vector) - ccall((:CVodeGetSensDky1, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Cint, N_Vector), cvode_mem, t, k, is, dky) + ccall( + (:CVodeGetSensDky1, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Cint, Cint, N_Vector), + cvode_mem, + t, + k, + is, + dky, + ) end function CVodeGetSensDky1(cvode_mem, t, k, is, dky) __dky = convert(NVector, dky) - CVodeGetSensDky1(cvode_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dky)) + CVodeGetSensDky1( + cvode_mem, + t, + convert(Cint, k), + convert(Cint, is), + convert(N_Vector, __dky), + ) end function CVodeGetSensNumRhsEvals(cvode_mem, nfSevals) - ccall((:CVodeGetSensNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfSevals) + ccall( + (:CVodeGetSensNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfSevals, + ) end function CVodeGetNumRhsEvalsSens(cvode_mem, nfevalsS) - ccall((:CVodeGetNumRhsEvalsSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsS) + ccall( + (:CVodeGetNumRhsEvalsSens, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsS, + ) end function CVodeGetSensNumErrTestFails(cvode_mem, nSetfails) - ccall((:CVodeGetSensNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSetfails) + ccall( + (:CVodeGetSensNumErrTestFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nSetfails, + ) end function CVodeGetSensNumLinSolvSetups(cvode_mem, nlinsetupsS) - ccall((:CVodeGetSensNumLinSolvSetups, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlinsetupsS) + ccall( + (:CVodeGetSensNumLinSolvSetups, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nlinsetupsS, + ) end function CVodeGetSensErrWeights(cvode_mem, eSweight) - ccall((:CVodeGetSensErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, eSweight) + ccall( + (:CVodeGetSensErrWeights, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{N_Vector}), + cvode_mem, + eSweight, + ) end function CVodeGetSensStats(cvode_mem, nfSevals, nfevalsS, nSetfails, nlinsetupsS) - ccall((:CVodeGetSensStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), cvode_mem, nfSevals, nfevalsS, nSetfails, nlinsetupsS) + ccall( + (:CVodeGetSensStats, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + nfSevals, + nfevalsS, + nSetfails, + nlinsetupsS, + ) end function CVodeGetSensNumNonlinSolvIters(cvode_mem, nSniters) - ccall((:CVodeGetSensNumNonlinSolvIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSniters) + ccall( + (:CVodeGetSensNumNonlinSolvIters, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nSniters, + ) end function CVodeGetSensNumNonlinSolvConvFails(cvode_mem, nSncfails) - ccall((:CVodeGetSensNumNonlinSolvConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSncfails) + ccall( + (:CVodeGetSensNumNonlinSolvConvFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nSncfails, + ) end function CVodeGetStgrSensNumNonlinSolvIters(cvode_mem, nSTGR1niters) - ccall((:CVodeGetStgrSensNumNonlinSolvIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSTGR1niters) + ccall( + (:CVodeGetStgrSensNumNonlinSolvIters, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nSTGR1niters, + ) end function CVodeGetStgrSensNumNonlinSolvConvFails(cvode_mem, nSTGR1ncfails) - ccall((:CVodeGetStgrSensNumNonlinSolvConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSTGR1ncfails) + ccall( + (:CVodeGetStgrSensNumNonlinSolvConvFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nSTGR1ncfails, + ) end function CVodeGetSensNonlinSolvStats(cvode_mem, nSniters, nSncfails) - ccall((:CVodeGetSensNonlinSolvStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nSniters, nSncfails) + ccall( + (:CVodeGetSensNonlinSolvStats, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + nSniters, + nSncfails, + ) end function CVodeSensFree(cvode_mem) @@ -543,19 +1165,46 @@ function CVodeSensFree(cvode_mem) end function CVodeQuadSensInit(cvode_mem, fQS::CVQuadSensRhsFn, yQS0) - ccall((:CVodeQuadSensInit, libsundials_cvodes), Cint, (CVODEMemPtr, CVQuadSensRhsFn, Ptr{N_Vector}), cvode_mem, fQS, yQS0) + ccall( + (:CVodeQuadSensInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVQuadSensRhsFn, Ptr{N_Vector}), + cvode_mem, + fQS, + yQS0, + ) end function CVodeQuadSensReInit(cvode_mem, yQS0) - ccall((:CVodeQuadSensReInit, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, yQS0) + ccall( + (:CVodeQuadSensReInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{N_Vector}), + cvode_mem, + yQS0, + ) end function CVodeQuadSensSStolerances(cvode_mem, reltolQS::realtype, abstolQS) - ccall((:CVodeQuadSensSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{realtype}), cvode_mem, reltolQS, abstolQS) + ccall( + (:CVodeQuadSensSStolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Ptr{realtype}), + cvode_mem, + reltolQS, + abstolQS, + ) end function CVodeQuadSensSVtolerances(cvode_mem, reltolQS::realtype, abstolQS) - ccall((:CVodeQuadSensSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{N_Vector}), cvode_mem, reltolQS, abstolQS) + ccall( + (:CVodeQuadSensSVtolerances, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Ptr{N_Vector}), + cvode_mem, + reltolQS, + abstolQS, + ) end function CVodeQuadSensEEtolerances(cvode_mem) @@ -563,7 +1212,13 @@ function CVodeQuadSensEEtolerances(cvode_mem) end function CVodeSetQuadSensErrCon(cvode_mem, errconQS::Cint) - ccall((:CVodeSetQuadSensErrCon, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, errconQS) + ccall( + (:CVodeSetQuadSensErrCon, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint), + cvode_mem, + errconQS, + ) end function CVodeSetQuadSensErrCon(cvode_mem, errconQS) @@ -571,11 +1226,26 @@ function CVodeSetQuadSensErrCon(cvode_mem, errconQS) end function CVodeGetQuadSens(cvode_mem, tret, yQSout) - ccall((:CVodeGetQuadSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), cvode_mem, tret, yQSout) + ccall( + (:CVodeGetQuadSens, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), + cvode_mem, + tret, + yQSout, + ) end function CVodeGetQuadSens1(cvode_mem, tret, is::Cint, yQSout::N_Vector) - ccall((:CVodeGetQuadSens1, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), cvode_mem, tret, is, yQSout) + ccall( + (:CVodeGetQuadSens1, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), + cvode_mem, + tret, + is, + yQSout, + ) end function CVodeGetQuadSens1(cvode_mem, tret, is, yQSout) @@ -584,7 +1254,15 @@ function CVodeGetQuadSens1(cvode_mem, tret, is, yQSout) end function CVodeGetQuadSensDky(cvode_mem, t::realtype, k::Cint, dkyQS_all) - ccall((:CVodeGetQuadSensDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), cvode_mem, t, k, dkyQS_all) + ccall( + (:CVodeGetQuadSensDky, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), + cvode_mem, + t, + k, + dkyQS_all, + ) end function CVodeGetQuadSensDky(cvode_mem, t, k, dkyQS_all) @@ -592,28 +1270,68 @@ function CVodeGetQuadSensDky(cvode_mem, t, k, dkyQS_all) end function CVodeGetQuadSensDky1(cvode_mem, t::realtype, k::Cint, is::Cint, dkyQS::N_Vector) - ccall((:CVodeGetQuadSensDky1, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Cint, N_Vector), cvode_mem, t, k, is, dkyQS) + ccall( + (:CVodeGetQuadSensDky1, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Cint, Cint, N_Vector), + cvode_mem, + t, + k, + is, + dkyQS, + ) end function CVodeGetQuadSensDky1(cvode_mem, t, k, is, dkyQS) __dkyQS = convert(NVector, dkyQS) - CVodeGetQuadSensDky1(cvode_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dkyQS)) + CVodeGetQuadSensDky1( + cvode_mem, + t, + convert(Cint, k), + convert(Cint, is), + convert(N_Vector, __dkyQS), + ) end function CVodeGetQuadSensNumRhsEvals(cvode_mem, nfQSevals) - ccall((:CVodeGetQuadSensNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfQSevals) + ccall( + (:CVodeGetQuadSensNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfQSevals, + ) end function CVodeGetQuadSensNumErrTestFails(cvode_mem, nQSetfails) - ccall((:CVodeGetQuadSensNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nQSetfails) + ccall( + (:CVodeGetQuadSensNumErrTestFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nQSetfails, + ) end function CVodeGetQuadSensErrWeights(cvode_mem, eQSweight) - ccall((:CVodeGetQuadSensErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, eQSweight) + ccall( + (:CVodeGetQuadSensErrWeights, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{N_Vector}), + cvode_mem, + eQSweight, + ) end function CVodeGetQuadSensStats(cvode_mem, nfQSevals, nQSetfails) - ccall((:CVodeGetQuadSensStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nfQSevals, nQSetfails) + ccall( + (:CVodeGetQuadSensStats, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + nfQSevals, + nQSetfails, + ) end function CVodeQuadSensFree(cvode_mem) @@ -621,7 +1339,14 @@ function CVodeQuadSensFree(cvode_mem) end function CVodeAdjInit(cvode_mem, steps::Clong, interp::Cint) - ccall((:CVodeAdjInit, libsundials_cvodes), Cint, (CVODEMemPtr, Clong, Cint), cvode_mem, steps, interp) + ccall( + (:CVodeAdjInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, Clong, Cint), + cvode_mem, + steps, + interp, + ) end function CVodeAdjInit(cvode_mem, steps, interp) @@ -637,7 +1362,14 @@ function CVodeAdjFree(cvode_mem) end function CVodeCreateB(cvode_mem, lmmB::Cint, which) - ccall((:CVodeCreateB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{Cint}), cvode_mem, lmmB, which) + ccall( + (:CVodeCreateB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Ptr{Cint}), + cvode_mem, + lmmB, + which, + ) end function CVodeCreateB(cvode_mem, lmmB, which) @@ -645,7 +1377,16 @@ function CVodeCreateB(cvode_mem, lmmB, which) end function CVodeInitB(cvode_mem, which::Cint, fB::CVRhsFnB, tB0::realtype, yB0::N_Vector) - ccall((:CVodeInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVRhsFnB, realtype, N_Vector), cvode_mem, which, fB, tB0, yB0) + ccall( + (:CVodeInitB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVRhsFnB, realtype, N_Vector), + cvode_mem, + which, + fB, + tB0, + yB0, + ) end function CVodeInitB(cvode_mem, which, fB, tB0, yB0) @@ -654,7 +1395,16 @@ function CVodeInitB(cvode_mem, which, fB, tB0, yB0) end function CVodeInitBS(cvode_mem, which::Cint, fBs::CVRhsFnBS, tB0::realtype, yB0::N_Vector) - ccall((:CVodeInitBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVRhsFnBS, realtype, N_Vector), cvode_mem, which, fBs, tB0, yB0) + ccall( + (:CVodeInitBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVRhsFnBS, realtype, N_Vector), + cvode_mem, + which, + fBs, + tB0, + yB0, + ) end function CVodeInitBS(cvode_mem, which, fBs, tB0, yB0) @@ -663,7 +1413,15 @@ function CVodeInitBS(cvode_mem, which, fBs, tB0, yB0) end function CVodeReInitB(cvode_mem, which::Cint, tB0::realtype, yB0::N_Vector) - ccall((:CVodeReInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, N_Vector), cvode_mem, which, tB0, yB0) + ccall( + (:CVodeReInitB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype, N_Vector), + cvode_mem, + which, + tB0, + yB0, + ) end function CVodeReInitB(cvode_mem, which, tB0, yB0) @@ -672,7 +1430,15 @@ function CVodeReInitB(cvode_mem, which, tB0, yB0) end function CVodeSStolerancesB(cvode_mem, which::Cint, reltolB::realtype, abstolB::realtype) - ccall((:CVodeSStolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, realtype), cvode_mem, which, reltolB, abstolB) + ccall( + (:CVodeSStolerancesB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype, realtype), + cvode_mem, + which, + reltolB, + abstolB, + ) end function CVodeSStolerancesB(cvode_mem, which, reltolB, abstolB) @@ -680,16 +1446,37 @@ function CVodeSStolerancesB(cvode_mem, which, reltolB, abstolB) end function CVodeSVtolerancesB(cvode_mem, which::Cint, reltolB::realtype, abstolB::N_Vector) - ccall((:CVodeSVtolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, N_Vector), cvode_mem, which, reltolB, abstolB) + ccall( + (:CVodeSVtolerancesB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype, N_Vector), + cvode_mem, + which, + reltolB, + abstolB, + ) end function CVodeSVtolerancesB(cvode_mem, which, reltolB, abstolB) __abstolB = convert(NVector, abstolB) - CVodeSVtolerancesB(cvode_mem, convert(Cint, which), reltolB, convert(N_Vector, __abstolB)) + CVodeSVtolerancesB( + cvode_mem, + convert(Cint, which), + reltolB, + convert(N_Vector, __abstolB), + ) end function CVodeQuadInitB(cvode_mem, which::Cint, fQB::CVQuadRhsFnB, yQB0::N_Vector) - ccall((:CVodeQuadInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVQuadRhsFnB, N_Vector), cvode_mem, which, fQB, yQB0) + ccall( + (:CVodeQuadInitB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVQuadRhsFnB, N_Vector), + cvode_mem, + which, + fQB, + yQB0, + ) end function CVodeQuadInitB(cvode_mem, which, fQB, yQB0) @@ -698,7 +1485,15 @@ function CVodeQuadInitB(cvode_mem, which, fQB, yQB0) end function CVodeQuadInitBS(cvode_mem, which::Cint, fQBs::CVQuadRhsFnBS, yQB0::N_Vector) - ccall((:CVodeQuadInitBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVQuadRhsFnBS, N_Vector), cvode_mem, which, fQBs, yQB0) + ccall( + (:CVodeQuadInitBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVQuadRhsFnBS, N_Vector), + cvode_mem, + which, + fQBs, + yQB0, + ) end function CVodeQuadInitBS(cvode_mem, which, fQBs, yQB0) @@ -707,7 +1502,14 @@ function CVodeQuadInitBS(cvode_mem, which, fQBs, yQB0) end function CVodeQuadReInitB(cvode_mem, which::Cint, yQB0::N_Vector) - ccall((:CVodeQuadReInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, N_Vector), cvode_mem, which, yQB0) + ccall( + (:CVodeQuadReInitB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, N_Vector), + cvode_mem, + which, + yQB0, + ) end function CVodeQuadReInitB(cvode_mem, which, yQB0) @@ -715,34 +1517,89 @@ function CVodeQuadReInitB(cvode_mem, which, yQB0) CVodeQuadReInitB(cvode_mem, convert(Cint, which), convert(N_Vector, __yQB0)) end -function CVodeQuadSStolerancesB(cvode_mem, which::Cint, reltolQB::realtype, abstolQB::realtype) - ccall((:CVodeQuadSStolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, realtype), cvode_mem, which, reltolQB, abstolQB) +function CVodeQuadSStolerancesB( + cvode_mem, + which::Cint, + reltolQB::realtype, + abstolQB::realtype, +) + ccall( + (:CVodeQuadSStolerancesB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype, realtype), + cvode_mem, + which, + reltolQB, + abstolQB, + ) end function CVodeQuadSStolerancesB(cvode_mem, which, reltolQB, abstolQB) CVodeQuadSStolerancesB(cvode_mem, convert(Cint, which), reltolQB, abstolQB) end -function CVodeQuadSVtolerancesB(cvode_mem, which::Cint, reltolQB::realtype, abstolQB::N_Vector) - ccall((:CVodeQuadSVtolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, N_Vector), cvode_mem, which, reltolQB, abstolQB) +function CVodeQuadSVtolerancesB( + cvode_mem, + which::Cint, + reltolQB::realtype, + abstolQB::N_Vector, +) + ccall( + (:CVodeQuadSVtolerancesB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype, N_Vector), + cvode_mem, + which, + reltolQB, + abstolQB, + ) end function CVodeQuadSVtolerancesB(cvode_mem, which, reltolQB, abstolQB) __abstolQB = convert(NVector, abstolQB) - CVodeQuadSVtolerancesB(cvode_mem, convert(Cint, which), reltolQB, convert(N_Vector, __abstolQB)) + CVodeQuadSVtolerancesB( + cvode_mem, + convert(Cint, which), + reltolQB, + convert(N_Vector, __abstolQB), + ) end function CVodeF(cvode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint, ncheckPtr) - ccall((:CVodeF, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint, Ptr{Cint}), cvode_mem, tout, yout, tret, itask, ncheckPtr) + ccall( + (:CVodeF, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint, Ptr{Cint}), + cvode_mem, + tout, + yout, + tret, + itask, + ncheckPtr, + ) end function CVodeF(cvode_mem, tout, yout, tret, itask, ncheckPtr) __yout = convert(NVector, yout) - CVodeF(cvode_mem, tout, convert(N_Vector, __yout), tret, convert(Cint, itask), ncheckPtr) + CVodeF( + cvode_mem, + tout, + convert(N_Vector, __yout), + tret, + convert(Cint, itask), + ncheckPtr, + ) end function CVodeB(cvode_mem, tBout::realtype, itaskB::Cint) - ccall((:CVodeB, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint), cvode_mem, tBout, itaskB) + ccall( + (:CVodeB, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, Cint), + cvode_mem, + tBout, + itaskB, + ) end function CVodeB(cvode_mem, tBout, itaskB) @@ -754,7 +1611,14 @@ function CVodeSetAdjNoSensi(cvode_mem) end function CVodeSetUserDataB(cvode_mem, which::Cint, user_dataB) - ccall((:CVodeSetUserDataB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Any), cvode_mem, which, user_dataB) + ccall( + (:CVodeSetUserDataB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Any), + cvode_mem, + which, + user_dataB, + ) end function CVodeSetUserDataB(cvode_mem, which, user_dataB) @@ -762,7 +1626,14 @@ function CVodeSetUserDataB(cvode_mem, which, user_dataB) end function CVodeSetMaxOrdB(cvode_mem, which::Cint, maxordB::Cint) - ccall((:CVodeSetMaxOrdB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint), cvode_mem, which, maxordB) + ccall( + (:CVodeSetMaxOrdB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Cint), + cvode_mem, + which, + maxordB, + ) end function CVodeSetMaxOrdB(cvode_mem, which, maxordB) @@ -770,7 +1641,14 @@ function CVodeSetMaxOrdB(cvode_mem, which, maxordB) end function CVodeSetMaxNumStepsB(cvode_mem, which::Cint, mxstepsB::Clong) - ccall((:CVodeSetMaxNumStepsB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Clong), cvode_mem, which, mxstepsB) + ccall( + (:CVodeSetMaxNumStepsB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Clong), + cvode_mem, + which, + mxstepsB, + ) end function CVodeSetMaxNumStepsB(cvode_mem, whichs, mxstepsB) @@ -778,7 +1656,14 @@ function CVodeSetMaxNumStepsB(cvode_mem, whichs, mxstepsB) end function CVodeSetStabLimDetB(cvode_mem, which::Cint, stldetB::Cint) - ccall((:CVodeSetStabLimDetB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint), cvode_mem, which, stldetB) + ccall( + (:CVodeSetStabLimDetB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Cint), + cvode_mem, + which, + stldetB, + ) end function CVodeSetStabLimDetB(cvode_mem, which, stldetB) @@ -786,7 +1671,14 @@ function CVodeSetStabLimDetB(cvode_mem, which, stldetB) end function CVodeSetInitStepB(cvode_mem, which::Cint, hinB::realtype) - ccall((:CVodeSetInitStepB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, hinB) + ccall( + (:CVodeSetInitStepB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype), + cvode_mem, + which, + hinB, + ) end function CVodeSetInitStepB(cvode_mem, which, hinB) @@ -794,7 +1686,14 @@ function CVodeSetInitStepB(cvode_mem, which, hinB) end function CVodeSetMinStepB(cvode_mem, which::Cint, hminB::realtype) - ccall((:CVodeSetMinStepB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, hminB) + ccall( + (:CVodeSetMinStepB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype), + cvode_mem, + which, + hminB, + ) end function CVodeSetMinStepB(cvode_mem, which, hminB) @@ -802,7 +1701,14 @@ function CVodeSetMinStepB(cvode_mem, which, hminB) end function CVodeSetMaxStepB(cvode_mem, which::Cint, hmaxB::realtype) - ccall((:CVodeSetMaxStepB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, hmaxB) + ccall( + (:CVodeSetMaxStepB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype), + cvode_mem, + which, + hmaxB, + ) end function CVodeSetMaxStepB(cvode_mem, which, hmaxB) @@ -810,7 +1716,14 @@ function CVodeSetMaxStepB(cvode_mem, which, hmaxB) end function CVodeSetConstraintsB(cvode_mem, which::Cint, constraintsB::N_Vector) - ccall((:CVodeSetConstraintsB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, N_Vector), cvode_mem, which, constraintsB) + ccall( + (:CVodeSetConstraintsB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, N_Vector), + cvode_mem, + which, + constraintsB, + ) end function CVodeSetConstraintsB(cvode_mem, which, constraintsB) @@ -819,7 +1732,14 @@ function CVodeSetConstraintsB(cvode_mem, which, constraintsB) end function CVodeSetQuadErrConB(cvode_mem, which::Cint, errconQB::Cint) - ccall((:CVodeSetQuadErrConB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint), cvode_mem, which, errconQB) + ccall( + (:CVodeSetQuadErrConB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Cint), + cvode_mem, + which, + errconQB, + ) end function CVodeSetQuadErrConB(cvode_mem, which, errconQB) @@ -827,7 +1747,14 @@ function CVodeSetQuadErrConB(cvode_mem, which, errconQB) end function CVodeSetNonlinearSolverB(cvode_mem, which::Cint, NLS::SUNNonlinearSolver) - ccall((:CVodeSetNonlinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNNonlinearSolver), cvode_mem, which, NLS) + ccall( + (:CVodeSetNonlinearSolverB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, SUNNonlinearSolver), + cvode_mem, + which, + NLS, + ) end function CVodeSetNonlinearSolverB(cvode_mem, which, NLS) @@ -835,7 +1762,15 @@ function CVodeSetNonlinearSolverB(cvode_mem, which, NLS) end function CVodeGetB(cvode_mem, which::Cint, tBret, yB::N_Vector) - ccall((:CVodeGetB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), cvode_mem, which, tBret, yB) + ccall( + (:CVodeGetB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), + cvode_mem, + which, + tBret, + yB, + ) end function CVodeGetB(cvode_mem, which, tBret, yB) @@ -844,7 +1779,15 @@ function CVodeGetB(cvode_mem, which, tBret, yB) end function CVodeGetQuadB(cvode_mem, which::Cint, tBret, qB::N_Vector) - ccall((:CVodeGetQuadB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), cvode_mem, which, tBret, qB) + ccall( + (:CVodeGetQuadB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), + cvode_mem, + which, + tBret, + qB, + ) end function CVodeGetQuadB(cvode_mem, which, tBret, qB) @@ -853,7 +1796,13 @@ function CVodeGetQuadB(cvode_mem, which, tBret, qB) end function CVodeGetAdjCVodeBmem(cvode_mem, which::Cint) - ccall((:CVodeGetAdjCVodeBmem, libsundials_cvodes), Ptr{Cvoid}, (CVODEMemPtr, Cint), cvode_mem, which) + ccall( + (:CVodeGetAdjCVodeBmem, libsundials_cvodes), + Ptr{Cvoid}, + (CVODEMemPtr, Cint), + cvode_mem, + which, + ) end function CVodeGetAdjCVodeBmem(cvode_mem, which) @@ -861,7 +1810,14 @@ function CVodeGetAdjCVodeBmem(cvode_mem, which) end function CVodeGetAdjY(cvode_mem, t::realtype, y::N_Vector) - ccall((:CVodeGetAdjY, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, t, y) + ccall( + (:CVodeGetAdjY, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype, N_Vector), + cvode_mem, + t, + y, + ) end function CVodeGetAdjY(cvode_mem, t, y) @@ -870,107 +1826,345 @@ function CVodeGetAdjY(cvode_mem, t, y) end function CVodeGetAdjCheckPointsInfo(cvode_mem, ckpnt) - ccall((:CVodeGetAdjCheckPointsInfo, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{CVadjCheckPointRec}), cvode_mem, ckpnt) + ccall( + (:CVodeGetAdjCheckPointsInfo, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{CVadjCheckPointRec}), + cvode_mem, + ckpnt, + ) end function CVodeGetAdjDataPointHermite(cvode_mem, which::Cint, t, y::N_Vector, yd::N_Vector) - ccall((:CVodeGetAdjDataPointHermite, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), cvode_mem, which, t, y, yd) + ccall( + (:CVodeGetAdjDataPointHermite, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), + cvode_mem, + which, + t, + y, + yd, + ) end function CVodeGetAdjDataPointHermite(cvode_mem, which, t, y, yd) __y = convert(NVector, y) __yd = convert(NVector, yd) - CVodeGetAdjDataPointHermite(cvode_mem, convert(Cint, which), t, convert(N_Vector, __y), convert(N_Vector, __yd)) + CVodeGetAdjDataPointHermite( + cvode_mem, + convert(Cint, which), + t, + convert(N_Vector, __y), + convert(N_Vector, __yd), + ) end function CVodeGetAdjDataPointPolynomial(cvode_mem, which::Cint, t, order, y::N_Vector) - ccall((:CVodeGetAdjDataPointPolynomial, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), cvode_mem, which, t, order, y) + ccall( + (:CVodeGetAdjDataPointPolynomial, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), + cvode_mem, + which, + t, + order, + y, + ) end function CVodeGetAdjDataPointPolynomial(cvode_mem, which, t, order, y) __y = convert(NVector, y) - CVodeGetAdjDataPointPolynomial(cvode_mem, convert(Cint, which), t, order, convert(N_Vector, __y)) + CVodeGetAdjDataPointPolynomial( + cvode_mem, + convert(Cint, which), + t, + order, + convert(N_Vector, __y), + ) end function CVodeGetAdjCurrentCheckPoint(cvode_mem, addr) - ccall((:CVodeGetAdjCurrentCheckPoint, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Ptr{Cvoid}}), cvode_mem, addr) + ccall( + (:CVodeGetAdjCurrentCheckPoint, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Ptr{Cvoid}}), + cvode_mem, + addr, + ) end # Julia wrapper for header: cvodes_bandpre.h # Automatically generated using Clang.jl - function CVBandPrecInit(cvode_mem, N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall((:CVBandPrecInit, libsundials_cvodes), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype), cvode_mem, N, mu, ml) + ccall( + (:CVBandPrecInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, sunindextype, sunindextype, sunindextype), + cvode_mem, + N, + mu, + ml, + ) end function CVBandPrecGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVBandPrecGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVBandPrecGetWorkSpace, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVBandPrecGetNumRhsEvals(cvode_mem, nfevalsBP) - ccall((:CVBandPrecGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsBP) -end - -function CVBandPrecInitB(cvode_mem, which::Cint, nB::sunindextype, muB::sunindextype, mlB::sunindextype) - ccall((:CVBandPrecInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, sunindextype, sunindextype, sunindextype), cvode_mem, which, nB, muB, mlB) -end - -function CVBandPrecInitB(cvode_mem, which, nB::sunindextype, muB::sunindextype, mlB::sunindextype) + ccall( + (:CVBandPrecGetNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsBP, + ) +end + +function CVBandPrecInitB( + cvode_mem, + which::Cint, + nB::sunindextype, + muB::sunindextype, + mlB::sunindextype, +) + ccall( + (:CVBandPrecInitB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, sunindextype, sunindextype, sunindextype), + cvode_mem, + which, + nB, + muB, + mlB, + ) +end + +function CVBandPrecInitB( + cvode_mem, + which, + nB::sunindextype, + muB::sunindextype, + mlB::sunindextype, +) CVBandPrecInitB(cvode_mem, convert(Cint, which), nB, muB, mlB) end # Julia wrapper for header: cvodes_bbdpre.h # Automatically generated using Clang.jl - -function CVBBDPrecInit(cvode_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dqrely::realtype, gloc::CVLocalFn, cfn::CVCommFn) - ccall((:CVBBDPrecInit, libsundials_cvodes), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, CVLocalFn, CVCommFn), cvode_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) -end - -function CVBBDPrecReInit(cvode_mem, mudq::sunindextype, mldq::sunindextype, dqrely::realtype) - ccall((:CVBBDPrecReInit, libsundials_cvodes), Cint, (CVODEMemPtr, sunindextype, sunindextype, realtype), cvode_mem, mudq, mldq, dqrely) +function CVBBDPrecInit( + cvode_mem, + Nlocal::sunindextype, + mudq::sunindextype, + mldq::sunindextype, + mukeep::sunindextype, + mlkeep::sunindextype, + dqrely::realtype, + gloc::CVLocalFn, + cfn::CVCommFn, +) + ccall( + (:CVBBDPrecInit, libsundials_cvodes), + Cint, + ( + CVODEMemPtr, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + CVLocalFn, + CVCommFn, + ), + cvode_mem, + Nlocal, + mudq, + mldq, + mukeep, + mlkeep, + dqrely, + gloc, + cfn, + ) +end + +function CVBBDPrecReInit( + cvode_mem, + mudq::sunindextype, + mldq::sunindextype, + dqrely::realtype, +) + ccall( + (:CVBBDPrecReInit, libsundials_cvodes), + Cint, + (CVODEMemPtr, sunindextype, sunindextype, realtype), + cvode_mem, + mudq, + mldq, + dqrely, + ) end function CVBBDPrecGetWorkSpace(cvode_mem, lenrwBBDP, leniwBBDP) - ccall((:CVBBDPrecGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwBBDP, leniwBBDP) + ccall( + (:CVBBDPrecGetWorkSpace, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwBBDP, + leniwBBDP, + ) end function CVBBDPrecGetNumGfnEvals(cvode_mem, ngevalsBBDP) - ccall((:CVBBDPrecGetNumGfnEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevalsBBDP) -end - -function CVBBDPrecInitB(cvode_mem, which::Cint, NlocalB::sunindextype, mudqB::sunindextype, mldqB::sunindextype, mukeepB::sunindextype, mlkeepB::sunindextype, dqrelyB::realtype, glocB::CVLocalFnB, cfnB::CVCommFnB) - ccall((:CVBBDPrecInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, CVLocalFnB, CVCommFnB), cvode_mem, which, NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dqrelyB, glocB, cfnB) -end - -function CVBBDPrecInitB(cvode_mem, which, NlocalB::sunindextype, mudqB::sunindextype, mldqB::sunindextype, mukeepB::sunindextype, mlkeepB::sunindextype, dqrelyB::realtype, glocB::CVLocalFnB, cfnB::CVCommFnB) - CVBBDPrecInitB(cvode_mem, convert(Cint, which), NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dqrelyB, glocB, cfnB) -end - -function CVBBDPrecReInitB(cvode_mem, which::Cint, mudqB::sunindextype, mldqB::sunindextype, dqrelyB::realtype) - ccall((:CVBBDPrecReInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, sunindextype, sunindextype, realtype), cvode_mem, which, mudqB, mldqB, dqrelyB) -end - -function CVBBDPrecReInitB(cvode_mem, which, mudqB::sunindextype, mldqB::sunindextype, dqrelyB::realtype) + ccall( + (:CVBBDPrecGetNumGfnEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + ngevalsBBDP, + ) +end + +function CVBBDPrecInitB( + cvode_mem, + which::Cint, + NlocalB::sunindextype, + mudqB::sunindextype, + mldqB::sunindextype, + mukeepB::sunindextype, + mlkeepB::sunindextype, + dqrelyB::realtype, + glocB::CVLocalFnB, + cfnB::CVCommFnB, +) + ccall( + (:CVBBDPrecInitB, libsundials_cvodes), + Cint, + ( + CVODEMemPtr, + Cint, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + CVLocalFnB, + CVCommFnB, + ), + cvode_mem, + which, + NlocalB, + mudqB, + mldqB, + mukeepB, + mlkeepB, + dqrelyB, + glocB, + cfnB, + ) +end + +function CVBBDPrecInitB( + cvode_mem, + which, + NlocalB::sunindextype, + mudqB::sunindextype, + mldqB::sunindextype, + mukeepB::sunindextype, + mlkeepB::sunindextype, + dqrelyB::realtype, + glocB::CVLocalFnB, + cfnB::CVCommFnB, +) + CVBBDPrecInitB( + cvode_mem, + convert(Cint, which), + NlocalB, + mudqB, + mldqB, + mukeepB, + mlkeepB, + dqrelyB, + glocB, + cfnB, + ) +end + +function CVBBDPrecReInitB( + cvode_mem, + which::Cint, + mudqB::sunindextype, + mldqB::sunindextype, + dqrelyB::realtype, +) + ccall( + (:CVBBDPrecReInitB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, sunindextype, sunindextype, realtype), + cvode_mem, + which, + mudqB, + mldqB, + dqrelyB, + ) +end + +function CVBBDPrecReInitB( + cvode_mem, + which, + mudqB::sunindextype, + mldqB::sunindextype, + dqrelyB::realtype, +) CVBBDPrecReInitB(cvode_mem, convert(Cint, which), mudqB, mldqB, dqrelyB) end # Julia wrapper for header: cvodes_diag.h # Automatically generated using Clang.jl - function CVDiag(cvode_mem) ccall((:CVDiag, libsundials_cvodes), Cint, (CVODEMemPtr,), cvode_mem) end function CVDiagGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVDiagGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVDiagGetWorkSpace, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVDiagGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVDiagGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVDiagGetNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVDiagGetLastFlag(cvode_mem, flag) - ccall((:CVDiagGetLastFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVDiagGetLastFlag, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVDiagGetReturnFlagName(flag::Clong) @@ -981,7 +2175,6 @@ function CVDiagGetReturnFlagName(flag) CVDiagGetReturnFlagName(convert(Clong, flag)) end - function CVDiagB(cvode_mem, which::Cint) ccall((:CVDiagB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, which) end @@ -992,29 +2185,66 @@ end # Julia wrapper for header: cvodes_direct.h # Automatically generated using Clang.jl - function CVDlsSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:CVDlsSetLinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) + ccall( + (:CVDlsSetLinearSolver, libsundials_cvodes), + Cint, + (CVODEMemPtr, SUNLinearSolver, SUNMatrix), + cvode_mem, + LS, + A, + ) end function CVDlsSetJacFn(cvode_mem, jac::CVDlsJacFn) - ccall((:CVDlsSetJacFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVDlsJacFn), cvode_mem, jac) + ccall( + (:CVDlsSetJacFn, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVDlsJacFn), + cvode_mem, + jac, + ) end function CVDlsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVDlsGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVDlsGetWorkSpace, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVDlsGetNumJacEvals(cvode_mem, njevals) - ccall((:CVDlsGetNumJacEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) + ccall( + (:CVDlsGetNumJacEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njevals, + ) end function CVDlsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVDlsGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVDlsGetNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVDlsGetLastFlag(cvode_mem, flag) - ccall((:CVDlsGetLastFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVDlsGetLastFlag, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVDlsGetReturnFlagName(flag::Clong) @@ -1026,7 +2256,15 @@ function CVDlsGetReturnFlagName(flag) end function CVDlsSetLinearSolverB(cvode_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:CVDlsSetLinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), cvode_mem, which, LS, A) + ccall( + (:CVDlsSetLinearSolverB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), + cvode_mem, + which, + LS, + A, + ) end function CVDlsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatrix) @@ -1034,7 +2272,14 @@ function CVDlsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatr end function CVDlsSetJacFnB(cvode_mem, which::Cint, jacB::CVDlsJacFnB) - ccall((:CVDlsSetJacFnB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVDlsJacFnB), cvode_mem, which, jacB) + ccall( + (:CVDlsSetJacFnB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVDlsJacFnB), + cvode_mem, + which, + jacB, + ) end function CVDlsSetJacFnB(cvode_mem, which, jacB::CVDlsJacFnB) @@ -1042,7 +2287,14 @@ function CVDlsSetJacFnB(cvode_mem, which, jacB::CVDlsJacFnB) end function CVDlsSetJacFnBS(cvode_mem, which::Cint, jacBS::CVDlsJacFnBS) - ccall((:CVDlsSetJacFnBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVDlsJacFnBS), cvode_mem, which, jacBS) + ccall( + (:CVDlsSetJacFnBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVDlsJacFnBS), + cvode_mem, + which, + jacBS, + ) end function CVDlsSetJacFnBS(cvode_mem, which, jacBS::CVDlsJacFnBS) @@ -1051,17 +2303,35 @@ end # Julia wrapper for header: cvodes_ls.h # Automatically generated using Clang.jl - function CVodeSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:CVodeSetLinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) + ccall( + (:CVodeSetLinearSolver, libsundials_cvodes), + Cint, + (CVODEMemPtr, SUNLinearSolver, SUNMatrix), + cvode_mem, + LS, + A, + ) end function CVodeSetJacFn(cvode_mem, jac::CVLsJacFn) - ccall((:CVodeSetJacFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsJacFn), cvode_mem, jac) + ccall( + (:CVodeSetJacFn, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVLsJacFn), + cvode_mem, + jac, + ) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj::Clong) - ccall((:CVodeSetMaxStepsBetweenJac, libsundials_cvodes), Cint, (CVODEMemPtr, Clong), cvode_mem, msbj) + ccall( + (:CVodeSetMaxStepsBetweenJac, libsundials_cvodes), + Cint, + (CVODEMemPtr, Clong), + cvode_mem, + msbj, + ) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) @@ -1069,59 +2339,150 @@ function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) end function CVodeSetEpsLin(cvode_mem, eplifac::realtype) - ccall((:CVodeSetEpsLin, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) + ccall( + (:CVodeSetEpsLin, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + eplifac, + ) end function CVodeSetPreconditioner(cvode_mem, pset::CVLsPrecSetupFn, psolve::CVLsPrecSolveFn) - ccall((:CVodeSetPreconditioner, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), cvode_mem, pset, psolve) -end - -function CVodeSetJacTimes(cvode_mem, jtsetup::CVLsJacTimesSetupFn, jtimes::CVLsJacTimesVecFn) - ccall((:CVodeSetJacTimes, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), cvode_mem, jtsetup, jtimes) + ccall( + (:CVodeSetPreconditioner, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), + cvode_mem, + pset, + psolve, + ) +end + +function CVodeSetJacTimes( + cvode_mem, + jtsetup::CVLsJacTimesSetupFn, + jtimes::CVLsJacTimesVecFn, +) + ccall( + (:CVodeSetJacTimes, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), + cvode_mem, + jtsetup, + jtimes, + ) end function CVodeSetLinSysFn(cvode_mem, linsys::CVLsLinSysFn) - ccall((:CVodeSetLinSysFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsLinSysFn), cvode_mem, linsys) + ccall( + (:CVodeSetLinSysFn, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVLsLinSysFn), + cvode_mem, + linsys, + ) end function CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVodeGetLinWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVodeGetLinWorkSpace, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVodeGetNumJacEvals(cvode_mem, njevals) - ccall((:CVodeGetNumJacEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) + ccall( + (:CVodeGetNumJacEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njevals, + ) end function CVodeGetNumPrecEvals(cvode_mem, npevals) - ccall((:CVodeGetNumPrecEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) + ccall( + (:CVodeGetNumPrecEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npevals, + ) end function CVodeGetNumPrecSolves(cvode_mem, npsolves) - ccall((:CVodeGetNumPrecSolves, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) + ccall( + (:CVodeGetNumPrecSolves, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npsolves, + ) end function CVodeGetNumLinIters(cvode_mem, nliters) - ccall((:CVodeGetNumLinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) + ccall( + (:CVodeGetNumLinIters, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nliters, + ) end function CVodeGetNumLinConvFails(cvode_mem, nlcfails) - ccall((:CVodeGetNumLinConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) + ccall( + (:CVodeGetNumLinConvFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nlcfails, + ) end function CVodeGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall((:CVodeGetNumJTSetupEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) + ccall( + (:CVodeGetNumJTSetupEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njtsetups, + ) end function CVodeGetNumJtimesEvals(cvode_mem, njvevals) - ccall((:CVodeGetNumJtimesEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) + ccall( + (:CVodeGetNumJtimesEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njvevals, + ) end function CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVodeGetNumLinRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVodeGetNumLinRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVodeGetLastLinFlag(cvode_mem, flag) - ccall((:CVodeGetLastLinFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVodeGetLastLinFlag, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVodeGetLinReturnFlagName(flag::Clong) @@ -1133,7 +2494,15 @@ function CVodeGetLinReturnFlagName(flag) end function CVodeSetLinearSolverB(cvode_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:CVodeSetLinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), cvode_mem, which, LS, A) + ccall( + (:CVodeSetLinearSolverB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), + cvode_mem, + which, + LS, + A, + ) end function CVodeSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatrix) @@ -1141,7 +2510,14 @@ function CVodeSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatr end function CVodeSetJacFnB(cvode_mem, which::Cint, jacB::CVLsJacFnB) - ccall((:CVodeSetJacFnB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacFnB), cvode_mem, which, jacB) + ccall( + (:CVodeSetJacFnB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsJacFnB), + cvode_mem, + which, + jacB, + ) end function CVodeSetJacFnB(cvode_mem, which, jacB::CVLsJacFnB) @@ -1149,7 +2525,14 @@ function CVodeSetJacFnB(cvode_mem, which, jacB::CVLsJacFnB) end function CVodeSetJacFnBS(cvode_mem, which::Cint, jacBS::CVLsJacFnBS) - ccall((:CVodeSetJacFnBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacFnBS), cvode_mem, which, jacBS) + ccall( + (:CVodeSetJacFnBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsJacFnBS), + cvode_mem, + which, + jacBS, + ) end function CVodeSetJacFnBS(cvode_mem, which, jacBS::CVLsJacFnBS) @@ -1157,47 +2540,133 @@ function CVodeSetJacFnBS(cvode_mem, which, jacBS::CVLsJacFnBS) end function CVodeSetEpsLinB(cvode_mem, which::Cint, eplifacB::realtype) - ccall((:CVodeSetEpsLinB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, eplifacB) + ccall( + (:CVodeSetEpsLinB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype), + cvode_mem, + which, + eplifacB, + ) end function CVodeSetEpsLinB(cvode_mem, which, eplifacB::realtype) CVodeSetEpsLinB(cvode_mem, convert(Cint, which), eplifacB) end -function CVodeSetPreconditionerB(cvode_mem, which::Cint, psetB::CVLsPrecSetupFnB, psolveB::CVLsPrecSolveFnB) - ccall((:CVodeSetPreconditionerB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsPrecSetupFnB, CVLsPrecSolveFnB), cvode_mem, which, psetB, psolveB) -end - -function CVodeSetPreconditionerB(cvode_mem, which, psetB::CVLsPrecSetupFnB, psolveB::CVLsPrecSolveFnB) +function CVodeSetPreconditionerB( + cvode_mem, + which::Cint, + psetB::CVLsPrecSetupFnB, + psolveB::CVLsPrecSolveFnB, +) + ccall( + (:CVodeSetPreconditionerB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsPrecSetupFnB, CVLsPrecSolveFnB), + cvode_mem, + which, + psetB, + psolveB, + ) +end + +function CVodeSetPreconditionerB( + cvode_mem, + which, + psetB::CVLsPrecSetupFnB, + psolveB::CVLsPrecSolveFnB, +) CVodeSetPreconditionerB(cvode_mem, convert(Cint, which), psetB, psolveB) end -function CVodeSetPreconditionerBS(cvode_mem, which::Cint, psetBS::CVLsPrecSetupFnBS, psolveBS::CVLsPrecSolveFnBS) - ccall((:CVodeSetPreconditionerBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsPrecSetupFnBS, CVLsPrecSolveFnBS), cvode_mem, which, psetBS, psolveBS) -end - -function CVodeSetPreconditionerBS(cvode_mem, which, psetBS::CVLsPrecSetupFnBS, psolveBS::CVLsPrecSolveFnBS) +function CVodeSetPreconditionerBS( + cvode_mem, + which::Cint, + psetBS::CVLsPrecSetupFnBS, + psolveBS::CVLsPrecSolveFnBS, +) + ccall( + (:CVodeSetPreconditionerBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsPrecSetupFnBS, CVLsPrecSolveFnBS), + cvode_mem, + which, + psetBS, + psolveBS, + ) +end + +function CVodeSetPreconditionerBS( + cvode_mem, + which, + psetBS::CVLsPrecSetupFnBS, + psolveBS::CVLsPrecSolveFnBS, +) CVodeSetPreconditionerBS(cvode_mem, convert(Cint, which), psetBS, psolveBS) end -function CVodeSetJacTimesB(cvode_mem, which::Cint, jtsetupB::CVLsJacTimesSetupFnB, jtimesB::CVLsJacTimesVecFnB) - ccall((:CVodeSetJacTimesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacTimesSetupFnB, CVLsJacTimesVecFnB), cvode_mem, which, jtsetupB, jtimesB) -end - -function CVodeSetJacTimesB(cvode_mem, which, jtsetupB::CVLsJacTimesSetupFnB, jtimesB::CVLsJacTimesVecFnB) +function CVodeSetJacTimesB( + cvode_mem, + which::Cint, + jtsetupB::CVLsJacTimesSetupFnB, + jtimesB::CVLsJacTimesVecFnB, +) + ccall( + (:CVodeSetJacTimesB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsJacTimesSetupFnB, CVLsJacTimesVecFnB), + cvode_mem, + which, + jtsetupB, + jtimesB, + ) +end + +function CVodeSetJacTimesB( + cvode_mem, + which, + jtsetupB::CVLsJacTimesSetupFnB, + jtimesB::CVLsJacTimesVecFnB, +) CVodeSetJacTimesB(cvode_mem, convert(Cint, which), jtsetupB, jtimesB) end -function CVodeSetJacTimesBS(cvode_mem, which::Cint, jtsetupBS::CVLsJacTimesSetupFnBS, jtimesBS::CVLsJacTimesVecFnBS) - ccall((:CVodeSetJacTimesBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacTimesSetupFnBS, CVLsJacTimesVecFnBS), cvode_mem, which, jtsetupBS, jtimesBS) -end - -function CVodeSetJacTimesBS(cvode_mem, which, jtsetupBS::CVLsJacTimesSetupFnBS, jtimesBS::CVLsJacTimesVecFnBS) +function CVodeSetJacTimesBS( + cvode_mem, + which::Cint, + jtsetupBS::CVLsJacTimesSetupFnBS, + jtimesBS::CVLsJacTimesVecFnBS, +) + ccall( + (:CVodeSetJacTimesBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsJacTimesSetupFnBS, CVLsJacTimesVecFnBS), + cvode_mem, + which, + jtsetupBS, + jtimesBS, + ) +end + +function CVodeSetJacTimesBS( + cvode_mem, + which, + jtsetupBS::CVLsJacTimesSetupFnBS, + jtimesBS::CVLsJacTimesVecFnBS, +) CVodeSetJacTimesBS(cvode_mem, convert(Cint, which), jtsetupBS, jtimesBS) end function CVodeSetLinSysFnB(cvode_mem, which::Cint, linsys::CVLsLinSysFnB) - ccall((:CVodeSetLinSysFnB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsLinSysFnB), cvode_mem, which, linsys) + ccall( + (:CVodeSetLinSysFnB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsLinSysFnB), + cvode_mem, + which, + linsys, + ) end function CVodeSetLinSysFnB(cvode_mem, which, linsys::CVLsLinSysFnB) @@ -1205,7 +2674,14 @@ function CVodeSetLinSysFnB(cvode_mem, which, linsys::CVLsLinSysFnB) end function CVodeSetLinSysFnBS(cvode_mem, which::Cint, linsys::CVLsLinSysFnBS) - ccall((:CVodeSetLinSysFnBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsLinSysFnBS), cvode_mem, which, linsys) + ccall( + (:CVodeSetLinSysFnBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVLsLinSysFnBS), + cvode_mem, + which, + linsys, + ) end function CVodeSetLinSysFnBS(cvode_mem, which, linsys::CVLsLinSysFnBS) @@ -1214,57 +2690,145 @@ end # Julia wrapper for header: cvodes_spils.h # Automatically generated using Clang.jl - function CVSpilsSetLinearSolver(cvode_mem, LS::SUNLinearSolver) - ccall((:CVSpilsSetLinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNLinearSolver), cvode_mem, LS) + ccall( + (:CVSpilsSetLinearSolver, libsundials_cvodes), + Cint, + (CVODEMemPtr, SUNLinearSolver), + cvode_mem, + LS, + ) end function CVSpilsSetEpsLin(cvode_mem, eplifac::realtype) - ccall((:CVSpilsSetEpsLin, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) -end - -function CVSpilsSetPreconditioner(cvode_mem, pset::CVSpilsPrecSetupFn, psolve::CVSpilsPrecSolveFn) - ccall((:CVSpilsSetPreconditioner, libsundials_cvodes), Cint, (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), cvode_mem, pset, psolve) -end - -function CVSpilsSetJacTimes(cvode_mem, jtsetup::CVSpilsJacTimesSetupFn, jtimes::CVSpilsJacTimesVecFn) - ccall((:CVSpilsSetJacTimes, libsundials_cvodes), Cint, (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), cvode_mem, jtsetup, jtimes) + ccall( + (:CVSpilsSetEpsLin, libsundials_cvodes), + Cint, + (CVODEMemPtr, realtype), + cvode_mem, + eplifac, + ) +end + +function CVSpilsSetPreconditioner( + cvode_mem, + pset::CVSpilsPrecSetupFn, + psolve::CVSpilsPrecSolveFn, +) + ccall( + (:CVSpilsSetPreconditioner, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), + cvode_mem, + pset, + psolve, + ) +end + +function CVSpilsSetJacTimes( + cvode_mem, + jtsetup::CVSpilsJacTimesSetupFn, + jtimes::CVSpilsJacTimesVecFn, +) + ccall( + (:CVSpilsSetJacTimes, libsundials_cvodes), + Cint, + (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), + cvode_mem, + jtsetup, + jtimes, + ) end function CVSpilsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall((:CVSpilsGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) + ccall( + (:CVSpilsGetWorkSpace, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), + cvode_mem, + lenrwLS, + leniwLS, + ) end function CVSpilsGetNumPrecEvals(cvode_mem, npevals) - ccall((:CVSpilsGetNumPrecEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) + ccall( + (:CVSpilsGetNumPrecEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npevals, + ) end function CVSpilsGetNumPrecSolves(cvode_mem, npsolves) - ccall((:CVSpilsGetNumPrecSolves, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) + ccall( + (:CVSpilsGetNumPrecSolves, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + npsolves, + ) end function CVSpilsGetNumLinIters(cvode_mem, nliters) - ccall((:CVSpilsGetNumLinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) + ccall( + (:CVSpilsGetNumLinIters, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nliters, + ) end function CVSpilsGetNumConvFails(cvode_mem, nlcfails) - ccall((:CVSpilsGetNumConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) + ccall( + (:CVSpilsGetNumConvFails, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nlcfails, + ) end function CVSpilsGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall((:CVSpilsGetNumJTSetupEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) + ccall( + (:CVSpilsGetNumJTSetupEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njtsetups, + ) end function CVSpilsGetNumJtimesEvals(cvode_mem, njvevals) - ccall((:CVSpilsGetNumJtimesEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) + ccall( + (:CVSpilsGetNumJtimesEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + njvevals, + ) end function CVSpilsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall((:CVSpilsGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) + ccall( + (:CVSpilsGetNumRhsEvals, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + nfevalsLS, + ) end function CVSpilsGetLastFlag(cvode_mem, flag) - ccall((:CVSpilsGetLastFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) + ccall( + (:CVSpilsGetLastFlag, libsundials_cvodes), + Cint, + (CVODEMemPtr, Ptr{Clong}), + cvode_mem, + flag, + ) end function CVSpilsGetReturnFlagName(flag) @@ -1272,7 +2836,14 @@ function CVSpilsGetReturnFlagName(flag) end function CVSpilsSetLinearSolverB(cvode_mem, which::Cint, LS::SUNLinearSolver) - ccall((:CVSpilsSetLinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNLinearSolver), cvode_mem, which, LS) + ccall( + (:CVSpilsSetLinearSolverB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, SUNLinearSolver), + cvode_mem, + which, + LS, + ) end function CVSpilsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver) @@ -1280,41 +2851,115 @@ function CVSpilsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver) end function CVSpilsSetEpsLinB(cvode_mem, which::Cint, eplifacB::realtype) - ccall((:CVSpilsSetEpsLinB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, eplifacB) + ccall( + (:CVSpilsSetEpsLinB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, realtype), + cvode_mem, + which, + eplifacB, + ) end function CVSpilsSetEpsLinB(cvode_mem, which, eplifacB::realtype) CVSpilsSetEpsLinB(cvode_mem, convert(Cint, which), eplifacB) end -function CVSpilsSetPreconditionerB(cvode_mem, which::Cint, psetB::CVSpilsPrecSetupFnB, psolveB::CVSpilsPrecSolveFnB) - ccall((:CVSpilsSetPreconditionerB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsPrecSetupFnB, CVSpilsPrecSolveFnB), cvode_mem, which, psetB, psolveB) +function CVSpilsSetPreconditionerB( + cvode_mem, + which::Cint, + psetB::CVSpilsPrecSetupFnB, + psolveB::CVSpilsPrecSolveFnB, +) + ccall( + (:CVSpilsSetPreconditionerB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVSpilsPrecSetupFnB, CVSpilsPrecSolveFnB), + cvode_mem, + which, + psetB, + psolveB, + ) end function CVSpilsSetPreconditionerB(cvode_mem, which, psetB, psolveB) CVSpilsSetPreconditionerB(cvode_mem, convert(Cint, which), psetB, psolveB) end -function CVSpilsSetPreconditionerBS(cvode_mem, which::Cint, psetBS::CVSpilsPrecSetupFnBS, psolveBS::CVSpilsPrecSolveFnBS) - ccall((:CVSpilsSetPreconditionerBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsPrecSetupFnBS, CVSpilsPrecSolveFnBS), cvode_mem, which, psetBS, psolveBS) -end - -function CVSpilsSetPreconditionerBS(cvode_mem, which, psetBS::CVSpilsPrecSetupFnBS, psolveBS::CVSpilsPrecSolveFnBS) +function CVSpilsSetPreconditionerBS( + cvode_mem, + which::Cint, + psetBS::CVSpilsPrecSetupFnBS, + psolveBS::CVSpilsPrecSolveFnBS, +) + ccall( + (:CVSpilsSetPreconditionerBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVSpilsPrecSetupFnBS, CVSpilsPrecSolveFnBS), + cvode_mem, + which, + psetBS, + psolveBS, + ) +end + +function CVSpilsSetPreconditionerBS( + cvode_mem, + which, + psetBS::CVSpilsPrecSetupFnBS, + psolveBS::CVSpilsPrecSolveFnBS, +) CVSpilsSetPreconditionerBS(cvode_mem, convert(Cint, which), psetBS, psolveBS) end -function CVSpilsSetJacTimesB(cvode_mem, which::Cint, jtsetupB::CVSpilsJacTimesSetupFnB, jtimesB::CVSpilsJacTimesVecFnB) - ccall((:CVSpilsSetJacTimesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnB, CVSpilsJacTimesVecFnB), cvode_mem, which, jtsetupB, jtimesB) -end - -function CVSpilsSetJacTimesB(cvode_mem, which, jtsetupB::CVSpilsJacTimesSetupFnB, jtimesB::CVSpilsJacTimesVecFnB) +function CVSpilsSetJacTimesB( + cvode_mem, + which::Cint, + jtsetupB::CVSpilsJacTimesSetupFnB, + jtimesB::CVSpilsJacTimesVecFnB, +) + ccall( + (:CVSpilsSetJacTimesB, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnB, CVSpilsJacTimesVecFnB), + cvode_mem, + which, + jtsetupB, + jtimesB, + ) +end + +function CVSpilsSetJacTimesB( + cvode_mem, + which, + jtsetupB::CVSpilsJacTimesSetupFnB, + jtimesB::CVSpilsJacTimesVecFnB, +) CVSpilsSetJacTimesB(cvode_mem, convert(Cint, which), jtsetupB, jtimesB) end -function CVSpilsSetJacTimesBS(cvode_mem, which::Cint, jtsetupBS::CVSpilsJacTimesSetupFnBS, jtimesBS::CVSpilsJacTimesVecFnBS) - ccall((:CVSpilsSetJacTimesBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnBS, CVSpilsJacTimesVecFnBS), cvode_mem, which, jtsetupBS, jtimesBS) -end - -function CVSpilsSetJacTimesBS(cvode_mem, which, jtsetupBS::CVSpilsJacTimesSetupFnBS, jtimesBS::CVSpilsJacTimesVecFnBS) +function CVSpilsSetJacTimesBS( + cvode_mem, + which::Cint, + jtsetupBS::CVSpilsJacTimesSetupFnBS, + jtimesBS::CVSpilsJacTimesVecFnBS, +) + ccall( + (:CVSpilsSetJacTimesBS, libsundials_cvodes), + Cint, + (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnBS, CVSpilsJacTimesVecFnBS), + cvode_mem, + which, + jtsetupBS, + jtimesBS, + ) +end + +function CVSpilsSetJacTimesBS( + cvode_mem, + which, + jtsetupBS::CVSpilsJacTimesSetupFnBS, + jtimesBS::CVSpilsJacTimesVecFnBS, +) CVSpilsSetJacTimesBS(cvode_mem, convert(Cint, which), jtsetupBS, jtimesBS) end diff --git a/src/API/ida.jl b/src/API/ida.jl index 52f33a03..1d0b1640 100644 --- a/src/API/ida.jl +++ b/src/API/ida.jl @@ -1,13 +1,21 @@ # Julia wrapper for header: ida.h # Automatically generated using Clang.jl - function IDACreate() ccall((:IDACreate, libsundials_ida), IDAMemPtr, ()) end function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0::N_Vector, yp0::N_Vector) - ccall((:IDAInit, libsundials_ida), Cint, (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), ida_mem, res, t0, yy0, yp0) + ccall( + (:IDAInit, libsundials_ida), + Cint, + (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), + ida_mem, + res, + t0, + yy0, + yp0, + ) end function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0, yp0) @@ -17,11 +25,25 @@ function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0, yp0) end function IDASStolerances(ida_mem, reltol::realtype, abstol::realtype) - ccall((:IDASStolerances, libsundials_ida), Cint, (IDAMemPtr, realtype, realtype), ida_mem, reltol, abstol) + ccall( + (:IDASStolerances, libsundials_ida), + Cint, + (IDAMemPtr, realtype, realtype), + ida_mem, + reltol, + abstol, + ) end function IDASVtolerances(ida_mem, reltol::realtype, abstol::N_vector) - ccall((:IDASVtolerances, libsundials_ida), Cint, (IDAMemPtr, realtype, N_Vector), ida_mem, reltol, abstol) + ccall( + (:IDASVtolerances, libsundials_ida), + Cint, + (IDAMemPtr, realtype, N_Vector), + ida_mem, + reltol, + abstol, + ) end function IDASVtolerances(ida_mem, reltol::realtype, abstol) @@ -34,16 +56,28 @@ function IDAWFtolerances(ida_mem, efun::IDAEwtFn) end function IDACalcIC(ida_mem, icopt::Cint, tout1::realtype) - ccall((:IDACalcIC, libsundials_ida), Cint, (IDAMemPtr, Cint, realtype), ida_mem, icopt, tout1) + ccall( + (:IDACalcIC, libsundials_ida), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + icopt, + tout1, + ) end function IDACalcIC(ida_mem, icopt, tout1::realtype) IDACalcIC(ida_mem, convert(Cint, icopt), tout1) end - function IDASetNonlinConvCoefIC(ida_mem, epiccon::realtype) - ccall((:IDASetNonlinConvCoefIC, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, epiccon) + ccall( + (:IDASetNonlinConvCoefIC, libsundials_ida), + Cint, + (IDAMemPtr, realtype), + ida_mem, + epiccon, + ) end function IDASetMaxNumStepsIC(ida_mem, maxnh::Cint) @@ -71,7 +105,13 @@ function IDASetMaxNumItersIC(ida_mem, maxnit) end function IDASetLineSearchOffIC(ida_mem, lsoff::Cint) - ccall((:IDASetLineSearchOffIC, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, lsoff) + ccall( + (:IDASetLineSearchOffIC, libsundials_ida), + Cint, + (IDAMemPtr, Cint), + ida_mem, + lsoff, + ) end function IDASetLineSearchOffIC(ida_mem, lsoff) @@ -79,7 +119,13 @@ function IDASetLineSearchOffIC(ida_mem, lsoff) end function IDASetStepToleranceIC(ida_mem, steptol::realtype) - ccall((:IDASetStepToleranceIC, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, steptol) + ccall( + (:IDASetStepToleranceIC, libsundials_ida), + Cint, + (IDAMemPtr, realtype), + ida_mem, + steptol, + ) end function IDASetMaxBacksIC(ida_mem, maxbacks::Cint) @@ -91,7 +137,14 @@ function IDASetMaxBacksIC(ida_mem, maxbacks) end function IDASetErrHandlerFn(ida_mem, ehfun, eh_data) - ccall((:IDASetErrHandlerFn, libsundials_ida), Cint, (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), ida_mem, ehfun, eh_data) + ccall( + (:IDASetErrHandlerFn, libsundials_ida), + Cint, + (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), + ida_mem, + ehfun, + eh_data, + ) end function IDASetErrFile(ida_mem, errfp) @@ -131,11 +184,23 @@ function IDASetStopTime(ida_mem, tstop::realtype) end function IDASetNonlinConvCoef(ida_mem, epcon::realtype) - ccall((:IDASetNonlinConvCoef, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, epcon) + ccall( + (:IDASetNonlinConvCoef, libsundials_ida), + Cint, + (IDAMemPtr, realtype), + ida_mem, + epcon, + ) end function IDASetMaxErrTestFails(ida_mem, maxnef::Cint) - ccall((:IDASetMaxErrTestFails, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, maxnef) + ccall( + (:IDASetMaxErrTestFails, libsundials_ida), + Cint, + (IDAMemPtr, Cint), + ida_mem, + maxnef, + ) end function IDASetMaxErrTestFails(ida_mem, maxnef) @@ -143,11 +208,17 @@ function IDASetMaxErrTestFails(ida_mem, maxnef) end function IDASetMaxNonlinIters(ida_mem, maxcor::Cint) - ccall((:IDASetMaxNonlinIters, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, maxcor) + ccall( + (:IDASetMaxNonlinIters, libsundials_ida), + Cint, + (IDAMemPtr, Cint), + ida_mem, + maxcor, + ) end function IDASetMaxNonlinIters(ida_mem, maxcor) - IDASetMaxNonlinIters(ida_mem, convert(Cint,maxcor)) + IDASetMaxNonlinIters(ida_mem, convert(Cint, maxcor)) end function IDASetMaxConvFails(ida_mem, maxncf::Cint) @@ -159,7 +230,13 @@ function IDASetMaxConvFails(ida_mem, maxncf) end function IDASetSuppressAlg(ida_mem, suppressalg::Cint) - ccall((:IDASetSuppressAlg, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, suppressalg) + ccall( + (:IDASetSuppressAlg, libsundials_ida), + Cint, + (IDAMemPtr, Cint), + ida_mem, + suppressalg, + ) end function IDASetSuppressAlg(ida_mem, suppressalg) @@ -176,7 +253,13 @@ function IDASetId(ida_mem, id) end function IDASetConstraints(ida_mem, constraints::N_Vector) - ccall((:IDASetConstraints, libsundials_ida), Cint, (IDAMemPtr, N_Vector), ida_mem, constraints) + ccall( + (:IDASetConstraints, libsundials_ida), + Cint, + (IDAMemPtr, N_Vector), + ida_mem, + constraints, + ) end function IDASetConstraints(ida_mem, constraints) @@ -185,11 +268,24 @@ function IDASetConstraints(ida_mem, constraints) end function IDASetNonlinearSolver(ida_mem, NLS::SUNNonlinearSolver) - ccall((:IDASetNonlinearSolver, libsundials_ida), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) + ccall( + (:IDASetNonlinearSolver, libsundials_ida), + Cint, + (IDAMemPtr, SUNNonlinearSolver), + ida_mem, + NLS, + ) end function IDARootInit(ida_mem, nrtfn::Cint, g::IDARootFn) - ccall((:IDARootInit, libsundials_ida), Cint, (IDAMemPtr, Cint, IDARootFn), ida_mem, nrtfn, g) + ccall( + (:IDARootInit, libsundials_ida), + Cint, + (IDAMemPtr, Cint, IDARootFn), + ida_mem, + nrtfn, + g, + ) end function IDARootInit(ida_mem, nrtfn, g::IDARootFn) @@ -197,25 +293,62 @@ function IDARootInit(ida_mem, nrtfn, g::IDARootFn) end function IDASetRootDirection(ida_mem, rootdir) - ccall((:IDASetRootDirection, libsundials_ida), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootdir) + ccall( + (:IDASetRootDirection, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Cint}), + ida_mem, + rootdir, + ) end function IDASetNoInactiveRootWarn(ida_mem) ccall((:IDASetNoInactiveRootWarn, libsundials_ida), Cint, (IDAMemPtr,), ida_mem) end -function IDASolve(ida_mem, tout::realtype, tret, yret::N_Vector, ypret::N_Vector, itask::Cint) - ccall((:IDASolve, libsundials_ida), Cint, (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), ida_mem, tout, tret, yret, ypret, itask) +function IDASolve( + ida_mem, + tout::realtype, + tret, + yret::N_Vector, + ypret::N_Vector, + itask::Cint, +) + ccall( + (:IDASolve, libsundials_ida), + Cint, + (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), + ida_mem, + tout, + tret, + yret, + ypret, + itask, + ) end function IDASolve(ida_mem, tout::realtype, tret, yret, ypret, itask) __yret = convert(NVector, yret) __ypret = convert(NVector, ypret) - IDASolve(ida_mem, tout::realtype, tret, convert(N_Vector, __yret), convert(N_Vector, __ypret), convert(Cint, itask)) + IDASolve( + ida_mem, + tout::realtype, + tret, + convert(N_Vector, __yret), + convert(N_Vector, __ypret), + convert(Cint, itask), + ) end function IDAComputeY(ida_mem, ycor::N_Vector, y::N_Vector) - ccall((:IDAComputeY, libsundials_ida), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, y) + ccall( + (:IDAComputeY, libsundials_ida), + Cint, + (IDAMemPtr, N_Vector, N_Vector), + ida_mem, + ycor, + y, + ) end function IDAComputeY(ida_mem, ycor, y) @@ -225,7 +358,14 @@ function IDAComputeY(ida_mem, ycor, y) end function IDAComputeYp(ida_mem, ycor::N_Vector, yp::N_Vector) - ccall((:IDAComputeYp, libsundials_ida), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, yp) + ccall( + (:IDAComputeYp, libsundials_ida), + Cint, + (IDAMemPtr, N_Vector, N_Vector), + ida_mem, + ycor, + yp, + ) end function IDAComputeYp(ida_mem, ycor, yp) @@ -235,7 +375,15 @@ function IDAComputeYp(ida_mem, ycor, yp) end function IDAGetDky(ida_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:IDAGetDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, N_Vector), ida_mem, t, k, dky) + ccall( + (:IDAGetDky, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint, N_Vector), + ida_mem, + t, + k, + dky, + ) end function IDAGetDky(ida_mem, t, k, dky) @@ -243,33 +391,76 @@ function IDAGetDky(ida_mem, t, k, dky) IDAGetDky(ida_mem, t, convert(Cint, k), convert(N_Vector, __dky)) end - function IDAGetWorkSpace(ida_mem, lenrw, leniw) - ccall((:IDAGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrw, leniw) + ccall( + (:IDAGetWorkSpace, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrw, + leniw, + ) end function IDAGetNumSteps(ida_mem, nsteps) - ccall((:IDAGetNumSteps, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nsteps) + ccall( + (:IDAGetNumSteps, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nsteps, + ) end function IDAGetNumResEvals(ida_mem, nrevals) - ccall((:IDAGetNumResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevals) + ccall( + (:IDAGetNumResEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevals, + ) end function IDAGetNumLinSolvSetups(ida_mem, nlinsetups) - ccall((:IDAGetNumLinSolvSetups, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlinsetups) + ccall( + (:IDAGetNumLinSolvSetups, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nlinsetups, + ) end function IDAGetNumErrTestFails(ida_mem, netfails) - ccall((:IDAGetNumErrTestFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, netfails) + ccall( + (:IDAGetNumErrTestFails, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + netfails, + ) end function IDAGetNumBacktrackOps(ida_mem, nbacktr) - ccall((:IDAGetNumBacktrackOps, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nbacktr) + ccall( + (:IDAGetNumBacktrackOps, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nbacktr, + ) end function IDAGetConsistentIC(ida_mem, yy0_mod::N_Vector, yp0_mod::N_Vector) - ccall((:IDAGetConsistentIC, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, yy0_mod, yp0_mod) + ccall( + (:IDAGetConsistentIC, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector, N_Vector), + ida_mem, + yy0_mod, + yp0_mod, + ) end function IDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) @@ -283,43 +474,103 @@ function IDAGetLastOrder(ida_mem, klast) end function IDAGetCurrentOrder(ida_mem, kcur) - ccall((:IDAGetCurrentOrder, libsundials_ida), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, kcur) + ccall( + (:IDAGetCurrentOrder, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Cint}), + ida_mem, + kcur, + ) end function IDAGetCurrentCj(ida_mem, cj) - ccall((:IDAGetCurrentCj, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, cj) + ccall( + (:IDAGetCurrentCj, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + cj, + ) end function IDAGetCurrentY(ida_mem, ycur) - ccall((:IDAGetCurrentY, libsundials_ida), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ycur) + ccall( + (:IDAGetCurrentY, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{N_Vector}), + ida_mem, + ycur, + ) end function IDAGetCurrentYp(ida_mem, ypcur) - ccall((:IDAGetCurrentYp, libsundials_ida), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ypcur) + ccall( + (:IDAGetCurrentYp, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{N_Vector}), + ida_mem, + ypcur, + ) end function IDAGetActualInitStep(ida_mem, hinused) - ccall((:IDAGetActualInitStep, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hinused) + ccall( + (:IDAGetActualInitStep, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + hinused, + ) end function IDAGetLastStep(ida_mem, hlast) - ccall((:IDAGetLastStep, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hlast) + ccall( + (:IDAGetLastStep, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + hlast, + ) end function IDAGetCurrentStep(ida_mem, hcur) - ccall((:IDAGetCurrentStep, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hcur) + ccall( + (:IDAGetCurrentStep, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + hcur, + ) end function IDAGetCurrentTime(ida_mem, tcur) - ccall((:IDAGetCurrentTime, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tcur) + ccall( + (:IDAGetCurrentTime, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + tcur, + ) end function IDAGetTolScaleFactor(ida_mem, tolsfact) - ccall((:IDAGetTolScaleFactor, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tolsfact) + ccall( + (:IDAGetTolScaleFactor, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + tolsfact, + ) end function IDAGetErrWeights(ida_mem, eweight::N_Vector) - ccall((:IDAGetErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, eweight) + ccall( + (:IDAGetErrWeights, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector), + ida_mem, + eweight, + ) end function IDAGetErrWeights(ida_mem, eweight) @@ -328,7 +579,13 @@ function IDAGetErrWeights(ida_mem, eweight) end function IDAGetEstLocalErrors(ida_mem, ele::N_Vector) - ccall((:IDAGetEstLocalErrors, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, ele) + ccall( + (:IDAGetEstLocalErrors, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector), + ida_mem, + ele, + ) end function IDAGetEstLocalErrors(ida_mem, ele) @@ -337,27 +594,97 @@ function IDAGetEstLocalErrors(ida_mem, ele) end function IDAGetNumGEvals(ida_mem, ngevals) - ccall((:IDAGetNumGEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevals) + ccall( + (:IDAGetNumGEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + ngevals, + ) end function IDAGetRootInfo(ida_mem, rootsfound) - ccall((:IDAGetRootInfo, libsundials_ida), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootsfound) -end - -function IDAGetIntegratorStats(ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) - ccall((:IDAGetIntegratorStats, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall( + (:IDAGetRootInfo, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Cint}), + ida_mem, + rootsfound, + ) +end + +function IDAGetIntegratorStats( + ida_mem, + nsteps, + nrevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, +) + ccall( + (:IDAGetIntegratorStats, libsundials_ida), + Cint, + ( + IDAMemPtr, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Cint}, + Ptr{Cint}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + ), + ida_mem, + nsteps, + nrevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, + ) end function IDAGetNumNonlinSolvIters(ida_mem, nniters) - ccall((:IDAGetNumNonlinSolvIters, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nniters) + ccall( + (:IDAGetNumNonlinSolvIters, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nniters, + ) end function IDAGetNumNonlinSolvConvFails(ida_mem, nncfails) - ccall((:IDAGetNumNonlinSolvConvFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nncfails) + ccall( + (:IDAGetNumNonlinSolvConvFails, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nncfails, + ) end function IDAGetNonlinSolvStats(ida_mem, nniters, nncfails) - ccall((:IDAGetNonlinSolvStats, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nniters, nncfails) + ccall( + (:IDAGetNonlinSolvStats, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + nniters, + nncfails, + ) end function IDAGetReturnFlagName(flag::Clong) @@ -374,28 +701,92 @@ end # Julia wrapper for header: ida_bbdpre.h # Automatically generated using Clang.jl - -function IDABBDPrecInit(ida_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dq_rel_yy::realtype, Gres::IDABBDLocalFn, Gcomm::IDABBDCommFn) - ccall((:IDABBDPrecInit, libsundials_ida), Cint, (IDAMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, IDABBDLocalFn, IDABBDCommFn), ida_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_yy, Gres, Gcomm) -end - -function IDABBDPrecReInit(ida_mem, mudq::sunindextype, mldq::sunindextype, dq_rel_yy::realtype) - ccall((:IDABBDPrecReInit, libsundials_ida), Cint, (IDAMemPtr, sunindextype, sunindextype, realtype), ida_mem, mudq, mldq, dq_rel_yy) +function IDABBDPrecInit( + ida_mem, + Nlocal::sunindextype, + mudq::sunindextype, + mldq::sunindextype, + mukeep::sunindextype, + mlkeep::sunindextype, + dq_rel_yy::realtype, + Gres::IDABBDLocalFn, + Gcomm::IDABBDCommFn, +) + ccall( + (:IDABBDPrecInit, libsundials_ida), + Cint, + ( + IDAMemPtr, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + IDABBDLocalFn, + IDABBDCommFn, + ), + ida_mem, + Nlocal, + mudq, + mldq, + mukeep, + mlkeep, + dq_rel_yy, + Gres, + Gcomm, + ) +end + +function IDABBDPrecReInit( + ida_mem, + mudq::sunindextype, + mldq::sunindextype, + dq_rel_yy::realtype, +) + ccall( + (:IDABBDPrecReInit, libsundials_ida), + Cint, + (IDAMemPtr, sunindextype, sunindextype, realtype), + ida_mem, + mudq, + mldq, + dq_rel_yy, + ) end function IDABBDPrecGetWorkSpace(ida_mem, lenrwBBDP, leniwBBDP) - ccall((:IDABBDPrecGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwBBDP, leniwBBDP) + ccall( + (:IDABBDPrecGetWorkSpace, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwBBDP, + leniwBBDP, + ) end function IDABBDPrecGetNumGfnEvals(ida_mem, ngevalsBBDP) - ccall((:IDABBDPrecGetNumGfnEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevalsBBDP) + ccall( + (:IDABBDPrecGetNumGfnEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + ngevalsBBDP, + ) end # Julia wrapper for header: ida_direct.h # Automatically generated using Clang.jl - function IDADlsSetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:IDADlsSetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) + ccall( + (:IDADlsSetLinearSolver, libsundials_idas), + Cint, + (IDAMemPtr, SUNLinearSolver, SUNMatrix), + ida_mem, + LS, + A, + ) end function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) @@ -403,19 +794,44 @@ function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) end function IDADlsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall((:IDADlsGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) + ccall( + (:IDADlsGetWorkSpace, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwLS, + leniwLS, + ) end function IDADlsGetNumJacEvals(ida_mem, njevals) - ccall((:IDADlsGetNumJacEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) + ccall( + (:IDADlsGetNumJacEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njevals, + ) end function IDADlsGetNumResEvals(ida_mem, nrevalsLS) - ccall((:IDADlsGetNumResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) + ccall( + (:IDADlsGetNumResEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevalsLS, + ) end function IDADlsGetLastFlag(ida_mem, flag) - ccall((:IDADlsGetLastFlag, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) + ccall( + (:IDADlsGetLastFlag, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + flag, + ) end function IDADlsGetReturnFlagName(flag) @@ -424,9 +840,15 @@ end # Julia wrapper for header: ida_ls.h # Automatically generated using Clang.jl - function IDASetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:IDASetLinearSolver, libsundials_ida), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) + ccall( + (:IDASetLinearSolver, libsundials_ida), + Cint, + (IDAMemPtr, SUNLinearSolver, SUNMatrix), + ida_mem, + LS, + A, + ) end function IDASetJacFn(ida_mem, jac::IDADlsJacFn) @@ -434,11 +856,25 @@ function IDASetJacFn(ida_mem, jac::IDADlsJacFn) end function IDASetPreconditioner(ida_mem, pset::IDALsPrecSetupFn, psolve::IDALsPrecSolveFn) - ccall((:IDASetPreconditioner, libsundials_ida), Cint, (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), ida_mem, pset, psolve) + ccall( + (:IDASetPreconditioner, libsundials_ida), + Cint, + (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), + ida_mem, + pset, + psolve, + ) end function IDASetJacTimes(ida_mem, jtsetup::IDALsJacTimesSetupFn, jtimes::IDALsJacTimesVecFn) - ccall((:IDASetJacTimes, libsundials_ida), Cint, (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), ida_mem, jtsetup, jtimes) + ccall( + (:IDASetJacTimes, libsundials_ida), + Cint, + (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), + ida_mem, + jtsetup, + jtimes, + ) end function IDASetEpsLin(ida_mem, eplifac::realtype) @@ -446,47 +882,114 @@ function IDASetEpsLin(ida_mem, eplifac::realtype) end function IDASetIncrementFactor(ida_mem, dqincfac::realtype) - ccall((:IDASetIncrementFactor, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) + ccall( + (:IDASetIncrementFactor, libsundials_ida), + Cint, + (IDAMemPtr, realtype), + ida_mem, + dqincfac, + ) end function IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall((:IDAGetLinWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) + ccall( + (:IDAGetLinWorkSpace, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwLS, + leniwLS, + ) end function IDAGetNumJacEvals(ida_mem, njevals) - ccall((:IDAGetNumJacEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) + ccall( + (:IDAGetNumJacEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njevals, + ) end function IDAGetNumPrecEvals(ida_mem, npevals) - ccall((:IDAGetNumPrecEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) + ccall( + (:IDAGetNumPrecEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npevals, + ) end function IDAGetNumPrecSolves(ida_mem, npsolves) - ccall((:IDAGetNumPrecSolves, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) + ccall( + (:IDAGetNumPrecSolves, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npsolves, + ) end function IDAGetNumLinIters(ida_mem, nliters) - ccall((:IDAGetNumLinIters, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) + ccall( + (:IDAGetNumLinIters, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nliters, + ) end function IDAGetNumLinConvFails(ida_mem, nlcfails) - ccall((:IDAGetNumLinConvFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) + ccall( + (:IDAGetNumLinConvFails, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nlcfails, + ) end function IDAGetNumJTSetupEvals(ida_mem, njtsetups) - ccall((:IDAGetNumJTSetupEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) + ccall( + (:IDAGetNumJTSetupEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njtsetups, + ) end function IDAGetNumJtimesEvals(ida_mem, njvevals) - ccall((:IDAGetNumJtimesEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) + ccall( + (:IDAGetNumJtimesEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njvevals, + ) end function IDAGetNumLinResEvals(ida_mem, nrevalsLS) - ccall((:IDAGetNumLinResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) + ccall( + (:IDAGetNumLinResEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevalsLS, + ) end function IDAGetLastLinFlag(ida_mem, flag) - ccall((:IDAGetLastLinFlag, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) + ccall( + (:IDAGetLastLinFlag, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + flag, + ) end function IDAGetLinReturnFlagName(flag::Clong) @@ -494,67 +997,161 @@ function IDAGetLinReturnFlagName(flag::Clong) end function IDAGetLinReturnFlagName(flag) - IDAGetLinReturnFlagName(convert(Clong,flag)) + IDAGetLinReturnFlagName(convert(Clong, flag)) end # Julia wrapper for header: ida_spils.h # Automatically generated using Clang.jl - function IDASpilsSetLinearSolver(ida_mem, LS::SUNLinearSolver) - ccall((:IDASpilsSetLinearSolver, libsundials_ida), Cint, (IDAMemPtr, SUNLinearSolver), ida_mem, LS) -end - -function IDASpilsSetPreconditioner(ida_mem, pset::IDASpilsPrecSetupFn, psolve::IDASpilsPrecSolveFn) - ccall((:IDASpilsSetPreconditioner, libsundials_ida), Cint, (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), ida_mem, pset, psolve) -end - -function IDASpilsSetJacTimes(ida_mem, jtsetup::IDASpilsJacTimesSetupFn, jtimes::IDASpilsJacTimesVecFn) - ccall((:IDASpilsSetJacTimes, libsundials_ida), Cint, (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), ida_mem, jtsetup, jtimes) + ccall( + (:IDASpilsSetLinearSolver, libsundials_ida), + Cint, + (IDAMemPtr, SUNLinearSolver), + ida_mem, + LS, + ) +end + +function IDASpilsSetPreconditioner( + ida_mem, + pset::IDASpilsPrecSetupFn, + psolve::IDASpilsPrecSolveFn, +) + ccall( + (:IDASpilsSetPreconditioner, libsundials_ida), + Cint, + (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), + ida_mem, + pset, + psolve, + ) +end + +function IDASpilsSetJacTimes( + ida_mem, + jtsetup::IDASpilsJacTimesSetupFn, + jtimes::IDASpilsJacTimesVecFn, +) + ccall( + (:IDASpilsSetJacTimes, libsundials_ida), + Cint, + (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), + ida_mem, + jtsetup, + jtimes, + ) end function IDASpilsSetEpsLin(ida_mem, eplifac::realtype) - ccall((:IDASpilsSetEpsLin, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, eplifac) + ccall( + (:IDASpilsSetEpsLin, libsundials_ida), + Cint, + (IDAMemPtr, realtype), + ida_mem, + eplifac, + ) end function IDASpilsSetIncrementFactor(ida_mem, dqincfac::realtype) - ccall((:IDASpilsSetIncrementFactor, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) + ccall( + (:IDASpilsSetIncrementFactor, libsundials_ida), + Cint, + (IDAMemPtr, realtype), + ida_mem, + dqincfac, + ) end function IDASpilsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall((:IDASpilsGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) + ccall( + (:IDASpilsGetWorkSpace, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwLS, + leniwLS, + ) end function IDASpilsGetNumPrecEvals(ida_mem, npevals) - ccall((:IDASpilsGetNumPrecEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) + ccall( + (:IDASpilsGetNumPrecEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npevals, + ) end function IDASpilsGetNumPrecSolves(ida_mem, npsolves) - ccall((:IDASpilsGetNumPrecSolves, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) + ccall( + (:IDASpilsGetNumPrecSolves, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npsolves, + ) end function IDASpilsGetNumLinIters(ida_mem, nliters) - ccall((:IDASpilsGetNumLinIters, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) + ccall( + (:IDASpilsGetNumLinIters, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nliters, + ) end function IDASpilsGetNumConvFails(ida_mem, nlcfails) - ccall((:IDASpilsGetNumConvFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) + ccall( + (:IDASpilsGetNumConvFails, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nlcfails, + ) end function IDASpilsGetNumJTSetupEvals(ida_mem, njtsetups) - ccall((:IDASpilsGetNumJTSetupEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) + ccall( + (:IDASpilsGetNumJTSetupEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njtsetups, + ) end function IDASpilsGetNumJtimesEvals(ida_mem, njvevals) - ccall((:IDASpilsGetNumJtimesEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) + ccall( + (:IDASpilsGetNumJtimesEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njvevals, + ) end function IDASpilsGetNumResEvals(ida_mem, nrevalsLS) - ccall((:IDASpilsGetNumResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) + ccall( + (:IDASpilsGetNumResEvals, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevalsLS, + ) end function IDASpilsGetLastFlag(ida_mem, flag) - ccall((:IDASpilsGetLastFlag, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) + ccall( + (:IDASpilsGetLastFlag, libsundials_ida), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + flag, + ) end function IDASpilsGetReturnFlagName(flag::Clong) diff --git a/src/API/idas.jl b/src/API/idas.jl index 752e0168..b4267fe3 100644 --- a/src/API/idas.jl +++ b/src/API/idas.jl @@ -1,23 +1,45 @@ # Julia wrapper for header: idas.h # Automatically generated using Clang.jl - function IDACreate() ccall((:IDACreate, libsundials_idas), IDAMemPtr, ()) end function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0::N_Vector, yp0::N_Vector) - ccall((:IDAInit, libsundials_idas), Cint, (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), ida_mem, res, t0, yy0, yp0) + ccall( + (:IDAInit, libsundials_idas), + Cint, + (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), + ida_mem, + res, + t0, + yy0, + yp0, + ) end function IDAInit(ida_mem, res, t0::realtype, yy0, yp0) __yy0 = convert(NVector, yy0) __yp0 = convert(NVector, yp0) - IDAInit(ida_mem, IDAResFn_wrapper(res), t0, convert(N_Vector, __yy0), convert(N_Vector, __yp0)) + IDAInit( + ida_mem, + IDAResFn_wrapper(res), + t0, + convert(N_Vector, __yy0), + convert(N_Vector, __yp0), + ) end function IDAReInit(ida_mem, t0::realtype, yy0::N_Vector, yp0::N_Vector) - ccall((:IDAReInit, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector, N_Vector), ida_mem, t0, yy0, yp0) + ccall( + (:IDAReInit, libsundials_idas), + Cint, + (IDAMemPtr, realtype, N_Vector, N_Vector), + ida_mem, + t0, + yy0, + yp0, + ) end function IDAReInit(ida_mem, t0, yy0, yp0) @@ -27,11 +49,25 @@ function IDAReInit(ida_mem, t0, yy0, yp0) end function IDASStolerances(ida_mem, reltol::realtype, abstol::realtype) - ccall((:IDASStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, realtype), ida_mem, reltol, abstol) + ccall( + (:IDASStolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, realtype), + ida_mem, + reltol, + abstol, + ) end function IDASVtolerances(ida_mem, reltol::realtype, abstol::N_Vector) - ccall((:IDASVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector), ida_mem, reltol, abstol) + ccall( + (:IDASVtolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, N_Vector), + ida_mem, + reltol, + abstol, + ) end function IDASVtolerances(ida_mem, reltol, abstol) @@ -44,7 +80,14 @@ function IDAWFtolerances(ida_mem, efun::IDAEwtFn) end function IDACalcIC(ida_mem, icopt::Cint, tout1::realtype) - ccall((:IDACalcIC, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, icopt, tout1) + ccall( + (:IDACalcIC, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + icopt, + tout1, + ) end function IDACalcIC(ida_mem, icopt, tout1) @@ -52,7 +95,13 @@ function IDACalcIC(ida_mem, icopt, tout1) end function IDASetNonlinConvCoefIC(ida_mem, epiccon::realtype) - ccall((:IDASetNonlinConvCoefIC, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, epiccon) + ccall( + (:IDASetNonlinConvCoefIC, libsundials_idas), + Cint, + (IDAMemPtr, realtype), + ida_mem, + epiccon, + ) end function IDASetMaxNumStepsIC(ida_mem, maxnh::Cint) @@ -72,7 +121,13 @@ function IDASetMaxNumJacsIC(ida_mem, maxnj) end function IDASetMaxNumItersIC(ida_mem, maxnit::Cint) - ccall((:IDASetMaxNumItersIC, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxnit) + ccall( + (:IDASetMaxNumItersIC, libsundials_idas), + Cint, + (IDAMemPtr, Cint), + ida_mem, + maxnit, + ) end function IDASetMaxNumItersIC(ida_mem, maxnit) @@ -80,7 +135,13 @@ function IDASetMaxNumItersIC(ida_mem, maxnit) end function IDASetLineSearchOffIC(ida_mem, lsoff::Cint) - ccall((:IDASetLineSearchOffIC, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, lsoff) + ccall( + (:IDASetLineSearchOffIC, libsundials_idas), + Cint, + (IDAMemPtr, Cint), + ida_mem, + lsoff, + ) end function IDASetLineSearchOffIC(ida_mem, lsoff) @@ -88,7 +149,13 @@ function IDASetLineSearchOffIC(ida_mem, lsoff) end function IDASetStepToleranceIC(ida_mem, steptol::realtype) - ccall((:IDASetStepToleranceIC, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, steptol) + ccall( + (:IDASetStepToleranceIC, libsundials_idas), + Cint, + (IDAMemPtr, realtype), + ida_mem, + steptol, + ) end function IDASetMaxBacksIC(ida_mem, maxbacks::Cint) @@ -100,7 +167,14 @@ function IDASetMaxBacksIC(ida_mem, maxbacks) end function IDASetErrHandlerFn(ida_mem, ehfun::IDAErrHandlerFn, eh_data) - ccall((:IDASetErrHandlerFn, libsundials_idas), Cint, (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), ida_mem, ehfun, eh_data) + ccall( + (:IDASetErrHandlerFn, libsundials_idas), + Cint, + (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), + ida_mem, + ehfun, + eh_data, + ) end function IDASetErrFile(ida_mem, errfp) @@ -120,7 +194,13 @@ function IDASetMaxOrd(ida_mem, maxord) end function IDASetMaxNumSteps(ida_mem, mxsteps::Clong) - ccall((:IDASetMaxNumSteps, libsundials_idas), Cint, (IDAMemPtr, Clong), ida_mem, mxsteps) + ccall( + (:IDASetMaxNumSteps, libsundials_idas), + Cint, + (IDAMemPtr, Clong), + ida_mem, + mxsteps, + ) end function IDASetMaxNumSteps(ida_mem, mxsteps) @@ -140,11 +220,23 @@ function IDASetStopTime(ida_mem, tstop::realtype) end function IDASetNonlinConvCoef(ida_mem, epcon::realtype) - ccall((:IDASetNonlinConvCoef, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, epcon) + ccall( + (:IDASetNonlinConvCoef, libsundials_idas), + Cint, + (IDAMemPtr, realtype), + ida_mem, + epcon, + ) end function IDASetMaxErrTestFails(ida_mem, maxnef::Cint) - ccall((:IDASetMaxErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxnef) + ccall( + (:IDASetMaxErrTestFails, libsundials_idas), + Cint, + (IDAMemPtr, Cint), + ida_mem, + maxnef, + ) end function IDASetMaxErrTestFails(ida_mem, maxnef) @@ -152,7 +244,13 @@ function IDASetMaxErrTestFails(ida_mem, maxnef) end function IDASetMaxNonlinIters(ida_mem, maxcor::Cint) - ccall((:IDASetMaxNonlinIters, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxcor) + ccall( + (:IDASetMaxNonlinIters, libsundials_idas), + Cint, + (IDAMemPtr, Cint), + ida_mem, + maxcor, + ) end function IDASetMaxNonlinIters(ida_mem, maxcor) @@ -168,7 +266,13 @@ function IDASetMaxConvFails(ida_mem, maxncf) end function IDASetSuppressAlg(ida_mem, suppressalg::Cint) - ccall((:IDASetSuppressAlg, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, suppressalg) + ccall( + (:IDASetSuppressAlg, libsundials_idas), + Cint, + (IDAMemPtr, Cint), + ida_mem, + suppressalg, + ) end function IDASetSuppressAlg(ida_mem, suppressalg) @@ -185,7 +289,13 @@ function IDASetId(ida_mem, id) end function IDASetConstraints(ida_mem, constraints::N_Vector) - ccall((:IDASetConstraints, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, constraints) + ccall( + (:IDASetConstraints, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector), + ida_mem, + constraints, + ) end function IDASetConstraints(ida_mem, constraints) @@ -194,11 +304,24 @@ function IDASetConstraints(ida_mem, constraints) end function IDASetNonlinearSolver(ida_mem, NLS::SUNNonlinearSolver) - ccall((:IDASetNonlinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) + ccall( + (:IDASetNonlinearSolver, libsundials_idas), + Cint, + (IDAMemPtr, SUNNonlinearSolver), + ida_mem, + NLS, + ) end function IDARootInit(ida_mem, nrtfn::Cint, g::IDARootFn) - ccall((:IDARootInit, libsundials_idas), Cint, (IDAMemPtr, Cint, IDARootFn), ida_mem, nrtfn, g) + ccall( + (:IDARootInit, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDARootFn), + ida_mem, + nrtfn, + g, + ) end function IDARootInit(ida_mem, nrtfn, g) @@ -206,25 +329,62 @@ function IDARootInit(ida_mem, nrtfn, g) end function IDASetRootDirection(ida_mem, rootdir) - ccall((:IDASetRootDirection, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootdir) + ccall( + (:IDASetRootDirection, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Cint}), + ida_mem, + rootdir, + ) end function IDASetNoInactiveRootWarn(ida_mem) ccall((:IDASetNoInactiveRootWarn, libsundials_idas), Cint, (IDAMemPtr,), ida_mem) end -function IDASolve(ida_mem, tout::realtype, tret, yret::N_Vector, ypret::N_Vector, itask::Cint) - ccall((:IDASolve, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), ida_mem, tout, tret, yret, ypret, itask) +function IDASolve( + ida_mem, + tout::realtype, + tret, + yret::N_Vector, + ypret::N_Vector, + itask::Cint, +) + ccall( + (:IDASolve, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), + ida_mem, + tout, + tret, + yret, + ypret, + itask, + ) end function IDASolve(ida_mem, tout, tret, yret, ypret, itask) __yret = convert(NVector, yret) __ypret = convert(NVector, ypret) - IDASolve(ida_mem, tout, tret, convert(N_Vector, __yret), convert(N_Vector, __ypret), convert(Cint, itask)) + IDASolve( + ida_mem, + tout, + tret, + convert(N_Vector, __yret), + convert(N_Vector, __ypret), + convert(Cint, itask), + ) end function IDAComputeY(ida_mem, ycor::N_Vector, y::N_Vector) - ccall((:IDAComputeY, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, y) + ccall( + (:IDAComputeY, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector, N_Vector), + ida_mem, + ycor, + y, + ) end function IDAComputeY(ida_mem, ycor, y) @@ -234,7 +394,14 @@ function IDAComputeY(ida_mem, ycor, y) end function IDAComputeYp(ida_mem, ycor::N_Vector, y::N_Vector) - ccall((:IDAComputeYp, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, yp) + ccall( + (:IDAComputeYp, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector, N_Vector), + ida_mem, + ycor, + yp, + ) end function IDAComputeYp(ida_mem, ycor, yp) @@ -244,15 +411,37 @@ function IDAComputeYp(ida_mem, ycor, yp) end function IDAComputeYSens(ida_mem, ycor, yyS) - ccall((:IDAComputeYSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, ycor, yyS) + ccall( + (:IDAComputeYSens, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), + ida_mem, + ycor, + yyS, + ) end function IDAComputeYpSens(ida_mem, ycor, ypS) - ccall((:IDAComputeYpSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, ycor, ypS) + ccall( + (:IDAComputeYpSens, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), + ida_mem, + ycor, + ypS, + ) end function IDAGetDky(ida_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:IDAGetDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, N_Vector), ida_mem, t, k, dky) + ccall( + (:IDAGetDky, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint, N_Vector), + ida_mem, + t, + k, + dky, + ) end function IDAGetDky(ida_mem, t, k, dky) @@ -261,31 +450,75 @@ function IDAGetDky(ida_mem, t, k, dky) end function IDAGetWorkSpace(ida_mem, lenrw, leniw) - ccall((:IDAGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrw, leniw) + ccall( + (:IDAGetWorkSpace, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrw, + leniw, + ) end function IDAGetNumSteps(ida_mem, nsteps) - ccall((:IDAGetNumSteps, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nsteps) + ccall( + (:IDAGetNumSteps, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nsteps, + ) end function IDAGetNumResEvals(ida_mem, nrevals) - ccall((:IDAGetNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevals) + ccall( + (:IDAGetNumResEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevals, + ) end function IDAGetNumLinSolvSetups(ida_mem, nlinsetups) - ccall((:IDAGetNumLinSolvSetups, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlinsetups) + ccall( + (:IDAGetNumLinSolvSetups, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nlinsetups, + ) end function IDAGetNumErrTestFails(ida_mem, netfails) - ccall((:IDAGetNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, netfails) + ccall( + (:IDAGetNumErrTestFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + netfails, + ) end function IDAGetNumBacktrackOps(ida_mem, nbacktr) - ccall((:IDAGetNumBacktrackOps, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nbacktr) + ccall( + (:IDAGetNumBacktrackOps, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nbacktr, + ) end function IDAGetConsistentIC(ida_mem, yy0_mod::N_Vector, yp0_mod::N_Vector) - ccall((:IDAGetConsistentIC, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, yy0_mod, yp0_mod) + ccall( + (:IDAGetConsistentIC, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector, N_Vector), + ida_mem, + yy0_mod, + yp0_mod, + ) end function IDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) @@ -295,55 +528,133 @@ function IDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) end function IDAGetLastOrder(ida_mem, klast) - ccall((:IDAGetLastOrder, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, klast) + ccall( + (:IDAGetLastOrder, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Cint}), + ida_mem, + klast, + ) end function IDAGetCurrentOrder(ida_mem, kcur) - ccall((:IDAGetCurrentOrder, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, kcur) + ccall( + (:IDAGetCurrentOrder, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Cint}), + ida_mem, + kcur, + ) end function IDAGetCurrentCj(ida_mem, cj) - ccall((:IDAGetCurrentCj, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, cj) + ccall( + (:IDAGetCurrentCj, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + cj, + ) end function IDAGetCurrentY(ida_mem, ycur) - ccall((:IDAGetCurrentY, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ycur) + ccall( + (:IDAGetCurrentY, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{N_Vector}), + ida_mem, + ycur, + ) end function IDAGetCurrentYSens(ida_mem, yS) - ccall((:IDAGetCurrentYSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{Ptr{N_Vector}}), ida_mem, yS) + ccall( + (:IDAGetCurrentYSens, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Ptr{N_Vector}}), + ida_mem, + yS, + ) end function IDAGetCurrentYp(ida_mem, ypcur) - ccall((:IDAGetCurrentYp, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ypcur) + ccall( + (:IDAGetCurrentYp, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{N_Vector}), + ida_mem, + ypcur, + ) end function IDAGetCurrentYpSens(ida_mem, ypS) - ccall((:IDAGetCurrentYpSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{Ptr{N_Vector}}), ida_mem, ypS) + ccall( + (:IDAGetCurrentYpSens, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Ptr{N_Vector}}), + ida_mem, + ypS, + ) end function IDAGetActualInitStep(ida_mem, hinused) - ccall((:IDAGetActualInitStep, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hinused) + ccall( + (:IDAGetActualInitStep, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + hinused, + ) end function IDAGetLastStep(ida_mem, hlast) - ccall((:IDAGetLastStep, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hlast) + ccall( + (:IDAGetLastStep, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + hlast, + ) end function IDAGetCurrentStep(ida_mem, hcur) - ccall((:IDAGetCurrentStep, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hcur) + ccall( + (:IDAGetCurrentStep, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + hcur, + ) end function IDAGetCurrentTime(ida_mem, tcur) - ccall((:IDAGetCurrentTime, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tcur) + ccall( + (:IDAGetCurrentTime, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + tcur, + ) end function IDAGetTolScaleFactor(ida_mem, tolsfact) - ccall((:IDAGetTolScaleFactor, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tolsfact) + ccall( + (:IDAGetTolScaleFactor, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}), + ida_mem, + tolsfact, + ) end function IDAGetErrWeights(ida_mem, eweight::N_Vector) - ccall((:IDAGetErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, eweight) + ccall( + (:IDAGetErrWeights, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector), + ida_mem, + eweight, + ) end function IDAGetErrWeights(ida_mem, eweight) @@ -352,7 +663,13 @@ function IDAGetErrWeights(ida_mem, eweight) end function IDAGetEstLocalErrors(ida_mem, ele::N_Vector) - ccall((:IDAGetEstLocalErrors, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, ele) + ccall( + (:IDAGetEstLocalErrors, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector), + ida_mem, + ele, + ) end function IDAGetEstLocalErrors(ida_mem, ele) @@ -361,27 +678,97 @@ function IDAGetEstLocalErrors(ida_mem, ele) end function IDAGetNumGEvals(ida_mem, ngevals) - ccall((:IDAGetNumGEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevals) + ccall( + (:IDAGetNumGEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + ngevals, + ) end function IDAGetRootInfo(ida_mem, rootsfound) - ccall((:IDAGetRootInfo, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootsfound) -end - -function IDAGetIntegratorStats(ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) - ccall((:IDAGetIntegratorStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall( + (:IDAGetRootInfo, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Cint}), + ida_mem, + rootsfound, + ) +end + +function IDAGetIntegratorStats( + ida_mem, + nsteps, + nrevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, +) + ccall( + (:IDAGetIntegratorStats, libsundials_idas), + Cint, + ( + IDAMemPtr, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Clong}, + Ptr{Cint}, + Ptr{Cint}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + Ptr{realtype}, + ), + ida_mem, + nsteps, + nrevals, + nlinsetups, + netfails, + qlast, + qcur, + hinused, + hlast, + hcur, + tcur, + ) end function IDAGetNumNonlinSolvIters(ida_mem, nniters) - ccall((:IDAGetNumNonlinSolvIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nniters) + ccall( + (:IDAGetNumNonlinSolvIters, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nniters, + ) end function IDAGetNumNonlinSolvConvFails(ida_mem, nncfails) - ccall((:IDAGetNumNonlinSolvConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nncfails) + ccall( + (:IDAGetNumNonlinSolvConvFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nncfails, + ) end function IDAGetNonlinSolvStats(ida_mem, nniters, nncfails) - ccall((:IDAGetNonlinSolvStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nniters, nncfails) + ccall( + (:IDAGetNonlinSolvStats, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + nniters, + nncfails, + ) end function IDAGetReturnFlagName(flag::Clong) @@ -397,7 +784,14 @@ function IDAFree(ida_mem) end function IDAQuadInit(ida_mem, rhsQ::IDAQuadRhsFn, yQ0::N_Vector) - ccall((:IDAQuadInit, libsundials_idas), Cint, (IDAMemPtr, IDAQuadRhsFn, N_Vector), ida_mem, rhsQ, yQ0) + ccall( + (:IDAQuadInit, libsundials_idas), + Cint, + (IDAMemPtr, IDAQuadRhsFn, N_Vector), + ida_mem, + rhsQ, + yQ0, + ) end function IDAQuadInit(ida_mem, rhsQ, yQ0) @@ -415,11 +809,25 @@ function IDAQuadReInit(ida_mem, yQ0) end function IDAQuadSStolerances(ida_mem, reltolQ::realtype, abstolQ::realtype) - ccall((:IDAQuadSStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, realtype), ida_mem, reltolQ, abstolQ) + ccall( + (:IDAQuadSStolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, realtype), + ida_mem, + reltolQ, + abstolQ, + ) end function IDAQuadSVtolerances(ida_mem, reltolQ::realtype, abstolQ::N_Vector) - ccall((:IDAQuadSVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector), ida_mem, reltolQ, abstolQ) + ccall( + (:IDAQuadSVtolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, N_Vector), + ida_mem, + reltolQ, + abstolQ, + ) end function IDAQuadSVtolerances(ida_mem, reltolQ, abstolQ) @@ -436,7 +844,14 @@ function IDASetQuadErrCon(ida_mem, errconQ) end function IDAGetQuad(ida_mem, t, yQout::N_Vector) - ccall((:IDAGetQuad, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, N_Vector), ida_mem, t, yQout) + ccall( + (:IDAGetQuad, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}, N_Vector), + ida_mem, + t, + yQout, + ) end function IDAGetQuad(ida_mem, t, yQout) @@ -445,7 +860,15 @@ function IDAGetQuad(ida_mem, t, yQout) end function IDAGetQuadDky(ida_mem, t::realtype, k::Cint, dky::N_Vector) - ccall((:IDAGetQuadDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, N_Vector), ida_mem, t, k, dky) + ccall( + (:IDAGetQuadDky, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint, N_Vector), + ida_mem, + t, + k, + dky, + ) end function IDAGetQuadDky(ida_mem, t, k, dky) @@ -454,15 +877,33 @@ function IDAGetQuadDky(ida_mem, t, k, dky) end function IDAGetQuadNumRhsEvals(ida_mem, nrhsQevals) - ccall((:IDAGetQuadNumRhsEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrhsQevals) + ccall( + (:IDAGetQuadNumRhsEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrhsQevals, + ) end function IDAGetQuadNumErrTestFails(ida_mem, nQetfails) - ccall((:IDAGetQuadNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nQetfails) + ccall( + (:IDAGetQuadNumErrTestFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nQetfails, + ) end function IDAGetQuadErrWeights(ida_mem, eQweight::N_Vector) - ccall((:IDAGetQuadErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, eQweight) + ccall( + (:IDAGetQuadErrWeights, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector), + ida_mem, + eQweight, + ) end function IDAGetQuadErrWeights(ida_mem, eQweight) @@ -471,15 +912,32 @@ function IDAGetQuadErrWeights(ida_mem, eQweight) end function IDAGetQuadStats(ida_mem, nrhsQevals, nQetfails) - ccall((:IDAGetQuadStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nrhsQevals, nQetfails) + ccall( + (:IDAGetQuadStats, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + nrhsQevals, + nQetfails, + ) end function IDAQuadFree(ida_mem) ccall((:IDAQuadFree, libsundials_idas), Cvoid, (IDAMemPtr,), ida_mem) end -function IDASensInit(ida_mem,Ns::Cint, ism::Cint, resS::IDASensResFn, yS0, ypS0) - ccall((:IDASensInit, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint, IDASensResFn, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, Ns, ism, resS, yS0, ypS0) +function IDASensInit(ida_mem, Ns::Cint, ism::Cint, resS::IDASensResFn, yS0, ypS0) + ccall( + (:IDASensInit, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Cint, IDASensResFn, Ptr{N_Vector}, Ptr{N_Vector}), + ida_mem, + Ns, + ism, + resS, + yS0, + ypS0, + ) end function IDASensInit(ida_mem, Ns, ism, resS, yS0, ypS0) @@ -487,7 +945,15 @@ function IDASensInit(ida_mem, Ns, ism, resS, yS0, ypS0) end function IDASensReInit(ida_mem, ism::Cint, yS0, ypS0) - ccall((:IDASensReInit, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, ism, yS0, ypS0) + ccall( + (:IDASensReInit, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Ptr{N_Vector}, Ptr{N_Vector}), + ida_mem, + ism, + yS0, + ypS0, + ) end function IDASensReInit(ida_mem, ism, yS0, ypS0) @@ -495,11 +961,25 @@ function IDASensReInit(ida_mem, ism, yS0, ypS0) end function IDASensSStolerances(ida_mem, reltolS::realtype, abstolS) - ccall((:IDASensSStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}), ida_mem, reltolS, abstolS) + ccall( + (:IDASensSStolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Ptr{realtype}), + ida_mem, + reltolS, + abstolS, + ) end function IDASensSVtolerances(ida_mem, reltolS::realtype, abstolS) - ccall((:IDASensSVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{N_Vector}), ida_mem, reltolS, abstolS) + ccall( + (:IDASensSVtolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Ptr{N_Vector}), + ida_mem, + reltolS, + abstolS, + ) end function IDASensEEtolerances(ida_mem) @@ -507,11 +987,25 @@ function IDASensEEtolerances(ida_mem) end function IDAGetSensConsistentIC(ida_mem, yyS0, ypS0) - ccall((:IDAGetSensConsistentIC, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, yyS0, ypS0) + ccall( + (:IDAGetSensConsistentIC, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), + ida_mem, + yyS0, + ypS0, + ) end function IDASetSensDQMethod(ida_mem, DQtype::Cint, DQrhomax::realtype) - ccall((:IDASetSensDQMethod, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, DQtype, DQrhomax) + ccall( + (:IDASetSensDQMethod, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + DQtype, + DQrhomax, + ) end function IDASetSensDQMethod(ida_mem, DQtype, DQrhomax) @@ -527,7 +1021,13 @@ function IDASetSensErrCon(ida_mem, errconS) end function IDASetSensMaxNonlinIters(ida_mem, maxcorS::Cint) - ccall((:IDASetSensMaxNonlinIters, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxcorS) + ccall( + (:IDASetSensMaxNonlinIters, libsundials_idas), + Cint, + (IDAMemPtr, Cint), + ida_mem, + maxcorS, + ) end function IDASetSensMaxNonlinIters(ida_mem, maxcorS) @@ -535,15 +1035,35 @@ function IDASetSensMaxNonlinIters(ida_mem, maxcorS) end function IDASetSensParams(ida_mem, p, pbar, plist) - ccall((:IDASetSensParams, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), ida_mem, p, pbar, plist) + ccall( + (:IDASetSensParams, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), + ida_mem, + p, + pbar, + plist, + ) end function IDASetNonlinearSolverSensSim(ida_mem, NLS::SUNNonlinearSolver) - ccall((:IDASetNonlinearSolverSensSim, libsundials_idas), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) + ccall( + (:IDASetNonlinearSolverSensSim, libsundials_idas), + Cint, + (IDAMemPtr, SUNNonlinearSolver), + ida_mem, + NLS, + ) end function IDASetNonlinearSolverSensStg(ida_mem, NLS::SUNNonlinearSolver) - ccall((:IDASetNonlinearSolverSensStg, libsundials_idas), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) + ccall( + (:IDASetNonlinearSolverSensStg, libsundials_idas), + Cint, + (IDAMemPtr, SUNNonlinearSolver), + ida_mem, + NLS, + ) end function IDASensToggleOff(ida_mem) @@ -551,11 +1071,26 @@ function IDASensToggleOff(ida_mem) end function IDAGetSens(ida_mem, tret, yySout) - ccall((:IDAGetSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), ida_mem, tret, yySout) + ccall( + (:IDAGetSens, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), + ida_mem, + tret, + yySout, + ) end function IDAGetSens1(ida_mem, tret, is::Cint, yySret::N_Vector) - ccall((:IDAGetSens1, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), ida_mem, tret, is, yySret) + ccall( + (:IDAGetSens1, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), + ida_mem, + tret, + is, + yySret, + ) end function IDAGetSens1(ida_mem, tret, is, yySret) @@ -564,7 +1099,15 @@ function IDAGetSens1(ida_mem, tret, is, yySret) end function IDAGetSensDky(ida_mem, t::realtype, k::Cint, dkyS) - ccall((:IDAGetSensDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), ida_mem, t, k, dkyS) + ccall( + (:IDAGetSensDky, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), + ida_mem, + t, + k, + dkyS, + ) end function IDAGetSensDky(ida_mem, t, k, dkyS) @@ -572,48 +1115,121 @@ function IDAGetSensDky(ida_mem, t, k, dkyS) end function IDAGetSensDky1(ida_mem, t::realtype, k::Cint, is::Cint, dkyS::N_Vector) - ccall((:IDAGetSensDky1, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Cint, N_Vector), ida_mem, t, k, is, dkyS) + ccall( + (:IDAGetSensDky1, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint, Cint, N_Vector), + ida_mem, + t, + k, + is, + dkyS, + ) end function IDAGetSensDky1(ida_mem, t, k, is, dkyS) __dkyS = convert(NVector, dkyS) - IDAGetSensDky1(ida_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dkyS)) + IDAGetSensDky1( + ida_mem, + t, + convert(Cint, k), + convert(Cint, is), + convert(N_Vector, __dkyS), + ) end function IDAGetSensNumResEvals(ida_mem, nresSevals) - ccall((:IDAGetSensNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nresSevals) + ccall( + (:IDAGetSensNumResEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nresSevals, + ) end function IDAGetNumResEvalsSens(ida_mem, nresevalsS) - ccall((:IDAGetNumResEvalsSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nresevalsS) + ccall( + (:IDAGetNumResEvalsSens, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nresevalsS, + ) end function IDAGetSensNumErrTestFails(ida_mem, nSetfails) - ccall((:IDAGetSensNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nSetfails) + ccall( + (:IDAGetSensNumErrTestFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nSetfails, + ) end function IDAGetSensNumLinSolvSetups(ida_mem, nlinsetupsS) - ccall((:IDAGetSensNumLinSolvSetups, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlinsetupsS) + ccall( + (:IDAGetSensNumLinSolvSetups, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nlinsetupsS, + ) end function IDAGetSensErrWeights(ida_mem, eSweight::N_Vector_S) - ccall((:IDAGetSensErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector_S), ida_mem, eSweight) + ccall( + (:IDAGetSensErrWeights, libsundials_idas), + Cint, + (IDAMemPtr, N_Vector_S), + ida_mem, + eSweight, + ) end function IDAGetSensStats(ida_mem, nresSevals, nresevalsS, nSetfails, nlinsetupsS) - ccall((:IDAGetSensStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), ida_mem, nresSevals, nresevalsS, nSetfails, nlinsetupsS) + ccall( + (:IDAGetSensStats, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), + ida_mem, + nresSevals, + nresevalsS, + nSetfails, + nlinsetupsS, + ) end function IDAGetSensNumNonlinSolvIters(ida_mem, nSniters) - ccall((:IDAGetSensNumNonlinSolvIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nSniters) + ccall( + (:IDAGetSensNumNonlinSolvIters, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nSniters, + ) end function IDAGetSensNumNonlinSolvConvFails(ida_mem, nSncfails) - ccall((:IDAGetSensNumNonlinSolvConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nSncfails) + ccall( + (:IDAGetSensNumNonlinSolvConvFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nSncfails, + ) end function IDAGetSensNonlinSolvStats(ida_mem, nSniters, nSncfails) - ccall((:IDAGetSensNonlinSolvStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nSniters, nSncfails) + ccall( + (:IDAGetSensNonlinSolvStats, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + nSniters, + nSncfails, + ) end function IDASensFree(ida_mem) @@ -621,19 +1237,46 @@ function IDASensFree(ida_mem) end function IDAQuadSensInit(ida_mem, resQS::IDAQuadSensRhsFn, yQS0) - ccall((:IDAQuadSensInit, libsundials_idas), Cint, (IDAMemPtr, IDAQuadSensRhsFn, Ptr{N_Vector}), ida_mem, resQS, yQS0) + ccall( + (:IDAQuadSensInit, libsundials_idas), + Cint, + (IDAMemPtr, IDAQuadSensRhsFn, Ptr{N_Vector}), + ida_mem, + resQS, + yQS0, + ) end function IDAQuadSensReInit(ida_mem, yQS0) - ccall((:IDAQuadSensReInit, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, yQS0) + ccall( + (:IDAQuadSensReInit, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{N_Vector}), + ida_mem, + yQS0, + ) end function IDAQuadSensSStolerances(ida_mem, reltolQS::realtype, abstolQS) - ccall((:IDAQuadSensSStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}), ida_mem, reltolQS, abstolQS) + ccall( + (:IDAQuadSensSStolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Ptr{realtype}), + ida_mem, + reltolQS, + abstolQS, + ) end function IDAQuadSensSVtolerances(ida_mem, reltolQS::realtype, abstolQS) - ccall((:IDAQuadSensSVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{N_Vector}), ida_mem, reltolQS, abstolQS) + ccall( + (:IDAQuadSensSVtolerances, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Ptr{N_Vector}), + ida_mem, + reltolQS, + abstolQS, + ) end function IDAQuadSensEEtolerances(ida_mem) @@ -641,7 +1284,13 @@ function IDAQuadSensEEtolerances(ida_mem) end function IDASetQuadSensErrCon(ida_mem, errconQS::Cint) - ccall((:IDASetQuadSensErrCon, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, errconQS) + ccall( + (:IDASetQuadSensErrCon, libsundials_idas), + Cint, + (IDAMemPtr, Cint), + ida_mem, + errconQS, + ) end function IDASetQuadSensErrCon(ida_mem, errconQS) @@ -649,11 +1298,26 @@ function IDASetQuadSensErrCon(ida_mem, errconQS) end function IDAGetQuadSens(ida_mem, tret, yyQSout) - ccall((:IDAGetQuadSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), ida_mem, tret, yyQSout) + ccall( + (:IDAGetQuadSens, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), + ida_mem, + tret, + yyQSout, + ) end function IDAGetQuadSens1(ida_mem, tret, is::Cint, yyQSret::N_Vector) - ccall((:IDAGetQuadSens1, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), ida_mem, tret, is, yyQSret) + ccall( + (:IDAGetQuadSens1, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), + ida_mem, + tret, + is, + yyQSret, + ) end function IDAGetQuadSens1(ida_mem, tret, is, yyQSret) @@ -662,7 +1326,15 @@ function IDAGetQuadSens1(ida_mem, tret, is, yyQSret) end function IDAGetQuadSensDky(ida_mem, t::realtype, k::Cint, dkyQS) - ccall((:IDAGetQuadSensDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), ida_mem, t, k, dkyQS) + ccall( + (:IDAGetQuadSensDky, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), + ida_mem, + t, + k, + dkyQS, + ) end function IDAGetQuadSensDky(ida_mem, t, k, dkyQS) @@ -670,28 +1342,68 @@ function IDAGetQuadSensDky(ida_mem, t, k, dkyQS) end function IDAGetQuadSensDky1(ida_mem, t::realtype, k::Cint, is::Cint, dkyQS::N_Vector) - ccall((:IDAGetQuadSensDky1, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Cint, N_Vector), ida_mem, t, k, is, dkyQS) + ccall( + (:IDAGetQuadSensDky1, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint, Cint, N_Vector), + ida_mem, + t, + k, + is, + dkyQS, + ) end function IDAGetQuadSensDky1(ida_mem, t, k, is, dkyQS) __dkyQS = convert(NVector, dkyQS) - IDAGetQuadSensDky1(ida_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dkyQS)) + IDAGetQuadSensDky1( + ida_mem, + t, + convert(Cint, k), + convert(Cint, is), + convert(N_Vector, __dkyQS), + ) end function IDAGetQuadSensNumRhsEvals(ida_mem, nrhsQSevals) - ccall((:IDAGetQuadSensNumRhsEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrhsQSevals) + ccall( + (:IDAGetQuadSensNumRhsEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrhsQSevals, + ) end function IDAGetQuadSensNumErrTestFails(ida_mem, nQSetfails) - ccall((:IDAGetQuadSensNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nQSetfails) + ccall( + (:IDAGetQuadSensNumErrTestFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nQSetfails, + ) end function IDAGetQuadSensErrWeights(ida_mem, eQSweight) - ccall((:IDAGetQuadSensErrWeights, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, eQSweight) + ccall( + (:IDAGetQuadSensErrWeights, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{N_Vector}), + ida_mem, + eQSweight, + ) end function IDAGetQuadSensStats(ida_mem, nrhsQSevals, nQSetfails) - ccall((:IDAGetQuadSensStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nrhsQSevals, nQSetfails) + ccall( + (:IDAGetQuadSensStats, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + nrhsQSevals, + nQSetfails, + ) end function IDAQuadSensFree(ida_mem) @@ -699,7 +1411,14 @@ function IDAQuadSensFree(ida_mem) end function IDAAdjInit(ida_mem, steps::Clong, interp::Cint) - ccall((:IDAAdjInit, libsundials_idas), Cint, (IDAMemPtr, Clong, Cint), ida_mem, steps, interp) + ccall( + (:IDAAdjInit, libsundials_idas), + Cint, + (IDAMemPtr, Clong, Cint), + ida_mem, + steps, + interp, + ) end function IDAAdjInit(ida_mem, steps, interp) @@ -718,38 +1437,109 @@ function IDACreateB(ida_mem, which) ccall((:IDACreateB, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, which) end -function IDAInitB(ida_mem, which::Cint, resB::IDAResFnB, tB0::realtype, yyB0::N_Vector, ypB0::N_Vector) - ccall((:IDAInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAResFnB, realtype, N_Vector, N_Vector), ida_mem, which, resB, tB0, yyB0, ypB0) +function IDAInitB( + ida_mem, + which::Cint, + resB::IDAResFnB, + tB0::realtype, + yyB0::N_Vector, + ypB0::N_Vector, +) + ccall( + (:IDAInitB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDAResFnB, realtype, N_Vector, N_Vector), + ida_mem, + which, + resB, + tB0, + yyB0, + ypB0, + ) end function IDAInitB(ida_mem, which, resB, tB0, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAInitB(ida_mem, convert(Cint, which), resB, tB0, convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) -end - -function IDAInitBS(ida_mem, which::Cint, resS::IDAResFnBS, tB0::realtype, yyB0::N_Vector, ypB0::N_Vector) - ccall((:IDAInitBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAResFnBS, realtype, N_Vector, N_Vector), ida_mem, which, resS, tB0, yyB0, ypB0) + IDAInitB( + ida_mem, + convert(Cint, which), + resB, + tB0, + convert(N_Vector, __yyB0), + convert(N_Vector, __ypB0), + ) +end + +function IDAInitBS( + ida_mem, + which::Cint, + resS::IDAResFnBS, + tB0::realtype, + yyB0::N_Vector, + ypB0::N_Vector, +) + ccall( + (:IDAInitBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDAResFnBS, realtype, N_Vector, N_Vector), + ida_mem, + which, + resS, + tB0, + yyB0, + ypB0, + ) end function IDAInitBS(ida_mem, which, resS, tB0, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAInitBS(ida_mem, convert(Cint, which), resS, tB0, convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) + IDAInitBS( + ida_mem, + convert(Cint, which), + resS, + tB0, + convert(N_Vector, __yyB0), + convert(N_Vector, __ypB0), + ) end function IDAReInitB(ida_mem, which::Cint, tB0::realtype, yyB0::N_Vector, ypB0::N_Vector) - ccall((:IDAReInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), ida_mem, which, tB0, yyB0, ypB0) + ccall( + (:IDAReInitB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), + ida_mem, + which, + tB0, + yyB0, + ypB0, + ) end function IDAReInitB(ida_mem, which, tB0, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAReInitB(ida_mem, convert(Cint, which), tB0, convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) + IDAReInitB( + ida_mem, + convert(Cint, which), + tB0, + convert(N_Vector, __yyB0), + convert(N_Vector, __ypB0), + ) end function IDASStolerancesB(ida_mem, which::Cint, relTolB::realtype, absTolB::realtype) - ccall((:IDASStolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, realtype), ida_mem, which, relTolB, absTolB) + ccall( + (:IDASStolerancesB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype, realtype), + ida_mem, + which, + relTolB, + absTolB, + ) end function IDASStolerancesB(ida_mem, which, relTolB, absTolB) @@ -757,7 +1547,15 @@ function IDASStolerancesB(ida_mem, which, relTolB, absTolB) end function IDASVtolerancesB(ida_mem, which::Cint, relTolB::realtype, absTolB::N_Vector) - ccall((:IDASVtolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector), ida_mem, which, relTolB, absTolB) + ccall( + (:IDASVtolerancesB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype, N_Vector), + ida_mem, + which, + relTolB, + absTolB, + ) end function IDASVtolerancesB(ida_mem, which, relTolB, absTolB) @@ -766,7 +1564,15 @@ function IDASVtolerancesB(ida_mem, which, relTolB, absTolB) end function IDAQuadInitB(ida_mem, which::Cint, rhsQB::IDAQuadRhsFnB, yQB0::N_Vector) - ccall((:IDAQuadInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAQuadRhsFnB, N_Vector), ida_mem, which, rhsQB, yQB0) + ccall( + (:IDAQuadInitB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDAQuadRhsFnB, N_Vector), + ida_mem, + which, + rhsQB, + yQB0, + ) end function IDAQuadInitB(ida_mem, which, rhsQB, yQB0) @@ -775,7 +1581,15 @@ function IDAQuadInitB(ida_mem, which, rhsQB, yQB0) end function IDAQuadInitBS(ida_mem, which::Cint, rhsQS::IDAQuadRhsFnBS, yQB0::N_Vector) - ccall((:IDAQuadInitBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAQuadRhsFnBS, N_Vector), ida_mem, which, rhsQS, yQB0) + ccall( + (:IDAQuadInitBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDAQuadRhsFnBS, N_Vector), + ida_mem, + which, + rhsQS, + yQB0, + ) end function IDAQuadInitBS(ida_mem, which, rhsQS, yQB0) @@ -784,7 +1598,14 @@ function IDAQuadInitBS(ida_mem, which, rhsQS, yQB0) end function IDAQuadReInitB(ida_mem, which::Cint, yQB0::N_Vector) - ccall((:IDAQuadReInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector), ida_mem, which, yQB0) + ccall( + (:IDAQuadReInitB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, N_Vector), + ida_mem, + which, + yQB0, + ) end function IDAQuadReInitB(ida_mem, which, yQB0) @@ -793,7 +1614,15 @@ function IDAQuadReInitB(ida_mem, which, yQB0) end function IDAQuadSStolerancesB(ida_mem, which::Cint, reltolQB::realtype, abstolQB::realtype) - ccall((:IDAQuadSStolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, realtype), ida_mem, which, reltolQB, abstolQB) + ccall( + (:IDAQuadSStolerancesB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype, realtype), + ida_mem, + which, + reltolQB, + abstolQB, + ) end function IDAQuadSStolerancesB(ida_mem, which, reltolQB, abstolQB) @@ -801,46 +1630,135 @@ function IDAQuadSStolerancesB(ida_mem, which, reltolQB, abstolQB) end function IDAQuadSVtolerancesB(ida_mem, which::Cint, reltolQB::realtype, abstolQB::N_Vector) - ccall((:IDAQuadSVtolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector), ida_mem, which, reltolQB, abstolQB) + ccall( + (:IDAQuadSVtolerancesB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype, N_Vector), + ida_mem, + which, + reltolQB, + abstolQB, + ) end function IDAQuadSVtolerancesB(ida_mem, which, reltolQB, abstolQB) __abstolQB = convert(NVector, abstolQB) - IDAQuadSVtolerancesB(ida_mem, convert(Cint, which), reltolQB, convert(N_Vector, __abstolQB)) + IDAQuadSVtolerancesB( + ida_mem, + convert(Cint, which), + reltolQB, + convert(N_Vector, __abstolQB), + ) end function IDACalcICB(ida_mem, which::Cint, tout1::realtype, yy0::N_Vector, yp0::N_Vector) - ccall((:IDACalcICB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), ida_mem, which, tout1, yy0, yp0) + ccall( + (:IDACalcICB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), + ida_mem, + which, + tout1, + yy0, + yp0, + ) end function IDACalcICB(ida_mem, which, tout1, yy0, yp0) __yy0 = convert(NVector, yy0) __yp0 = convert(NVector, yp0) - IDACalcICB(ida_mem, convert(Cint, which), tout1, convert(N_Vector, __yy0), convert(N_Vector, __yp0)) -end - -function IDACalcICBS(ida_mem, which::Cint, tout1::realtype, yy0::N_Vector, yp0::N_Vector, yyS0, ypS0) - ccall((:IDACalcICBS, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, which, tout1, yy0, yp0, yyS0, ypS0) + IDACalcICB( + ida_mem, + convert(Cint, which), + tout1, + convert(N_Vector, __yy0), + convert(N_Vector, __yp0), + ) +end + +function IDACalcICBS( + ida_mem, + which::Cint, + tout1::realtype, + yy0::N_Vector, + yp0::N_Vector, + yyS0, + ypS0, +) + ccall( + (:IDACalcICBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype, N_Vector, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), + ida_mem, + which, + tout1, + yy0, + yp0, + yyS0, + ypS0, + ) end function IDACalcICBS(ida_mem, which, tout1, yy0, yp0, yyS0, ypS0) __yy0 = convert(NVector, yy0) __yp0 = convert(NVector, yp0) - IDACalcICBS(ida_mem, convert(Cint, which), tout1, convert(N_Vector, __yy0), convert(N_Vector, __yp0), yyS0, ypS0) -end - -function IDASolveF(ida_mem, tout::realtype, tret, yret::N_Vector, ypret::N_Vector, itask::Cint, ncheckPtr) - ccall((:IDASolveF, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint, Ptr{Cint}), ida_mem, tout, tret, yret, ypret, itask, ncheckPtr) + IDACalcICBS( + ida_mem, + convert(Cint, which), + tout1, + convert(N_Vector, __yy0), + convert(N_Vector, __yp0), + yyS0, + ypS0, + ) +end + +function IDASolveF( + ida_mem, + tout::realtype, + tret, + yret::N_Vector, + ypret::N_Vector, + itask::Cint, + ncheckPtr, +) + ccall( + (:IDASolveF, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint, Ptr{Cint}), + ida_mem, + tout, + tret, + yret, + ypret, + itask, + ncheckPtr, + ) end function IDASolveF(ida_mem, tout, tret, yret, ypret, itask, ncheckPtr) __yret = convert(NVector, yret) __ypret = convert(NVector, ypret) - IDASolveF(ida_mem, tout, tret, convert(N_Vector, __yret), convert(N_Vector, __ypret), convert(Cint, itask), ncheckPtr) + IDASolveF( + ida_mem, + tout, + tret, + convert(N_Vector, __yret), + convert(N_Vector, __ypret), + convert(Cint, itask), + ncheckPtr, + ) end function IDASolveB(ida_mem, tBout::realtype, itaskB::Cint) - ccall((:IDASolveB, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint), ida_mem, tBout, itaskB) + ccall( + (:IDASolveB, libsundials_idas), + Cint, + (IDAMemPtr, realtype, Cint), + ida_mem, + tBout, + itaskB, + ) end function IDASolveB(ida_mem, tBout, itaskB) @@ -852,7 +1770,14 @@ function IDAAdjSetNoSensi(ida_mem) end function IDASetUserDataB(ida_mem, which::Cint, user_dataB) - ccall((:IDASetUserDataB, libsundials_idas), Cint, (IDAMemPtr, Cint, Any), ida_mem, which, user_dataB) + ccall( + (:IDASetUserDataB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Any), + ida_mem, + which, + user_dataB, + ) end function IDASetUserDataB(ida_mem, which, user_dataB) @@ -860,7 +1785,14 @@ function IDASetUserDataB(ida_mem, which, user_dataB) end function IDASetMaxOrdB(ida_mem, which::Cint, maxordB::Cint) - ccall((:IDASetMaxOrdB, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint), ida_mem, which, maxordB) + ccall( + (:IDASetMaxOrdB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Cint), + ida_mem, + which, + maxordB, + ) end function IDASetMaxOrdB(ida_mem, which, maxordB) @@ -868,7 +1800,14 @@ function IDASetMaxOrdB(ida_mem, which, maxordB) end function IDASetMaxNumStepsB(ida_mem, which::Cint, mxstepsB::Clong) - ccall((:IDASetMaxNumStepsB, libsundials_idas), Cint, (IDAMemPtr, Cint, Clong), ida_mem, which, mxstepsB) + ccall( + (:IDASetMaxNumStepsB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Clong), + ida_mem, + which, + mxstepsB, + ) end function IDASetMaxNumStepsB(ida_mem, which, mxstepsB) @@ -876,7 +1815,14 @@ function IDASetMaxNumStepsB(ida_mem, which, mxstepsB) end function IDASetInitStepB(ida_mem, which::Cint, hinB::realtype) - ccall((:IDASetInitStepB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, hinB) + ccall( + (:IDASetInitStepB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + which, + hinB, + ) end function IDASetInitStepB(ida_mem, which, hinB) @@ -884,7 +1830,14 @@ function IDASetInitStepB(ida_mem, which, hinB) end function IDASetMaxStepB(ida_mem, which::Cint, hmaxB::realtype) - ccall((:IDASetMaxStepB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, hmaxB) + ccall( + (:IDASetMaxStepB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + which, + hmaxB, + ) end function IDASetMaxStepB(ida_mem, which, hmaxB) @@ -892,7 +1845,14 @@ function IDASetMaxStepB(ida_mem, which, hmaxB) end function IDASetSuppressAlgB(ida_mem, which::Cint, suppressalgB::Cint) - ccall((:IDASetSuppressAlgB, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint), ida_mem, which, suppressalgB) + ccall( + (:IDASetSuppressAlgB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Cint), + ida_mem, + which, + suppressalgB, + ) end function IDASetSuppressAlgB(ida_mem, which, suppressalgB) @@ -900,7 +1860,14 @@ function IDASetSuppressAlgB(ida_mem, which, suppressalgB) end function IDASetIdB(ida_mem, which::Cint, idB::N_Vector) - ccall((:IDASetIdB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector), ida_mem, which, idB) + ccall( + (:IDASetIdB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, N_Vector), + ida_mem, + which, + idB, + ) end function IDASetIdB(ida_mem, which, idB) @@ -909,7 +1876,14 @@ function IDASetIdB(ida_mem, which, idB) end function IDASetConstraintsB(ida_mem, which::Cint, constraintsB::N_Vector) - ccall((:IDASetConstraintsB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector), ida_mem, which, constraintsB) + ccall( + (:IDASetConstraintsB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, N_Vector), + ida_mem, + which, + constraintsB, + ) end function IDASetConstraintsB(ida_mem, which, constraintsB) @@ -918,7 +1892,14 @@ function IDASetConstraintsB(ida_mem, which, constraintsB) end function IDASetQuadErrConB(ida_mem, which::Cint, errconQB::Cint) - ccall((:IDASetQuadErrConB, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint), ida_mem, which, errconQB) + ccall( + (:IDASetQuadErrConB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Cint), + ida_mem, + which, + errconQB, + ) end function IDASetQuadErrConB(ida_mem, which, errconQB) @@ -926,7 +1907,14 @@ function IDASetQuadErrConB(ida_mem, which, errconQB) end function IDASetNonlinearSolverB(ida_mem, which::Cint, NLS::SUNNonlinearSolver) - ccall((:IDASetNonlinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNNonlinearSolver), ida_mem, which, NLS) + ccall( + (:IDASetNonlinearSolverB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, SUNNonlinearSolver), + ida_mem, + which, + NLS, + ) end function IDASetNonlinearSolverB(ida_mem, which, NLS) @@ -934,17 +1922,40 @@ function IDASetNonlinearSolverB(ida_mem, which, NLS) end function IDAGetB(ida_mem, which::Cint, tret, yy::N_Vector, yp::N_Vector) - ccall((:IDAGetB, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), ida_mem, which, tret, yy, yp) + ccall( + (:IDAGetB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), + ida_mem, + which, + tret, + yy, + yp, + ) end function IDAGetB(ida_mem, which, tret, yy, yp) __yy = convert(NVector, yy) __yp = convert(NVector, yp) - IDAGetB(ida_mem, convert(Cint, which), tret, convert(N_Vector, __yy), convert(N_Vector, __yp)) + IDAGetB( + ida_mem, + convert(Cint, which), + tret, + convert(N_Vector, __yy), + convert(N_Vector, __yp), + ) end function IDAGetQuadB(ida_mem, which::Cint, tret, qB::N_Vector) - ccall((:IDAGetQuadB, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, N_Vector), ida_mem, which, tret, qB) + ccall( + (:IDAGetQuadB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Ptr{realtype}, N_Vector), + ida_mem, + which, + tret, + qB, + ) end function IDAGetQuadB(ida_mem, which, tret, qB) @@ -953,25 +1964,52 @@ function IDAGetQuadB(ida_mem, which, tret, qB) end function IDAGetAdjIDABmem(ida_mem, which::Cint) - ccall((:IDAGetAdjIDABmem, libsundials_idas), Ptr{Cvoid}, (IDAMemPtr, Cint), ida_mem, which) + ccall( + (:IDAGetAdjIDABmem, libsundials_idas), + Ptr{Cvoid}, + (IDAMemPtr, Cint), + ida_mem, + which, + ) end function IDAGetAdjIDABmem(ida_mem, which) IDAGetAdjIDABmem(ida_mem, convert(Cint, which)) end -function IDAGetConsistentICB(ida_mem, which::Cint, yyB0::N_Vector, ypB0::N_Vector) - ccall((:IDAGetConsistentICB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector, N_Vector), ida_mem, which, yyB0, ypB0) +function IDAGetConsistentICB(ida_mem, which::Cint, yyB0::N_Vector, ypB0::N_Vector) + ccall( + (:IDAGetConsistentICB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, N_Vector, N_Vector), + ida_mem, + which, + yyB0, + ypB0, + ) end function IDAGetConsistentICB(ida_mem, which, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAGetConsistentICB(ida_mem, convert(Cint, which), convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) + IDAGetConsistentICB( + ida_mem, + convert(Cint, which), + convert(N_Vector, __yyB0), + convert(N_Vector, __ypB0), + ) end function IDAGetAdjY(ida_mem, t::realtype, yy::N_Vector, yp::N_Vector) - ccall((:IDAGetAdjY, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector, N_Vector), ida_mem, t, yy, yp) + ccall( + (:IDAGetAdjY, libsundials_idas), + Cint, + (IDAMemPtr, realtype, N_Vector, N_Vector), + ida_mem, + t, + yy, + yp, + ) end function IDAGetAdjY(ida_mem, t, yy, yp) @@ -981,61 +2019,234 @@ function IDAGetAdjY(ida_mem, t, yy, yp) end function IDAGetAdjCheckPointsInfo(ida_mem, ckpnt) - ccall((:IDAGetAdjCheckPointsInfo, libsundials_idas), Cint, (IDAMemPtr, Ptr{IDAadjCheckPointRec}), ida_mem, ckpnt) + ccall( + (:IDAGetAdjCheckPointsInfo, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{IDAadjCheckPointRec}), + ida_mem, + ckpnt, + ) end function IDAGetAdjDataPointHermite(ida_mem, which::Cint, t, yy::N_Vector, yd::N_Vector) - ccall((:IDAGetAdjDataPointHermite, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), ida_mem, which, t, yy, yd) + ccall( + (:IDAGetAdjDataPointHermite, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), + ida_mem, + which, + t, + yy, + yd, + ) end function IDAGetAdjDataPointHermite(ida_mem, which, t, yy, yd) __yy = convert(NVector, yy) __yd = convert(NVector, yd) - IDAGetAdjDataPointHermite(ida_mem, convert(Cint, which), t, convert(N_Vector, __yy), convert(N_Vector, __yd)) + IDAGetAdjDataPointHermite( + ida_mem, + convert(Cint, which), + t, + convert(N_Vector, __yy), + convert(N_Vector, __yd), + ) end function IDAGetAdjDataPointPolynomial(ida_mem, which::Cint, t, order, y::N_Vector) - ccall((:IDAGetAdjDataPointPolynomial, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), ida_mem, which, t, order, y) + ccall( + (:IDAGetAdjDataPointPolynomial, libsundials_idas), + Cint, + (IDAMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), + ida_mem, + which, + t, + order, + y, + ) end function IDAGetAdjDataPointPolynomial(ida_mem, which, t, order, y) __y = convert(NVector, y) - IDAGetAdjDataPointPolynomial(ida_mem, convert(Cint, which), t, order, convert(N_Vector, __y)) + IDAGetAdjDataPointPolynomial( + ida_mem, + convert(Cint, which), + t, + order, + convert(N_Vector, __y), + ) end function IDAGetAdjCurrentCheckPoint(ida_mem, addr) - ccall((:IDAGetAdjCurrentCheckPoint, libsundials_idas), Cint, (IDAMemPtr, Ptr{Ptr{Cvoid}}), ida_mem, addr) + ccall( + (:IDAGetAdjCurrentCheckPoint, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Ptr{Cvoid}}), + ida_mem, + addr, + ) end # Julia wrapper for header: idas_bbdpre.h # Automatically generated using Clang.jl - -function IDABBDPrecInit(ida_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dq_rel_yy::realtype, Gres::IDABBDLocalFn, Gcomm::IDABBDCommFn) - ccall((:IDABBDPrecInit, libsundials_idas), Cint, (IDAMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, IDABBDLocalFn, IDABBDCommFn), ida_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_yy, Gres, Gcomm) -end - -function IDABBDPrecReInit(ida_mem, mudq::sunindextype, mldq::sunindextype, dq_rel_yy::realtype) - ccall((:IDABBDPrecReInit, libsundials_idas), Cint, (IDAMemPtr, sunindextype, sunindextype, realtype), ida_mem, mudq, mldq, dq_rel_yy) +function IDABBDPrecInit( + ida_mem, + Nlocal::sunindextype, + mudq::sunindextype, + mldq::sunindextype, + mukeep::sunindextype, + mlkeep::sunindextype, + dq_rel_yy::realtype, + Gres::IDABBDLocalFn, + Gcomm::IDABBDCommFn, +) + ccall( + (:IDABBDPrecInit, libsundials_idas), + Cint, + ( + IDAMemPtr, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + IDABBDLocalFn, + IDABBDCommFn, + ), + ida_mem, + Nlocal, + mudq, + mldq, + mukeep, + mlkeep, + dq_rel_yy, + Gres, + Gcomm, + ) +end + +function IDABBDPrecReInit( + ida_mem, + mudq::sunindextype, + mldq::sunindextype, + dq_rel_yy::realtype, +) + ccall( + (:IDABBDPrecReInit, libsundials_idas), + Cint, + (IDAMemPtr, sunindextype, sunindextype, realtype), + ida_mem, + mudq, + mldq, + dq_rel_yy, + ) end function IDABBDPrecGetWorkSpace(ida_mem, lenrwBBDP, leniwBBDP) - ccall((:IDABBDPrecGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwBBDP, leniwBBDP) + ccall( + (:IDABBDPrecGetWorkSpace, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwBBDP, + leniwBBDP, + ) end function IDABBDPrecGetNumGfnEvals(ida_mem, ngevalsBBDP) - ccall((:IDABBDPrecGetNumGfnEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevalsBBDP) -end - -function IDABBDPrecInitB(ida_mem, which::Cint, NlocalB::sunindextype, mudqB::sunindextype, mldqB::sunindextype, mukeepB::sunindextype, mlkeepB::sunindextype, dq_rel_yyB::realtype, GresB::IDABBDLocalFnB, GcommB::IDABBDCommFnB) - ccall((:IDABBDPrecInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, IDABBDLocalFnB, IDABBDCommFnB), ida_mem, which, NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dq_rel_yyB, GresB, GcommB) -end - -function IDABBDPrecInitB(ida_mem, which, NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dq_rel_yyB, GresB, GcommB) - IDABBDPrecInitB(ida_mem, convert(Cint, which), NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dq_rel_yyB, GresB, GcommB) -end - -function IDABBDPrecReInitB(ida_mem, which::Cint, mudqB::sunindextype, mldqB::sunindextype, dq_rel_yyB::realtype) - ccall((:IDABBDPrecReInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, sunindextype, sunindextype, realtype), ida_mem, which, mudqB, mldqB, dq_rel_yyB) + ccall( + (:IDABBDPrecGetNumGfnEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + ngevalsBBDP, + ) +end + +function IDABBDPrecInitB( + ida_mem, + which::Cint, + NlocalB::sunindextype, + mudqB::sunindextype, + mldqB::sunindextype, + mukeepB::sunindextype, + mlkeepB::sunindextype, + dq_rel_yyB::realtype, + GresB::IDABBDLocalFnB, + GcommB::IDABBDCommFnB, +) + ccall( + (:IDABBDPrecInitB, libsundials_idas), + Cint, + ( + IDAMemPtr, + Cint, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + IDABBDLocalFnB, + IDABBDCommFnB, + ), + ida_mem, + which, + NlocalB, + mudqB, + mldqB, + mukeepB, + mlkeepB, + dq_rel_yyB, + GresB, + GcommB, + ) +end + +function IDABBDPrecInitB( + ida_mem, + which, + NlocalB, + mudqB, + mldqB, + mukeepB, + mlkeepB, + dq_rel_yyB, + GresB, + GcommB, +) + IDABBDPrecInitB( + ida_mem, + convert(Cint, which), + NlocalB, + mudqB, + mldqB, + mukeepB, + mlkeepB, + dq_rel_yyB, + GresB, + GcommB, + ) +end + +function IDABBDPrecReInitB( + ida_mem, + which::Cint, + mudqB::sunindextype, + mldqB::sunindextype, + dq_rel_yyB::realtype, +) + ccall( + (:IDABBDPrecReInitB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, sunindextype, sunindextype, realtype), + ida_mem, + which, + mudqB, + mldqB, + dq_rel_yyB, + ) end function IDABBDPrecReInitB(ida_mem, which, mudqB, mldqB, dq_rel_yyB) @@ -1044,9 +2255,15 @@ end # Julia wrapper for header: idas_direct.h # Automatically generated using Clang.jl - function IDADlsSetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:IDADlsSetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) + ccall( + (:IDADlsSetLinearSolver, libsundials_idas), + Cint, + (IDAMemPtr, SUNLinearSolver, SUNMatrix), + ida_mem, + LS, + A, + ) end function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) @@ -1054,19 +2271,44 @@ function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) end function IDADlsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall((:IDADlsGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) + ccall( + (:IDADlsGetWorkSpace, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwLS, + leniwLS, + ) end function IDADlsGetNumJacEvals(ida_mem, njevals) - ccall((:IDADlsGetNumJacEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) + ccall( + (:IDADlsGetNumJacEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njevals, + ) end function IDADlsGetNumResEvals(ida_mem, nrevalsLS) - ccall((:IDADlsGetNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) + ccall( + (:IDADlsGetNumResEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevalsLS, + ) end function IDADlsGetLastFlag(ida_mem, flag) - ccall((:IDADlsGetLastFlag, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) + ccall( + (:IDADlsGetLastFlag, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + flag, + ) end function IDADlsGetReturnFlagName(flag::Clong) @@ -1078,7 +2320,15 @@ function IDADlsGetReturnFlagName(flag) end function IDADlsSetLinearSolverB(ida_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:IDADlsSetLinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), ida_mem, which, LS, A) + ccall( + (:IDADlsSetLinearSolverB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), + ida_mem, + which, + LS, + A, + ) end function IDADlsSetLinearSolverB(ida_mem, which, LS, A) @@ -1086,7 +2336,14 @@ function IDADlsSetLinearSolverB(ida_mem, which, LS, A) end function IDADlsSetJacFnB(ida_mem, which::Cint, jacB::IDADlsJacFnB) - ccall((:IDADlsSetJacFnB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDADlsJacFnB), ida_mem, which, jacB) + ccall( + (:IDADlsSetJacFnB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDADlsJacFnB), + ida_mem, + which, + jacB, + ) end function IDADlsSetJacFnB(ida_mem, which, jacB) @@ -1094,7 +2351,14 @@ function IDADlsSetJacFnB(ida_mem, which, jacB) end function IDADlsSetJacFnBS(ida_mem, which::Cint, jacBS::IDADlsJacFnBS) - ccall((:IDADlsSetJacFnBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDADlsJacFnBS), ida_mem, which, jacBS) + ccall( + (:IDADlsSetJacFnBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDADlsJacFnBS), + ida_mem, + which, + jacBS, + ) end function IDADlsSetJacFnBS(ida_mem, which, jacBS) @@ -1103,9 +2367,15 @@ end # Julia wrapper for header: idas_ls.h # Automatically generated using Clang.jl - function IDASetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:IDASetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) + ccall( + (:IDASetLinearSolver, libsundials_idas), + Cint, + (IDAMemPtr, SUNLinearSolver, SUNMatrix), + ida_mem, + LS, + A, + ) end function IDASetJacFn(ida_mem, jac::IDALsJacFn) @@ -1113,11 +2383,25 @@ function IDASetJacFn(ida_mem, jac::IDALsJacFn) end function IDASetPreconditioner(ida_mem, pset::IDALsPrecSetupFn, psolve::IDALsPrecSolveFn) - ccall((:IDASetPreconditioner, libsundials_idas), Cint, (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), ida_mem, pset, psolve) + ccall( + (:IDASetPreconditioner, libsundials_idas), + Cint, + (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), + ida_mem, + pset, + psolve, + ) end function IDASetJacTimes(ida_mem, jtsetup::IDALsJacTimesSetupFn, jtimes::IDALsJacTimesVecFn) - ccall((:IDASetJacTimes, libsundials_idas), Cint, (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), ida_mem, jtsetup, jtimes) + ccall( + (:IDASetJacTimes, libsundials_idas), + Cint, + (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), + ida_mem, + jtsetup, + jtimes, + ) end function IDASetEpsLin(ida_mem, eplifac::realtype) @@ -1125,47 +2409,114 @@ function IDASetEpsLin(ida_mem, eplifac::realtype) end function IDASetIncrementFactor(ida_mem, dqincfac::realtype) - ccall((:IDASetIncrementFactor, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) + ccall( + (:IDASetIncrementFactor, libsundials_idas), + Cint, + (IDAMemPtr, realtype), + ida_mem, + dqincfac, + ) end function IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall((:IDAGetLinWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) + ccall( + (:IDAGetLinWorkSpace, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwLS, + leniwLS, + ) end function IDAGetNumJacEvals(ida_mem, njevals) - ccall((:IDAGetNumJacEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) + ccall( + (:IDAGetNumJacEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njevals, + ) end function IDAGetNumPrecEvals(ida_mem, npevals) - ccall((:IDAGetNumPrecEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) + ccall( + (:IDAGetNumPrecEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npevals, + ) end function IDAGetNumPrecSolves(ida_mem, npsolves) - ccall((:IDAGetNumPrecSolves, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) + ccall( + (:IDAGetNumPrecSolves, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npsolves, + ) end function IDAGetNumLinIters(ida_mem, nliters) - ccall((:IDAGetNumLinIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) + ccall( + (:IDAGetNumLinIters, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nliters, + ) end function IDAGetNumLinConvFails(ida_mem, nlcfails) - ccall((:IDAGetNumLinConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) + ccall( + (:IDAGetNumLinConvFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nlcfails, + ) end function IDAGetNumJTSetupEvals(ida_mem, njtsetups) - ccall((:IDAGetNumJTSetupEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) + ccall( + (:IDAGetNumJTSetupEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njtsetups, + ) end function IDAGetNumJtimesEvals(ida_mem, njvevals) - ccall((:IDAGetNumJtimesEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) + ccall( + (:IDAGetNumJtimesEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njvevals, + ) end function IDAGetNumLinResEvals(ida_mem, nrevalsLS) - ccall((:IDAGetNumLinResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) + ccall( + (:IDAGetNumLinResEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevalsLS, + ) end function IDAGetLastLinFlag(ida_mem, flag) - ccall((:IDAGetLastLinFlag, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) + ccall( + (:IDAGetLastLinFlag, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + flag, + ) end function IDAGetLinReturnFlagName(flag::Cint) @@ -1177,7 +2528,15 @@ function IDAGetLinReturnFlagName(flag) end function IDASetLinearSolverB(ida_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:IDASetLinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), ida_mem, which, LS, A) + ccall( + (:IDASetLinearSolverB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), + ida_mem, + which, + LS, + A, + ) end function IDASetLinearSolverB(ida_mem, which, LS, A) @@ -1185,7 +2544,14 @@ function IDASetLinearSolverB(ida_mem, which, LS, A) end function IDASetJacFnB(ida_mem, which::Cint, jacB::IDALsJacFnB) - ccall((:IDASetJacFnB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacFnB), ida_mem, which, jacB) + ccall( + (:IDASetJacFnB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDALsJacFnB), + ida_mem, + which, + jacB, + ) end function IDASetJacFnB(ida_mem, which, jacB) @@ -1193,7 +2559,14 @@ function IDASetJacFnB(ida_mem, which, jacB) end function IDASetJacFnBS(ida_mem, which::Cint, jacBS::IDALsJacFnBS) - ccall((:IDASetJacFnBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacFnBS), ida_mem, which, jacBS) + ccall( + (:IDASetJacFnBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDALsJacFnBS), + ida_mem, + which, + jacBS, + ) end function IDASetJacFnBS(ida_mem, which, jacBS) @@ -1201,7 +2574,14 @@ function IDASetJacFnBS(ida_mem, which, jacBS) end function IDASetEpsLinB(ida_mem, which::Cint, eplifacB::realtype) - ccall((:IDASetEpsLinB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, eplifacB) + ccall( + (:IDASetEpsLinB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + which, + eplifacB, + ) end function IDASetEpsLinB(ida_mem, which, eplifacB) @@ -1209,39 +2589,98 @@ function IDASetEpsLinB(ida_mem, which, eplifacB) end function IDASetIncrementFactorB(ida_mem, which::Cint, dqincfacB::realtype) - ccall((:IDASetIncrementFactorB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, dqincfacB) + ccall( + (:IDASetIncrementFactorB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + which, + dqincfacB, + ) end function IDASetIncrementFactorB(ida_mem, which, dqincfacB) IDASetIncrementFactorB(ida_mem, convert(Cint, which), dqincfacB) end -function IDASetPreconditionerB(ida_mem, which::Cint, psetB::IDALsPrecSetupFnB, psolveB::IDALsPrecSolveFnB) - ccall((:IDASetPreconditionerB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsPrecSetupFnB, IDALsPrecSolveFnB), ida_mem, which, psetB, psolveB) +function IDASetPreconditionerB( + ida_mem, + which::Cint, + psetB::IDALsPrecSetupFnB, + psolveB::IDALsPrecSolveFnB, +) + ccall( + (:IDASetPreconditionerB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDALsPrecSetupFnB, IDALsPrecSolveFnB), + ida_mem, + which, + psetB, + psolveB, + ) end function IDASetPreconditionerB(ida_mem, which, psetB, psolveB) IDASetPreconditionerB(ida_mem, convert(Cint, which), psetB, psolveB) end -function IDASetPreconditionerBS(ida_mem, which::Cint, psetBS::IDALsPrecSetupFnBS, psolveBS::IDALsPrecSolveFnBS) - ccall((:IDASetPreconditionerBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsPrecSetupFnBS, IDALsPrecSolveFnBS), ida_mem, which, psetBS, psolveBS) +function IDASetPreconditionerBS( + ida_mem, + which::Cint, + psetBS::IDALsPrecSetupFnBS, + psolveBS::IDALsPrecSolveFnBS, +) + ccall( + (:IDASetPreconditionerBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDALsPrecSetupFnBS, IDALsPrecSolveFnBS), + ida_mem, + which, + psetBS, + psolveBS, + ) end function IDASetPreconditionerBS(ida_mem, which, psetBS, psolveBS) IDASetPreconditionerBS(ida_mem, convert(Cint, which), psetBS, psolveBS) end -function IDASetJacTimesB(ida_mem, which::Cint, jtsetupB::IDALsJacTimesSetupFnB, jtimesB::IDALsJacTimesVecFnB) - ccall((:IDASetJacTimesB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacTimesSetupFnB, IDALsJacTimesVecFnB), ida_mem, which, jtsetupB, jtimesB) +function IDASetJacTimesB( + ida_mem, + which::Cint, + jtsetupB::IDALsJacTimesSetupFnB, + jtimesB::IDALsJacTimesVecFnB, +) + ccall( + (:IDASetJacTimesB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDALsJacTimesSetupFnB, IDALsJacTimesVecFnB), + ida_mem, + which, + jtsetupB, + jtimesB, + ) end function IDASetJacTimesB(ida_mem, which, jtsetupB, jtimesB) IDASetJacTimesB(ida_mem, convert(Cint, which), jtsetupB, jtimesB) end -function IDASetJacTimesBS(ida_mem, which::Cint, jtsetupBS::IDALsJacTimesSetupFnBS, jtimesBS::IDALsJacTimesVecFnBS) - ccall((:IDASetJacTimesBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacTimesSetupFnBS, IDALsJacTimesVecFnBS), ida_mem, which, jtsetupBS, jtimesBS) +function IDASetJacTimesBS( + ida_mem, + which::Cint, + jtsetupBS::IDALsJacTimesSetupFnBS, + jtimesBS::IDALsJacTimesVecFnBS, +) + ccall( + (:IDASetJacTimesBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDALsJacTimesSetupFnBS, IDALsJacTimesVecFnBS), + ida_mem, + which, + jtsetupBS, + jtimesBS, + ) end function IDASetJacTimesBS(ida_mem, which, jtsetupBS, jtimesBS) @@ -1250,61 +2689,155 @@ end # Julia wrapper for header: idas_spils.h # Automatically generated using Clang.jl - function IDASpilsSetLinearSolver(ida_mem, LS::SUNLinearSolver) - ccall((:IDASpilsSetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver), ida_mem, LS) -end - -function IDASpilsSetPreconditioner(ida_mem, pset::IDASpilsPrecSetupFn, psolve::IDASpilsPrecSolveFn) - ccall((:IDASpilsSetPreconditioner, libsundials_idas), Cint, (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), ida_mem, pset, psolve) -end - -function IDASpilsSetJacTimes(ida_mem, jtsetup::IDASpilsJacTimesSetupFn, jtimes::IDASpilsJacTimesVecFn) - ccall((:IDASpilsSetJacTimes, libsundials_idas), Cint, (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), ida_mem, jtsetup, jtimes) + ccall( + (:IDASpilsSetLinearSolver, libsundials_idas), + Cint, + (IDAMemPtr, SUNLinearSolver), + ida_mem, + LS, + ) +end + +function IDASpilsSetPreconditioner( + ida_mem, + pset::IDASpilsPrecSetupFn, + psolve::IDASpilsPrecSolveFn, +) + ccall( + (:IDASpilsSetPreconditioner, libsundials_idas), + Cint, + (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), + ida_mem, + pset, + psolve, + ) +end + +function IDASpilsSetJacTimes( + ida_mem, + jtsetup::IDASpilsJacTimesSetupFn, + jtimes::IDASpilsJacTimesVecFn, +) + ccall( + (:IDASpilsSetJacTimes, libsundials_idas), + Cint, + (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), + ida_mem, + jtsetup, + jtimes, + ) end function IDASpilsSetEpsLin(ida_mem, eplifac::realtype) - ccall((:IDASpilsSetEpsLin, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, eplifac) + ccall( + (:IDASpilsSetEpsLin, libsundials_idas), + Cint, + (IDAMemPtr, realtype), + ida_mem, + eplifac, + ) end function IDASpilsSetIncrementFactor(ida_mem, dqincfac::realtype) - ccall((:IDASpilsSetIncrementFactor, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) + ccall( + (:IDASpilsSetIncrementFactor, libsundials_idas), + Cint, + (IDAMemPtr, realtype), + ida_mem, + dqincfac, + ) end function IDASpilsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall((:IDASpilsGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) + ccall( + (:IDASpilsGetWorkSpace, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), + ida_mem, + lenrwLS, + leniwLS, + ) end function IDASpilsGetNumPrecEvals(ida_mem, npevals) - ccall((:IDASpilsGetNumPrecEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) + ccall( + (:IDASpilsGetNumPrecEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npevals, + ) end function IDASpilsGetNumPrecSolves(ida_mem, npsolves) - ccall((:IDASpilsGetNumPrecSolves, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) + ccall( + (:IDASpilsGetNumPrecSolves, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + npsolves, + ) end function IDASpilsGetNumLinIters(ida_mem, nliters) - ccall((:IDASpilsGetNumLinIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) + ccall( + (:IDASpilsGetNumLinIters, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nliters, + ) end function IDASpilsGetNumConvFails(ida_mem, nlcfails) - ccall((:IDASpilsGetNumConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) + ccall( + (:IDASpilsGetNumConvFails, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nlcfails, + ) end function IDASpilsGetNumJTSetupEvals(ida_mem, njtsetups) - ccall((:IDASpilsGetNumJTSetupEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) + ccall( + (:IDASpilsGetNumJTSetupEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njtsetups, + ) end function IDASpilsGetNumJtimesEvals(ida_mem, njvevals) - ccall((:IDASpilsGetNumJtimesEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) + ccall( + (:IDASpilsGetNumJtimesEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + njvevals, + ) end function IDASpilsGetNumResEvals(ida_mem, nrevalsLS) - ccall((:IDASpilsGetNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) + ccall( + (:IDASpilsGetNumResEvals, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + nrevalsLS, + ) end function IDASpilsGetLastFlag(ida_mem, flag) - ccall((:IDASpilsGetLastFlag, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) + ccall( + (:IDASpilsGetLastFlag, libsundials_idas), + Cint, + (IDAMemPtr, Ptr{Clong}), + ida_mem, + flag, + ) end function IDASpilsGetReturnFlagName(flag::Clong) @@ -1316,7 +2849,14 @@ function IDASpilsGetReturnFlagName(flag) end function IDASpilsSetLinearSolverB(ida_mem, which::Cint, LS::SUNLinearSolver) - ccall((:IDASpilsSetLinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNLinearSolver), ida_mem, which, LS) + ccall( + (:IDASpilsSetLinearSolverB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, SUNLinearSolver), + ida_mem, + which, + LS, + ) end function IDASpilsSetLinearSolverB(ida_mem, which, LS) @@ -1324,7 +2864,14 @@ function IDASpilsSetLinearSolverB(ida_mem, which, LS) end function IDASpilsSetEpsLinB(ida_mem, which::Cint, eplifacB::realtype) - ccall((:IDASpilsSetEpsLinB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, eplifacB) + ccall( + (:IDASpilsSetEpsLinB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + which, + eplifacB, + ) end function IDASpilsSetEpsLinB(ida_mem, which, eplifacB) @@ -1332,39 +2879,98 @@ function IDASpilsSetEpsLinB(ida_mem, which, eplifacB) end function IDASpilsSetIncrementFactorB(ida_mem, which::Cint, dqincfacB::realtype) - ccall((:IDASpilsSetIncrementFactorB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, dqincfacB) + ccall( + (:IDASpilsSetIncrementFactorB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, realtype), + ida_mem, + which, + dqincfacB, + ) end function IDASpilsSetIncrementFactorB(ida_mem, which, dqincfacB) IDASpilsSetIncrementFactorB(ida_mem, convert(Cint, which), dqincfacB) end -function IDASpilsSetPreconditionerB(ida_mem, which::Cint, psetB::IDASpilsPrecSetupFnB, psolveB::IDASpilsPrecSolveFnB) - ccall((:IDASpilsSetPreconditionerB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsPrecSetupFnB, IDASpilsPrecSolveFnB), ida_mem, which, psetB, psolveB) +function IDASpilsSetPreconditionerB( + ida_mem, + which::Cint, + psetB::IDASpilsPrecSetupFnB, + psolveB::IDASpilsPrecSolveFnB, +) + ccall( + (:IDASpilsSetPreconditionerB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDASpilsPrecSetupFnB, IDASpilsPrecSolveFnB), + ida_mem, + which, + psetB, + psolveB, + ) end function IDASpilsSetPreconditionerB(ida_mem, which, psetB, psolveB) IDASpilsSetPreconditionerB(ida_mem, convert(Cint, which), psetB, psolveB) end -function IDASpilsSetPreconditionerBS(ida_mem, which::Cint, psetBS::IDASpilsPrecSetupFnBS, psolveBS::IDASpilsPrecSolveFnBS) - ccall((:IDASpilsSetPreconditionerBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsPrecSetupFnBS, IDASpilsPrecSolveFnBS), ida_mem, which, psetBS, psolveBS) +function IDASpilsSetPreconditionerBS( + ida_mem, + which::Cint, + psetBS::IDASpilsPrecSetupFnBS, + psolveBS::IDASpilsPrecSolveFnBS, +) + ccall( + (:IDASpilsSetPreconditionerBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDASpilsPrecSetupFnBS, IDASpilsPrecSolveFnBS), + ida_mem, + which, + psetBS, + psolveBS, + ) end function IDASpilsSetPreconditionerBS(ida_mem, which, psetBS, psolveBS) IDASpilsSetPreconditionerBS(ida_mem, convert(Cint, which), psetBS, psolveBS) end -function IDASpilsSetJacTimesB(ida_mem, which::Cint, jtsetupB::IDASpilsJacTimesSetupFnB, jtimesB::IDASpilsJacTimesVecFnB) - ccall((:IDASpilsSetJacTimesB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnB, IDASpilsJacTimesVecFnB), ida_mem, which, jtsetupB, jtimesB) +function IDASpilsSetJacTimesB( + ida_mem, + which::Cint, + jtsetupB::IDASpilsJacTimesSetupFnB, + jtimesB::IDASpilsJacTimesVecFnB, +) + ccall( + (:IDASpilsSetJacTimesB, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnB, IDASpilsJacTimesVecFnB), + ida_mem, + which, + jtsetupB, + jtimesB, + ) end function IDASpilsSetJacTimesB(ida_mem, which, jtsetupB, jtimesB) IDASpilsSetJacTimesB(ida_mem, convert(Cint, which), jtsetupB, jtimesB) end -function IDASpilsSetJacTimesBS(ida_mem, which::Cint, jtsetupBS::IDASpilsJacTimesSetupFnBS, jtimesBS::IDASpilsJacTimesVecFnBS) - ccall((:IDASpilsSetJacTimesBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnBS, IDASpilsJacTimesVecFnBS), ida_mem, which, jtsetupBS, jtimesBS) +function IDASpilsSetJacTimesBS( + ida_mem, + which::Cint, + jtsetupBS::IDASpilsJacTimesSetupFnBS, + jtimesBS::IDASpilsJacTimesVecFnBS, +) + ccall( + (:IDASpilsSetJacTimesBS, libsundials_idas), + Cint, + (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnBS, IDASpilsJacTimesVecFnBS), + ida_mem, + which, + jtsetupBS, + jtimesBS, + ) end function IDASpilsSetJacTimesBS(ida_mem, which, jtsetupBS, jtimesBS) diff --git a/src/API/kinsol.jl b/src/API/kinsol.jl index 38042865..b37852e7 100644 --- a/src/API/kinsol.jl +++ b/src/API/kinsol.jl @@ -1,13 +1,19 @@ # Julia wrapper for header: kinsol.h # Automatically generated using Clang.jl - function KINCreate() ccall((:KINCreate, libsundials_kinsol), KINMemPtr, ()) end function KINInit(kinmem, func::KINSysFn, tmpl::N_Vector) - ccall((:KINInit, libsundials_kinsol), Cint, (KINMemPtr, KINSysFn, N_Vector), kinmem, func, tmpl) + ccall( + (:KINInit, libsundials_kinsol), + Cint, + (KINMemPtr, KINSysFn, N_Vector), + kinmem, + func, + tmpl, + ) end function KINInit(kinmem, func, tmpl) @@ -16,18 +22,40 @@ function KINInit(kinmem, func, tmpl) end function KINSol(kinmem, uu::N_Vector, strategy::Cint, u_scale::N_Vector, f_scale::N_Vector) - ccall((:KINSol, libsundials_kinsol), Cint, (KINMemPtr, N_Vector, Cint, N_Vector, N_Vector), kinmem, uu, strategy, u_scale, f_scale) + ccall( + (:KINSol, libsundials_kinsol), + Cint, + (KINMemPtr, N_Vector, Cint, N_Vector, N_Vector), + kinmem, + uu, + strategy, + u_scale, + f_scale, + ) end function KINSol(kinmem, uu, strategy, u_scale, f_scale) __uu = convert(NVector, uu) __u_scale = convert(NVector, u_scale) __f_scale = convert(NVector, f_scale) - KINSol(kinmem, convert(N_Vector, __uu), convert(Cint, strategy), convert(N_Vector, __u_scale), convert(N_Vector, __f_scale)) + KINSol( + kinmem, + convert(N_Vector, __uu), + convert(Cint, strategy), + convert(N_Vector, __u_scale), + convert(N_Vector, __f_scale), + ) end function KINSetErrHandlerFn(kinmem, ehfun::KINErrHandlerFn, eh_data) - ccall((:KINSetErrHandlerFn, libsundials_kinsol), Cint, (KINMemPtr, KINErrHandlerFn, Ptr{Cvoid}), kinmem, ehfun, eh_data) + ccall( + (:KINSetErrHandlerFn, libsundials_kinsol), + Cint, + (KINMemPtr, KINErrHandlerFn, Ptr{Cvoid}), + kinmem, + ehfun, + eh_data, + ) end function KINSetErrFile(kinmem, errfp) @@ -35,11 +63,24 @@ function KINSetErrFile(kinmem, errfp) end function KINSetInfoHandlerFn(kinmem, ihfun::KINInfoHandlerFn, ih_data) - ccall((:KINSetInfoHandlerFn, libsundials_kinsol), Cint, (KINMemPtr, KINInfoHandlerFn, Ptr{Cvoid}), kinmem, ihfun, ih_data) + ccall( + (:KINSetInfoHandlerFn, libsundials_kinsol), + Cint, + (KINMemPtr, KINInfoHandlerFn, Ptr{Cvoid}), + kinmem, + ihfun, + ih_data, + ) end function KINSetInfoFile(kinmem, infofp) - ccall((:KINSetInfoFile, libsundials_kinsol), Cint, (KINMemPtr, Ptr{FILE}), kinmem, infofp) + ccall( + (:KINSetInfoFile, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{FILE}), + kinmem, + infofp, + ) end function KINSetUserData(kinmem, user_data) @@ -47,7 +88,13 @@ function KINSetUserData(kinmem, user_data) end function KINSetPrintLevel(kinmemm, printfl::Cint) - ccall((:KINSetPrintLevel, libsundials_kinsol), Cint, (KINMemPtr, Cint), kinmemm, printfl) + ccall( + (:KINSetPrintLevel, libsundials_kinsol), + Cint, + (KINMemPtr, Cint), + kinmemm, + printfl, + ) end function KINSetPrintLevel(kinmemm, printfl) @@ -67,7 +114,13 @@ function KINSetDampingAA(kinmem, beta::realtype) end function KINSetNumMaxIters(kinmem, mxiter::Clong) - ccall((:KINSetNumMaxIters, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, mxiter) + ccall( + (:KINSetNumMaxIters, libsundials_kinsol), + Cint, + (KINMemPtr, Clong), + kinmem, + mxiter, + ) end function KINSetNumMaxIters(kinmem, mxiter) @@ -75,7 +128,13 @@ function KINSetNumMaxIters(kinmem, mxiter) end function KINSetNoInitSetup(kinmem, noInitSetup::Cint) - ccall((:KINSetNoInitSetup, libsundials_kinsol), Cint, (KINMemPtr, Cint), kinmem, noInitSetup) + ccall( + (:KINSetNoInitSetup, libsundials_kinsol), + Cint, + (KINMemPtr, Cint), + kinmem, + noInitSetup, + ) end function KINSetNoInitSetup(kinmem, noInitSetup) @@ -83,7 +142,13 @@ function KINSetNoInitSetup(kinmem, noInitSetup) end function KINSetNoResMon(kinmem, noNNIResMon::Cint) - ccall((:KINSetNoResMon, libsundials_kinsol), Cint, (KINMemPtr, Cint), kinmem, noNNIResMon) + ccall( + (:KINSetNoResMon, libsundials_kinsol), + Cint, + (KINMemPtr, Cint), + kinmem, + noNNIResMon, + ) end function KINSetNoResMon(kinmem, noNNIResMon) @@ -91,7 +156,13 @@ function KINSetNoResMon(kinmem, noNNIResMon) end function KINSetMaxSetupCalls(kinmem, msbset::Clong) - ccall((:KINSetMaxSetupCalls, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, msbset) + ccall( + (:KINSetMaxSetupCalls, libsundials_kinsol), + Cint, + (KINMemPtr, Clong), + kinmem, + msbset, + ) end function KINSetMaxSetupCalls(kinmem, msbset) @@ -99,7 +170,13 @@ function KINSetMaxSetupCalls(kinmem, msbset) end function KINSetMaxSubSetupCalls(kinmem, msbsetsub::Clong) - ccall((:KINSetMaxSubSetupCalls, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, msbsetsub) + ccall( + (:KINSetMaxSubSetupCalls, libsundials_kinsol), + Cint, + (KINMemPtr, Clong), + kinmem, + msbsetsub, + ) end function KINSetMaxSubSetupCalls(kinmem, msbsetsub) @@ -115,19 +192,45 @@ function KINSetEtaForm(kinmem, etachoice) end function KINSetEtaConstValue(kinmem, eta::realtype) - ccall((:KINSetEtaConstValue, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, eta) + ccall( + (:KINSetEtaConstValue, libsundials_kinsol), + Cint, + (KINMemPtr, realtype), + kinmem, + eta, + ) end function KINSetEtaParams(kinmem, egamma::realtype, ealpha::realtype) - ccall((:KINSetEtaParams, libsundials_kinsol), Cint, (KINMemPtr, realtype, realtype), kinmem, egamma, ealpha) + ccall( + (:KINSetEtaParams, libsundials_kinsol), + Cint, + (KINMemPtr, realtype, realtype), + kinmem, + egamma, + ealpha, + ) end function KINSetResMonParams(kinmem, omegamin::realtype, omegamax::realtype) - ccall((:KINSetResMonParams, libsundials_kinsol), Cint, (KINMemPtr, realtype, realtype), kinmem, omegamin, omegamax) + ccall( + (:KINSetResMonParams, libsundials_kinsol), + Cint, + (KINMemPtr, realtype, realtype), + kinmem, + omegamin, + omegamax, + ) end function KINSetResMonConstValue(kinmem, omegaconst::realtype) - ccall((:KINSetResMonConstValue, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, omegaconst) + ccall( + (:KINSetResMonConstValue, libsundials_kinsol), + Cint, + (KINMemPtr, realtype), + kinmem, + omegaconst, + ) end function KINSetNoMinEps(kinmem, noMinEps::Cint) @@ -139,11 +242,23 @@ function KINSetNoMinEps(kinmem, noMinEps) end function KINSetMaxNewtonStep(kinmem, mxnewtstep::realtype) - ccall((:KINSetMaxNewtonStep, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, mxnewtstep) + ccall( + (:KINSetMaxNewtonStep, libsundials_kinsol), + Cint, + (KINMemPtr, realtype), + kinmem, + mxnewtstep, + ) end function KINSetMaxBetaFails(kinmem, mxnbcf::Clong) - ccall((:KINSetMaxBetaFails, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, mxnbcf) + ccall( + (:KINSetMaxBetaFails, libsundials_kinsol), + Cint, + (KINMemPtr, Clong), + kinmem, + mxnbcf, + ) end function KINSetMaxBetaFails(kinmem, mxnbcf) @@ -151,19 +266,43 @@ function KINSetMaxBetaFails(kinmem, mxnbcf) end function KINSetRelErrFunc(kinmem, relfunc::realtype) - ccall((:KINSetRelErrFunc, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, relfunc) + ccall( + (:KINSetRelErrFunc, libsundials_kinsol), + Cint, + (KINMemPtr, realtype), + kinmem, + relfunc, + ) end function KINSetFuncNormTol(kinmem, fnormtol::realtype) - ccall((:KINSetFuncNormTol, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, fnormtol) + ccall( + (:KINSetFuncNormTol, libsundials_kinsol), + Cint, + (KINMemPtr, realtype), + kinmem, + fnormtol, + ) end function KINSetScaledStepTol(kinmem, scsteptol::realtype) - ccall((:KINSetScaledStepTol, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, scsteptol) + ccall( + (:KINSetScaledStepTol, libsundials_kinsol), + Cint, + (KINMemPtr, realtype), + kinmem, + scsteptol, + ) end function KINSetConstraints(kinmem, constraints::N_Vector) - ccall((:KINSetConstraints, libsundials_kinsol), Cint, (KINMemPtr, N_Vector), kinmem, constraints) + ccall( + (:KINSetConstraints, libsundials_kinsol), + Cint, + (KINMemPtr, N_Vector), + kinmem, + constraints, + ) end function KINSetConstraints(kinmem, constraints) @@ -176,31 +315,74 @@ function KINSetSysFunc(kinmem, func::KINSysFn) end function KINGetWorkSpace(kinmem, lenrw, leniw) - ccall((:KINGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrw, leniw) + ccall( + (:KINGetWorkSpace, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}, Ptr{Clong}), + kinmem, + lenrw, + leniw, + ) end function KINGetNumNonlinSolvIters(kinmem, nniters) - ccall((:KINGetNumNonlinSolvIters, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nniters) + ccall( + (:KINGetNumNonlinSolvIters, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nniters, + ) end function KINGetNumFuncEvals(kinmem, nfevals) - ccall((:KINGetNumFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) + ccall( + (:KINGetNumFuncEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nfevals, + ) end function KINGetNumBetaCondFails(kinmem, nbcfails) - ccall((:KINGetNumBetaCondFails, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nbcfails) + ccall( + (:KINGetNumBetaCondFails, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nbcfails, + ) end function KINGetNumBacktrackOps(kinmem, nbacktr) - ccall((:KINGetNumBacktrackOps, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nbacktr) + ccall( + (:KINGetNumBacktrackOps, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nbacktr, + ) end function KINGetFuncNorm(kinmem, fnorm) - ccall((:KINGetFuncNorm, libsundials_kinsol), Cint, (KINMemPtr, Ptr{realtype}), kinmem, fnorm) + ccall( + (:KINGetFuncNorm, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{realtype}), + kinmem, + fnorm, + ) end function KINGetStepLength(kinmem, steplength) - ccall((:KINGetStepLength, libsundials_kinsol), Cint, (KINMemPtr, Ptr{realtype}), kinmem, steplength) + ccall( + (:KINGetStepLength, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{realtype}), + kinmem, + steplength, + ) end function KINGetReturnFlagName(flag::Clong) @@ -217,44 +399,126 @@ end # Julia wrapper for header: kinsol_bbdpre.h # Automatically generated using Clang.jl - -function KINBBDPrecInit(kinmem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dq_rel_uu::realtype, gloc::KINBBDLocalFn, gcomm::KINBBDCommFn) - ccall((:KINBBDPrecInit, libsundials_kinsol), Cint, (KINMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, KINBBDLocalFn, KINBBDCommFn), kinmem, Nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_uu, gloc, gcomm) +function KINBBDPrecInit( + kinmem, + Nlocal::sunindextype, + mudq::sunindextype, + mldq::sunindextype, + mukeep::sunindextype, + mlkeep::sunindextype, + dq_rel_uu::realtype, + gloc::KINBBDLocalFn, + gcomm::KINBBDCommFn, +) + ccall( + (:KINBBDPrecInit, libsundials_kinsol), + Cint, + ( + KINMemPtr, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + sunindextype, + realtype, + KINBBDLocalFn, + KINBBDCommFn, + ), + kinmem, + Nlocal, + mudq, + mldq, + mukeep, + mlkeep, + dq_rel_uu, + gloc, + gcomm, + ) end function KINBBDPrecGetWorkSpace(kinmem, lenrwBBDP, leniwBBDP) - ccall((:KINBBDPrecGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrwBBDP, leniwBBDP) + ccall( + (:KINBBDPrecGetWorkSpace, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}, Ptr{Clong}), + kinmem, + lenrwBBDP, + leniwBBDP, + ) end function KINBBDPrecGetNumGfnEvals(kinmem, ngevalsBBDP) - ccall((:KINBBDPrecGetNumGfnEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, ngevalsBBDP) + ccall( + (:KINBBDPrecGetNumGfnEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + ngevalsBBDP, + ) end # Julia wrapper for header: kinsol_direct.h # Automatically generated using Clang.jl - function KINDlsSetLinearSolver(kinmem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:KINDlsSetLinearSolver, libsundials_kinsol), Cint, (KINMemPtr, SUNLinearSolver, SUNMatrix), kinmem, LS, A) + ccall( + (:KINDlsSetLinearSolver, libsundials_kinsol), + Cint, + (KINMemPtr, SUNLinearSolver, SUNMatrix), + kinmem, + LS, + A, + ) end function KINDlsSetJacFn(kinmem, jac::KINDlsJacFn) - ccall((:KINDlsSetJacFn, libsundials_kinsol), Cint, (KINMemPtr, KINDlsJacFn), kinmem, jac) + ccall( + (:KINDlsSetJacFn, libsundials_kinsol), + Cint, + (KINMemPtr, KINDlsJacFn), + kinmem, + jac, + ) end function KINDlsGetWorkSpace(kinmem, lenrw, leniw) - ccall((:KINDlsGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrw, leniw) + ccall( + (:KINDlsGetWorkSpace, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}, Ptr{Clong}), + kinmem, + lenrw, + leniw, + ) end function KINDlsGetNumJacEvals(kinmem, njevals) - ccall((:KINDlsGetNumJacEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njevals) + ccall( + (:KINDlsGetNumJacEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + njevals, + ) end function KINDlsGetNumFuncEvals(kinmem, nfevals) - ccall((:KINDlsGetNumFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) + ccall( + (:KINDlsGetNumFuncEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nfevals, + ) end function KINDlsGetLastFlag(kinmem, flag) - ccall((:KINDlsGetLastFlag, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, flag) + ccall( + (:KINDlsGetLastFlag, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + flag, + ) end function KINDlsGetReturnFlagName(flag::Clong) @@ -267,9 +531,15 @@ end # Julia wrapper for header: kinsol_ls.h # Automatically generated using Clang.jl - function KINSetLinearSolver(kinmem, LS::SUNLinearSolver, A::SUNMatrix) - ccall((:KINSetLinearSolver, libsundials_kinsol), Cint, (KINMemPtr, SUNLinearSolver, SUNMatrix), kinmem, LS, A) + ccall( + (:KINSetLinearSolver, libsundials_kinsol), + Cint, + (KINMemPtr, SUNLinearSolver, SUNMatrix), + kinmem, + LS, + A, + ) end function KINSetJacFn(kinmem, jac::KINLsJacFn) @@ -277,47 +547,115 @@ function KINSetJacFn(kinmem, jac::KINLsJacFn) end function KINSetPreconditioner(kinmem, psetup::KINLsPrecSetupFn, psolve::KINLsPrecSolveFn) - ccall((:KINSetPreconditioner, libsundials_kinsol), Cint, (KINMemPtr, KINLsPrecSetupFn, KINLsPrecSolveFn), kinmem, psetup, psolve) + ccall( + (:KINSetPreconditioner, libsundials_kinsol), + Cint, + (KINMemPtr, KINLsPrecSetupFn, KINLsPrecSolveFn), + kinmem, + psetup, + psolve, + ) end function KINSetJacTimesVecFn(kinmem, jtv::KINLsJacTimesVecFn) - ccall((:KINSetJacTimesVecFn, libsundials_kinsol), Cint, (KINMemPtr, KINLsJacTimesVecFn), kinmem, jtv) + ccall( + (:KINSetJacTimesVecFn, libsundials_kinsol), + Cint, + (KINMemPtr, KINLsJacTimesVecFn), + kinmem, + jtv, + ) end function KINGetLinWorkSpace(kinmem, lenrwLS, leniwLS) - ccall((:KINGetLinWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrwLS, leniwLS) + ccall( + (:KINGetLinWorkSpace, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}, Ptr{Clong}), + kinmem, + lenrwLS, + leniwLS, + ) end function KINGetNumJacEvals(kinmem, njevals) - ccall((:KINGetNumJacEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njevals) + ccall( + (:KINGetNumJacEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + njevals, + ) end function KINGetNumLinFuncEvals(kinmem, nfevals) - ccall((:KINGetNumLinFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) + ccall( + (:KINGetNumLinFuncEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nfevals, + ) end function KINGetNumPrecEvals(kinmem, npevals) - ccall((:KINGetNumPrecEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npevals) + ccall( + (:KINGetNumPrecEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + npevals, + ) end function KINGetNumPrecSolves(kinmem, npsolves) - ccall((:KINGetNumPrecSolves, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npsolves) + ccall( + (:KINGetNumPrecSolves, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + npsolves, + ) end function KINGetNumLinIters(kinmem, nliters) - ccall((:KINGetNumLinIters, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nliters) + ccall( + (:KINGetNumLinIters, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nliters, + ) end function KINGetNumLinConvFails(kinmem, nlcfails) - ccall((:KINGetNumLinConvFails, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nlcfails) + ccall( + (:KINGetNumLinConvFails, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nlcfails, + ) end function KINGetNumJtimesEvals(kinmem, njvevals) - ccall((:KINGetNumJtimesEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njvevals) + ccall( + (:KINGetNumJtimesEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + njvevals, + ) end function KINGetLastLinFlag(kinmem, flag) - ccall((:KINGetLastLinFlag, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, flag) + ccall( + (:KINGetLastLinFlag, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + flag, + ) end function KINGetLinReturnFlagName(flag::Clong) @@ -330,49 +668,120 @@ end # Julia wrapper for header: kinsol_spils.h # Automatically generated using Clang.jl - function KINSpilsSetLinearSolver(kinmem, LS::SUNLinearSolver) - ccall((:KINSpilsSetLinearSolver, libsundials_kinsol), Cint, (KINMemPtr, SUNLinearSolver), kinmem, LS) -end - -function KINSpilsSetPreconditioner(kinmem, psetup::KINSpilsPrecSetupFn, psolve::KINSpilsPrecSolveFn) - ccall((:KINSpilsSetPreconditioner, libsundials_kinsol), Cint, (KINMemPtr, KINSpilsPrecSetupFn, KINSpilsPrecSolveFn), kinmem, psetup, psolve) + ccall( + (:KINSpilsSetLinearSolver, libsundials_kinsol), + Cint, + (KINMemPtr, SUNLinearSolver), + kinmem, + LS, + ) +end + +function KINSpilsSetPreconditioner( + kinmem, + psetup::KINSpilsPrecSetupFn, + psolve::KINSpilsPrecSolveFn, +) + ccall( + (:KINSpilsSetPreconditioner, libsundials_kinsol), + Cint, + (KINMemPtr, KINSpilsPrecSetupFn, KINSpilsPrecSolveFn), + kinmem, + psetup, + psolve, + ) end function KINSpilsSetJacTimesVecFn(kinmem, jtv::KINSpilsJacTimesVecFn) - ccall((:KINSpilsSetJacTimesVecFn, libsundials_kinsol), Cint, (KINMemPtr, KINSpilsJacTimesVecFn), kinmem, jtv) + ccall( + (:KINSpilsSetJacTimesVecFn, libsundials_kinsol), + Cint, + (KINMemPtr, KINSpilsJacTimesVecFn), + kinmem, + jtv, + ) end function KINSpilsGetWorkSpace(kinmem, lenrwLS, leniwLS) - ccall((:KINSpilsGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrwLS, leniwLS) + ccall( + (:KINSpilsGetWorkSpace, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}, Ptr{Clong}), + kinmem, + lenrwLS, + leniwLS, + ) end function KINSpilsGetNumPrecEvals(kinmem, npevals) - ccall((:KINSpilsGetNumPrecEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npevals) + ccall( + (:KINSpilsGetNumPrecEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + npevals, + ) end function KINSpilsGetNumPrecSolves(kinmem, npsolves) - ccall((:KINSpilsGetNumPrecSolves, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npsolves) + ccall( + (:KINSpilsGetNumPrecSolves, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + npsolves, + ) end function KINSpilsGetNumLinIters(kinmem, nliters) - ccall((:KINSpilsGetNumLinIters, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nliters) + ccall( + (:KINSpilsGetNumLinIters, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nliters, + ) end function KINSpilsGetNumConvFails(kinmem, nlcfails) - ccall((:KINSpilsGetNumConvFails, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nlcfails) + ccall( + (:KINSpilsGetNumConvFails, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nlcfails, + ) end function KINSpilsGetNumJtimesEvals(kinmem, njvevals) - ccall((:KINSpilsGetNumJtimesEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njvevals) + ccall( + (:KINSpilsGetNumJtimesEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + njvevals, + ) end function KINSpilsGetNumFuncEvals(kinmem, nfevals) - ccall((:KINSpilsGetNumFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) + ccall( + (:KINSpilsGetNumFuncEvals, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + nfevals, + ) end function KINSpilsGetLastFlag(kinmem, flag) - ccall((:KINSpilsGetLastFlag, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, flag) + ccall( + (:KINSpilsGetLastFlag, libsundials_kinsol), + Cint, + (KINMemPtr, Ptr{Clong}), + kinmem, + flag, + ) end function KINSpilsGetReturnFlagName(flag::Clong) diff --git a/src/API/libsundials.jl b/src/API/libsundials.jl index a096cd52..a77ff706 100644 --- a/src/API/libsundials.jl +++ b/src/API/libsundials.jl @@ -19,9 +19,14 @@ # Julia wrapper for header: sundials_futils.h # Automatically generated using Clang.jl - function SUNDIALSFileOpen(filename, modes) - ccall((:SUNDIALSFileOpen, libsundials_sundials), Ptr{FILE}, (Cstring, Cstring), filename, modes) + ccall( + (:SUNDIALSFileOpen, libsundials_sundials), + Ptr{FILE}, + (Cstring, Cstring), + filename, + modes, + ) end function SUNDIALSFileClose(fp) @@ -36,7 +41,6 @@ end # Julia wrapper for header: sundials_linearsolver.h # Automatically generated using Clang.jl - function SUNLinSolNewEmpty() ccall((:SUNLinSolNewEmpty, libsundials_sundials), SUNLinearSolver, ()) end @@ -46,23 +50,55 @@ function SUNLinSolFreeEmpty(S::SUNLinearSolver) end function SUNLinSolGetType(S::SUNLinearSolver) - ccall((:SUNLinSolGetType, libsundials_sundials), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType, libsundials_sundials), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID(S::SUNLinearSolver) - ccall((:SUNLinSolGetID, libsundials_sundials), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID, libsundials_sundials), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetATimes(S, A_data, ATimes::ATimesFn) - ccall((:SUNLinSolSetATimes, libsundials_sundials), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) + ccall( + (:SUNLinSolSetATimes, libsundials_sundials), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), + S, + A_data, + ATimes, + ) end function SUNLinSolSetPreconditioner(S, P_data, Pset::PSetupFn, Psol::PSolveFn) - ccall((:SUNLinSolSetPreconditioner, libsundials_sundials), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) + ccall( + (:SUNLinSolSetPreconditioner, libsundials_sundials), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), + S, + P_data, + Pset, + Psol, + ) end function SUNLinSolSetScalingVectors(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall((:SUNLinSolSetScalingVectors, libsundials_sundials), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) + ccall( + (:SUNLinSolSetScalingVectors, libsundials_sundials), + Cint, + (SUNLinearSolver, N_Vector, N_Vector), + S, + s1, + s2, + ) end function SUNLinSolSetScalingVectors(S, s1, s2) @@ -79,8 +115,23 @@ function SUNLinSolSetup(S::SUNLinearSolver, A::SUNMatrix) ccall((:SUNLinSolSetup, libsundials_sundials), Cint, (SUNLinearSolver, SUNMatrix), S, A) end -function SUNLinSolSolve(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve, libsundials_sundials), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) +function SUNLinSolSolve( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve, libsundials_sundials), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve(S, A, x, b, tol) @@ -106,7 +157,14 @@ function SUNLinSolLastFlag(S::SUNLinearSolver) end function SUNLinSolSpace(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace, libsundials_sundials), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace, libsundials_sundials), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree(S::SUNLinearSolver) @@ -115,7 +173,6 @@ end # Julia wrapper for header: sundials_math.h # Automatically generated using Clang.jl - function SUNRpowerI(base::realtype, exponent::Cint) ccall((:SUNRpowerI, libsundials_sundials), realtype, (realtype, Cint), base, exponent) end @@ -125,7 +182,13 @@ function SUNRpowerI(base::realtype, exponent) end function SUNRpowerR(base::realtype, exponent::Cint) - ccall((:SUNRpowerR, libsundials_sundials), realtype, (realtype, realtype), base, exponent) + ccall( + (:SUNRpowerR, libsundials_sundials), + realtype, + (realtype, realtype), + base, + exponent, + ) end function SUNRpowerR(base::realtype, exponent) @@ -134,7 +197,6 @@ end # Julia wrapper for header: sundials_matrix.h # Automatically generated using Clang.jl - function SUNMatNewEmpty() ccall((:SUNMatNewEmpty, libsundials_sundials), SUNMatrix, ()) end @@ -168,7 +230,14 @@ function SUNMatCopy(A::SUNMatrix, B::SUNMatrix) end function SUNMatScaleAdd(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall((:SUNMatScaleAdd, libsundials_sundials), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) + ccall( + (:SUNMatScaleAdd, libsundials_sundials), + Cint, + (realtype, SUNMatrix, SUNMatrix), + c, + A, + B, + ) end function SUNMatScaleAddI(c::realtype, A::SUNMatrix) @@ -180,7 +249,14 @@ function SUNMatMatvecSetup(A::SUNMatrix) end function SUNMatMatvec(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall((:SUNMatMatvec, libsundials_sundials), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) + ccall( + (:SUNMatMatvec, libsundials_sundials), + Cint, + (SUNMatrix, N_Vector, N_Vector), + A, + x, + y, + ) end function SUNMatMatvec(A, x, y) @@ -190,7 +266,14 @@ function SUNMatMatvec(A, x, y) end function SUNMatSpace(A::SUNMatrix, lenrw, leniw) - ccall((:SUNMatSpace, libsundials_sundials), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) + ccall( + (:SUNMatSpace, libsundials_sundials), + Cint, + (SUNMatrix, Ptr{Clong}, Ptr{Clong}), + A, + lenrw, + leniw, + ) end # Julia wrapper for header: sundials_mpi_types.h # Automatically generated using Clang.jl @@ -198,7 +281,6 @@ end # Julia wrapper for header: sundials_nonlinearsolver.h # Automatically generated using Clang.jl - function SUNNonlinSolNewEmpty() ccall((:SUNNonlinSolNewEmpty, libsundials_sundials), SUNNonlinearSolver, ()) end @@ -208,7 +290,12 @@ function SUNNonlinSolFreeEmpty(NLS::SUNNonlinearSolver) end function SUNNonlinSolGetType(NLS::SUNNonlinearSolver) - ccall((:SUNNonlinSolGetType, libsundials_sundials), SUNNonlinearSolver_Type, (SUNNonlinearSolver,), NLS) + ccall( + (:SUNNonlinSolGetType, libsundials_sundials), + SUNNonlinearSolver_Type, + (SUNNonlinearSolver,), + NLS, + ) end function SUNNonlinSolInitialize(NLS::SUNNonlinearSolver) @@ -216,7 +303,14 @@ function SUNNonlinSolInitialize(NLS::SUNNonlinearSolver) end function SUNNonlinSolSetup(NLS::SUNNonlinearSolver, y::N_Vector, mem) - ccall((:SUNNonlinSolSetup, libsundials_sundials), Cint, (SUNNonlinearSolver, N_Vector, Ptr{Cvoid}), NLS, y, mem) + ccall( + (:SUNNonlinSolSetup, libsundials_sundials), + Cint, + (SUNNonlinearSolver, N_Vector, Ptr{Cvoid}), + NLS, + y, + mem, + ) end function SUNNonlinSolSetup(NLS, y, mem) @@ -224,15 +318,42 @@ function SUNNonlinSolSetup(NLS, y, mem) SUNNonlinSolSetup(NLS, convert(N_Vector, __y), mem) end -function SUNNonlinSolSolve(NLS::SUNNonlinearSolver, y0::N_Vector, y::N_Vector, w::N_Vector, tol::realtype, callLSetup::Cint, mem) - ccall((:SUNNonlinSolSolve, libsundials_sundials), Cint, (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), NLS, y0, y, w, tol, callLSetup, mem) +function SUNNonlinSolSolve( + NLS::SUNNonlinearSolver, + y0::N_Vector, + y::N_Vector, + w::N_Vector, + tol::realtype, + callLSetup::Cint, + mem, +) + ccall( + (:SUNNonlinSolSolve, libsundials_sundials), + Cint, + (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), + NLS, + y0, + y, + w, + tol, + callLSetup, + mem, + ) end function SUNNonlinSolSolve(NLS, y0, y, w, tol, callLSetup, mem) __y0 = convert(NVector, y0) __y = convert(NVector, y) __w = convert(NVector, w) - SUNNonlinSolSolve(NLS, convert(N_Vector, __y0), convert(N_Vector, __y), convert(N_Vector, __w), tol, convert(Cint, callLSetup), mem) + SUNNonlinSolSolve( + NLS, + convert(N_Vector, __y0), + convert(N_Vector, __y), + convert(N_Vector, __w), + tol, + convert(Cint, callLSetup), + mem, + ) end function SUNNonlinSolFree(NLS::SUNNonlinearSolver) @@ -240,23 +361,58 @@ function SUNNonlinSolFree(NLS::SUNNonlinearSolver) end function SUNNonlinSolSetSysFn(NLS::SUNNonlinearSolver, SysFn::SUNNonlinSolSysFn) - ccall((:SUNNonlinSolSetSysFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolSysFn), NLS, SysFn) + ccall( + (:SUNNonlinSolSetSysFn, libsundials_sundials), + Cint, + (SUNNonlinearSolver, SUNNonlinSolSysFn), + NLS, + SysFn, + ) end function SUNNonlinSolSetLSetupFn(NLS::SUNNonlinearSolver, SetupFn::SUNNonlinSolLSetupFn) - ccall((:SUNNonlinSolSetLSetupFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolLSetupFn), NLS, SetupFn) + ccall( + (:SUNNonlinSolSetLSetupFn, libsundials_sundials), + Cint, + (SUNNonlinearSolver, SUNNonlinSolLSetupFn), + NLS, + SetupFn, + ) end function SUNNonlinSolSetLSolveFn(NLS::SUNNonlinearSolver, SolveFn::SUNNonlinSolLSolveFn) - ccall((:SUNNonlinSolSetLSolveFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolLSolveFn), NLS, SolveFn) -end - -function SUNNonlinSolSetConvTestFn(NLS::SUNNonlinearSolver, CTestFn::SUNNonlinSolConvTestFn, ctest_data) - ccall((:SUNNonlinSolSetConvTestFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), NLS, CTestFn, ctest_data) + ccall( + (:SUNNonlinSolSetLSolveFn, libsundials_sundials), + Cint, + (SUNNonlinearSolver, SUNNonlinSolLSolveFn), + NLS, + SolveFn, + ) +end + +function SUNNonlinSolSetConvTestFn( + NLS::SUNNonlinearSolver, + CTestFn::SUNNonlinSolConvTestFn, + ctest_data, +) + ccall( + (:SUNNonlinSolSetConvTestFn, libsundials_sundials), + Cint, + (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), + NLS, + CTestFn, + ctest_data, + ) end function SUNNonlinSolSetMaxIters(NLS::SUNNonlinearSolver, maxiters::Cint) - ccall((:SUNNonlinSolSetMaxIters, libsundials_sundials), Cint, (SUNNonlinearSolver, Cint), NLS, maxiters) + ccall( + (:SUNNonlinSolSetMaxIters, libsundials_sundials), + Cint, + (SUNNonlinearSolver, Cint), + NLS, + maxiters, + ) end function SUNNonlinSolSetMaxIters(NLS, maxiters) @@ -264,20 +420,37 @@ function SUNNonlinSolSetMaxIters(NLS, maxiters) end function SUNNonlinSolGetNumIters(NLS::SUNNonlinearSolver, niters) - ccall((:SUNNonlinSolGetNumIters, libsundials_sundials), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, niters) + ccall( + (:SUNNonlinSolGetNumIters, libsundials_sundials), + Cint, + (SUNNonlinearSolver, Ptr{Clong}), + NLS, + niters, + ) end function SUNNonlinSolGetCurIter(NLS::SUNNonlinearSolver, iter) - ccall((:SUNNonlinSolGetCurIter, libsundials_sundials), Cint, (SUNNonlinearSolver, Ptr{Cint}), NLS, iter) + ccall( + (:SUNNonlinSolGetCurIter, libsundials_sundials), + Cint, + (SUNNonlinearSolver, Ptr{Cint}), + NLS, + iter, + ) end function SUNNonlinSolGetNumConvFails(NLS::SUNNonlinearSolver, nconvfails) - ccall((:SUNNonlinSolGetNumConvFails, libsundials_sundials), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, nconvfails) + ccall( + (:SUNNonlinSolGetNumConvFails, libsundials_sundials), + Cint, + (SUNNonlinearSolver, Ptr{Clong}), + NLS, + nconvfails, + ) end # Julia wrapper for header: sundials_nvector.h # Automatically generated using Clang.jl - function N_VNewEmpty() ccall((:N_VNewEmpty, libsundials_sundials), N_Vector, ()) end @@ -338,7 +511,14 @@ function N_VDestroy(v) end function N_VSpace(v::N_Vector, lrw, liw) - ccall((:N_VSpace, libsundials_sundials), Cvoid, (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), v, lrw, liw) + ccall( + (:N_VSpace, libsundials_sundials), + Cvoid, + (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), + v, + lrw, + liw, + ) end function N_VSpace(v, lrw, liw) @@ -356,7 +536,13 @@ function N_VGetArrayPointer(v) end function N_VSetArrayPointer(v_data, v::N_Vector) - ccall((:N_VSetArrayPointer, libsundials_sundials), Cvoid, (Ptr{realtype}, N_Vector), v_data, v) + ccall( + (:N_VSetArrayPointer, libsundials_sundials), + Cvoid, + (Ptr{realtype}, N_Vector), + v_data, + v, + ) end function N_VSetArrayPointer(v_data, v) @@ -383,14 +569,29 @@ function N_VGetLength(v) end function N_VLinearSum(a::realtype, x::N_Vector, b::realtype, y::N_Vector, z::N_Vector) - ccall((:N_VLinearSum, libsundials_sundials), Cvoid, (realtype, N_Vector, realtype, N_Vector, N_Vector), a, x, b, y, z) + ccall( + (:N_VLinearSum, libsundials_sundials), + Cvoid, + (realtype, N_Vector, realtype, N_Vector, N_Vector), + a, + x, + b, + y, + z, + ) end function N_VLinearSum(a, x, b, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VLinearSum(a, convert(N_Vector, __x), b, convert(N_Vector, __y), convert(N_Vector, __z)) + N_VLinearSum( + a, + convert(N_Vector, __x), + b, + convert(N_Vector, __y), + convert(N_Vector, __z), + ) end function N_VConst(c::realtype, z::N_Vector) @@ -455,7 +656,14 @@ function N_VInv(x, z) end function N_VAddConst(x::N_Vector, b::realtype, z::N_Vector) - ccall((:N_VAddConst, libsundials_sundials), Cvoid, (N_Vector, realtype, N_Vector), x, b, z) + ccall( + (:N_VAddConst, libsundials_sundials), + Cvoid, + (N_Vector, realtype, N_Vector), + x, + b, + z, + ) end function N_VAddConst(x, b, z) @@ -494,7 +702,14 @@ function N_VWrmsNorm(x, w) end function N_VWrmsNormMask(x::N_Vector, w::N_Vector, id::N_Vector) - ccall((:N_VWrmsNormMask, libsundials_sundials), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) + ccall( + (:N_VWrmsNormMask, libsundials_sundials), + realtype, + (N_Vector, N_Vector, N_Vector), + x, + w, + id, + ) end function N_VWrmsNormMask(x, w, id) @@ -533,7 +748,14 @@ function N_VL1Norm(x) end function N_VCompare(c::realtype, x::N_Vector, z::N_Vector) - ccall((:N_VCompare, libsundials_sundials), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) + ccall( + (:N_VCompare, libsundials_sundials), + Cvoid, + (realtype, N_Vector, N_Vector), + c, + x, + z, + ) end function N_VCompare(c, x, z) @@ -553,7 +775,14 @@ function N_VInvTest(x, z) end function N_VConstrMask(c::N_Vector, x::N_Vector, m::N_Vector) - ccall((:N_VConstrMask, libsundials_sundials), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) + ccall( + (:N_VConstrMask, libsundials_sundials), + Cint, + (N_Vector, N_Vector, N_Vector), + c, + x, + m, + ) end function N_VConstrMask(c, x, m) @@ -564,7 +793,13 @@ function N_VConstrMask(c, x, m) end function N_VMinQuotient(num::N_Vector, denom::N_Vector) - ccall((:N_VMinQuotient, libsundials_sundials), realtype, (N_Vector, N_Vector), num, denom) + ccall( + (:N_VMinQuotient, libsundials_sundials), + realtype, + (N_Vector, N_Vector), + num, + denom, + ) end function N_VMinQuotient(num, denom) @@ -574,7 +809,15 @@ function N_VMinQuotient(num, denom) end function N_VLinearCombination(nvec::Cint, c, X, z) - ccall((:N_VLinearCombination, libsundials_sundials), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), nvec, c, X, z) + ccall( + (:N_VLinearCombination, libsundials_sundials), + Cint, + (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), + nvec, + c, + X, + z, + ) end function N_VLinearCombination(nvec, c, X, z) @@ -582,7 +825,16 @@ function N_VLinearCombination(nvec, c, X, z) end function N_VScaleAddMulti(nvec::Cint, a, x::N_Vector, Y, Z) - ccall((:N_VScaleAddMulti, libsundials_sundials), Cint, (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, x, Y, Z) + ccall( + (:N_VScaleAddMulti, libsundials_sundials), + Cint, + (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + a, + x, + Y, + Z, + ) end function N_VScaleAddMulti(nvec, a, x, Y, Z) @@ -591,7 +843,15 @@ function N_VScaleAddMulti(nvec, a, x, Y, Z) end function N_VDotProdMulti(nvec::Cint, x::N_Vector, Y, dotprods) - ccall((:N_VDotProdMulti, libsundials_sundials), Cint, (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), nvec, x, Y, dotprods) + ccall( + (:N_VDotProdMulti, libsundials_sundials), + Cint, + (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), + nvec, + x, + Y, + dotprods, + ) end function N_VDotProdMulti(nvec, x, Y, dotprods) @@ -600,7 +860,17 @@ function N_VDotProdMulti(nvec, x, Y, dotprods) end function N_VLinearSumVectorArray(nvec::Cint, a::realtype, X, b::realtype, Y, Z) - ccall((:N_VLinearSumVectorArray, libsundials_sundials), Cint, (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, X, b, Y, Z) + ccall( + (:N_VLinearSumVectorArray, libsundials_sundials), + Cint, + (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + a, + X, + b, + Y, + Z, + ) end function N_VLinearSumVectorArray(nvec, a, X, b, Y, Z) @@ -608,7 +878,15 @@ function N_VLinearSumVectorArray(nvec, a, X, b, Y, Z) end function N_VScaleVectorArray(nvec::Cint, c, X, Z) - ccall((:N_VScaleVectorArray, libsundials_sundials), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), nvec, c, X, Z) + ccall( + (:N_VScaleVectorArray, libsundials_sundials), + Cint, + (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + c, + X, + Z, + ) end function N_VScaleVectorArray(nvec, c, X, Z) @@ -616,7 +894,14 @@ function N_VScaleVectorArray(nvec, c, X, Z) end function N_VConstVectorArray(nvec::Cint, c::realtype, Z) - ccall((:N_VConstVectorArray, libsundials_sundials), Cint, (Cint, realtype, Ptr{N_Vector}), nvec, c, Z) + ccall( + (:N_VConstVectorArray, libsundials_sundials), + Cint, + (Cint, realtype, Ptr{N_Vector}), + nvec, + c, + Z, + ) end function N_VConstVectorArray(nvec, c, Z) @@ -624,7 +909,15 @@ function N_VConstVectorArray(nvec, c, Z) end function N_VWrmsNormVectorArray(nvec::Cint, X, W, nrm) - ccall((:N_VWrmsNormVectorArray, libsundials_sundials), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), nvec, X, W, nrm) + ccall( + (:N_VWrmsNormVectorArray, libsundials_sundials), + Cint, + (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), + nvec, + X, + W, + nrm, + ) end function N_VWrmsNormVectorArray(nvec, X, W, nrm) @@ -632,7 +925,16 @@ function N_VWrmsNormVectorArray(nvec, X, W, nrm) end function N_VWrmsNormMaskVectorArray(nvec::Cint, X, W, id::N_Vector, nrm) - ccall((:N_VWrmsNormMaskVectorArray, libsundials_sundials), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), nvec, X, W, id, nrm) + ccall( + (:N_VWrmsNormMaskVectorArray, libsundials_sundials), + Cint, + (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), + nvec, + X, + W, + id, + nrm, + ) end function N_VWrmsNormMaskVectorArray(nvec, X, W, id, nrm) @@ -641,7 +943,17 @@ function N_VWrmsNormMaskVectorArray(nvec, X, W, id, nrm) end function N_VScaleAddMultiVectorArray(nvec::Cint, nsum::Cint, a, X, Y, Z) - ccall((:N_VScaleAddMultiVectorArray, libsundials_sundials), Cint, (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), nvec, nsum, a, X, Y, Z) + ccall( + (:N_VScaleAddMultiVectorArray, libsundials_sundials), + Cint, + (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), + nvec, + nsum, + a, + X, + Y, + Z, + ) end function N_VScaleAddMultiVectorArray(nvec, nsum, a, X, Y, Z) @@ -649,7 +961,16 @@ function N_VScaleAddMultiVectorArray(nvec, nsum, a, X, Y, Z) end function N_VLinearCombinationVectorArray(nvec::Cint, nsum::Cint, c, X, Z) - ccall((:N_VLinearCombinationVectorArray, libsundials_sundials), Cint, (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), nvec, nsum, c, X, Z) + ccall( + (:N_VLinearCombinationVectorArray, libsundials_sundials), + Cint, + (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), + nvec, + nsum, + c, + X, + Z, + ) end function N_VLinearCombinationVectorArray(nvec, nsum, c, X, Z) @@ -704,14 +1025,25 @@ function N_VWSqrSumLocal(x, w) end function N_VWSqrSumMaskLocal(x::N_Vector, w::N_Vector, id::N_Vector) - ccall((:N_VWSqrSumMaskLocal, libsundials_sundials), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) + ccall( + (:N_VWSqrSumMaskLocal, libsundials_sundials), + realtype, + (N_Vector, N_Vector, N_Vector), + x, + w, + id, + ) end function N_VWSqrSumMaskLocal(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWSqrSumMaskLocal(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) + N_VWSqrSumMaskLocal( + convert(N_Vector, __x), + convert(N_Vector, __w), + convert(N_Vector, __id), + ) end function N_VInvTestLocal(x::N_Vector, z::N_Vector) @@ -725,18 +1057,35 @@ function N_VInvTestLocal(x, z) end function N_VConstrMaskLocal(c::N_Vector, x::N_Vector, m::N_Vector) - ccall((:N_VConstrMaskLocal, libsundials_sundials), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) + ccall( + (:N_VConstrMaskLocal, libsundials_sundials), + Cint, + (N_Vector, N_Vector, N_Vector), + c, + x, + m, + ) end function N_VConstrMaskLocal(c, x, m) __c = convert(NVector, c) __x = convert(NVector, x) __m = convert(NVector, m) - N_VConstrMaskLocal(convert(N_Vector, __c), convert(N_Vector, __x), convert(N_Vector, __m)) + N_VConstrMaskLocal( + convert(N_Vector, __c), + convert(N_Vector, __x), + convert(N_Vector, __m), + ) end function N_VMinQuotientLocal(num::N_Vector, denom::N_Vector) - ccall((:N_VMinQuotientLocal, libsundials_sundials), realtype, (N_Vector, N_Vector), num, denom) + ccall( + (:N_VMinQuotientLocal, libsundials_sundials), + realtype, + (N_Vector, N_Vector), + num, + denom, + ) end function N_VMinQuotientLocal(num, denom) @@ -754,7 +1103,13 @@ function N_VNewVectorArray(count) end function N_VCloneEmptyVectorArray(count::Cint, w::N_Vector) - ccall((:N_VCloneEmptyVectorArray, libsundials_sundials), Ptr{N_Vector}, (Cint, N_Vector), count, w) + ccall( + (:N_VCloneEmptyVectorArray, libsundials_sundials), + Ptr{N_Vector}, + (Cint, N_Vector), + count, + w, + ) end function N_VCloneEmptyVectorArray(count, w) @@ -763,7 +1118,13 @@ function N_VCloneEmptyVectorArray(count, w) end function N_VCloneVectorArray(count::Cint, w::N_Vector) - ccall((:N_VCloneVectorArray, libsundials_sundials), Ptr{N_Vector}, (Cint, N_Vector), count, w) + ccall( + (:N_VCloneVectorArray, libsundials_sundials), + Ptr{N_Vector}, + (Cint, N_Vector), + count, + w, + ) end function N_VCloneVectorArray(count, w) @@ -772,7 +1133,13 @@ function N_VCloneVectorArray(count, w) end function N_VDestroyVectorArray(vs, count::Cint) - ccall((:N_VDestroyVectorArray, libsundials_sundials), Cvoid, (Ptr{N_Vector}, Cint), vs, count) + ccall( + (:N_VDestroyVectorArray, libsundials_sundials), + Cvoid, + (Ptr{N_Vector}, Cint), + vs, + count, + ) end function N_VDestroyVectorArray(vs, count) @@ -780,7 +1147,13 @@ function N_VDestroyVectorArray(vs, count) end function N_VGetVecAtIndexVectorArray(vs, index::Cint) - ccall((:N_VGetVecAtIndexVectorArray, libsundials_sundials), N_Vector, (Ptr{N_Vector}, Cint), vs, index) + ccall( + (:N_VGetVecAtIndexVectorArray, libsundials_sundials), + N_Vector, + (Ptr{N_Vector}, Cint), + vs, + index, + ) end function N_VGetVecAtIndexVectorArray(vs, index) @@ -788,7 +1161,14 @@ function N_VGetVecAtIndexVectorArray(vs, index) end function N_VSetVecAtIndexVectorArray(vs, index::Cint, w::N_Vector) - ccall((:N_VSetVecAtIndexVectorArray, libsundials_sundials), Cvoid, (Ptr{N_Vector}, Cint, N_Vector), vs, index, w) + ccall( + (:N_VSetVecAtIndexVectorArray, libsundials_sundials), + Cvoid, + (Ptr{N_Vector}, Cint, N_Vector), + vs, + index, + w, + ) end function N_VSetVecAtIndexVectorArray(vs, index, w) @@ -801,7 +1181,6 @@ end # Julia wrapper for header: sundials_version.h # Automatically generated using Clang.jl - function SUNDIALSGetVersion(version, len::Cint) ccall((:SUNDIALSGetVersion, libsundials_sundials), Cint, (Cstring, Cint), version, len) end @@ -811,7 +1190,16 @@ function SUNDIALSGetVersion(version, len) end function SUNDIALSGetVersionNumber(major, minor, patch, label, len::Cint) - ccall((:SUNDIALSGetVersionNumber, libsundials_sundials), Cint, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cstring, Cint), major, minor, patch, label, len) + ccall( + (:SUNDIALSGetVersionNumber, libsundials_sundials), + Cint, + (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cstring, Cint), + major, + minor, + patch, + label, + len, + ) end function SUNDIALSGetVersionNumber(major, minor, patch, label, len) diff --git a/src/API/nvector.jl b/src/API/nvector.jl index d8f6a4af..2c0c7fc0 100644 --- a/src/API/nvector.jl +++ b/src/API/nvector.jl @@ -1,13 +1,24 @@ # Julia wrapper for header: nvector_manyvector.h # Automatically generated using Clang.jl - function N_VNew_ManyVector(num_subvectors::sunindextype, vec_array) - ccall((:N_VNew_ManyVector, libsundials_nvecserial), N_Vector, (sunindextype, Ptr{N_Vector}), num_subvectors, vec_array) + ccall( + (:N_VNew_ManyVector, libsundials_nvecserial), + N_Vector, + (sunindextype, Ptr{N_Vector}), + num_subvectors, + vec_array, + ) end function N_VGetSubvector_ManyVector(v::N_Vector, vec_num::sunindextype) - ccall((:N_VGetSubvector_ManyVector, libsundials_nvecserial), N_Vector, (N_Vector, sunindextype), v, vec_num) + ccall( + (:N_VGetSubvector_ManyVector, libsundials_nvecserial), + N_Vector, + (N_Vector, sunindextype), + v, + vec_num, + ) end function N_VGetSubvector_ManyVector(v, vec_num) @@ -16,7 +27,13 @@ function N_VGetSubvector_ManyVector(v, vec_num) end function N_VGetSubvectorArrayPointer_ManyVector(v::N_Vector, vec_num::sunindextype) - ccall((:N_VGetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), Ptr{realtype}, (N_Vector, sunindextype), v, vec_num) + ccall( + (:N_VGetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), + Ptr{realtype}, + (N_Vector, sunindextype), + v, + vec_num, + ) end function N_VGetSubvectorArrayPointer_ManyVector(v, vec_num) @@ -25,7 +42,14 @@ function N_VGetSubvectorArrayPointer_ManyVector(v, vec_num) end function N_VSetSubvectorArrayPointer_ManyVector(v_data, v::N_Vector, vec_num::sunindextype) - ccall((:N_VSetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), Cint, (Ptr{realtype}, N_Vector, sunindextype), v_data, v, vec_num) + ccall( + (:N_VSetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), + Cint, + (Ptr{realtype}, N_Vector, sunindextype), + v_data, + v, + vec_num, + ) end function N_VSetSubvectorArrayPointer_ManyVector(v_data, v, vec_num) @@ -34,7 +58,12 @@ function N_VSetSubvectorArrayPointer_ManyVector(v_data, v, vec_num) end function N_VGetNumSubvectors_ManyVector(v::N_Vector) - ccall((:N_VGetNumSubvectors_ManyVector, libsundials_nvecserial), sunindextype, (N_Vector,), v) + ccall( + (:N_VGetNumSubvectors_ManyVector, libsundials_nvecserial), + sunindextype, + (N_Vector,), + v, + ) end function N_VGetNumSubvectors_ManyVector(v) @@ -79,7 +108,14 @@ function N_VDestroy_ManyVector(v) end function N_VSpace_ManyVector(v::N_Vector, lrw, liw) - ccall((:N_VSpace_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), v, lrw, liw) + ccall( + (:N_VSpace_ManyVector, libsundials_nvecserial), + Cvoid, + (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), + v, + lrw, + liw, + ) end function N_VSpace_ManyVector(v, lrw, liw) @@ -96,15 +132,36 @@ function N_VGetLength_ManyVector(v) N_VGetLength_ManyVector(convert(N_Vector, __v)) end -function N_VLinearSum_ManyVector(a::realtype, x::N_Vector, b::realtype, y::N_Vector, z::N_Vector) - ccall((:N_VLinearSum_ManyVector, libsundials_nvecserial), Cvoid, (realtype, N_Vector, realtype, N_Vector, N_Vector), a, x, b, y, z) +function N_VLinearSum_ManyVector( + a::realtype, + x::N_Vector, + b::realtype, + y::N_Vector, + z::N_Vector, +) + ccall( + (:N_VLinearSum_ManyVector, libsundials_nvecserial), + Cvoid, + (realtype, N_Vector, realtype, N_Vector, N_Vector), + a, + x, + b, + y, + z, + ) end function N_VLinearSum_ManyVector(a, x, b, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VLinearSum_ManyVector(a, convert(N_Vector, __x), b, convert(N_Vector, __y), convert(N_Vector, __z)) + N_VLinearSum_ManyVector( + a, + convert(N_Vector, __x), + b, + convert(N_Vector, __y), + convert(N_Vector, __z), + ) end function N_VConst_ManyVector(c::realtype, z::N_Vector) @@ -117,29 +174,58 @@ function N_VConst_ManyVector(c, z) end function N_VProd_ManyVector(x::N_Vector, y::N_Vector, z::N_Vector) - ccall((:N_VProd_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) + ccall( + (:N_VProd_ManyVector, libsundials_nvecserial), + Cvoid, + (N_Vector, N_Vector, N_Vector), + x, + y, + z, + ) end function N_VProd_ManyVector(x, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VProd_ManyVector(convert(N_Vector, __x), convert(N_Vector, __y), convert(N_Vector, __z)) + N_VProd_ManyVector( + convert(N_Vector, __x), + convert(N_Vector, __y), + convert(N_Vector, __z), + ) end function N_VDiv_ManyVector(x::N_Vector, y::N_Vector, z::N_Vector) - ccall((:N_VDiv_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) + ccall( + (:N_VDiv_ManyVector, libsundials_nvecserial), + Cvoid, + (N_Vector, N_Vector, N_Vector), + x, + y, + z, + ) end function N_VDiv_ManyVector(x, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VDiv_ManyVector(convert(N_Vector, __x), convert(N_Vector, __y), convert(N_Vector, __z)) + N_VDiv_ManyVector( + convert(N_Vector, __x), + convert(N_Vector, __y), + convert(N_Vector, __z), + ) end function N_VScale_ManyVector(c::realtype, x::N_Vector, z::N_Vector) - ccall((:N_VScale_ManyVector, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) + ccall( + (:N_VScale_ManyVector, libsundials_nvecserial), + Cvoid, + (realtype, N_Vector, N_Vector), + c, + x, + z, + ) end function N_VScale_ManyVector(c, x, z) @@ -169,7 +255,14 @@ function N_VInv_ManyVector(x, z) end function N_VAddConst_ManyVector(x::N_Vector, b::realtype, z::N_Vector) - ccall((:N_VAddConst_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, realtype, N_Vector), x, b, z) + ccall( + (:N_VAddConst_ManyVector, libsundials_nvecserial), + Cvoid, + (N_Vector, realtype, N_Vector), + x, + b, + z, + ) end function N_VAddConst_ManyVector(x, b, z) @@ -179,7 +272,13 @@ function N_VAddConst_ManyVector(x, b, z) end function N_VWrmsNorm_ManyVector(x::N_Vector, w::N_Vector) - ccall((:N_VWrmsNorm_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) + ccall( + (:N_VWrmsNorm_ManyVector, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + w, + ) end function N_VWrmsNorm_ManyVector(x, w) @@ -189,18 +288,35 @@ function N_VWrmsNorm_ManyVector(x, w) end function N_VWrmsNormMask_ManyVector(x::N_Vector, w::N_Vector, id::N_Vector) - ccall((:N_VWrmsNormMask_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) + ccall( + (:N_VWrmsNormMask_ManyVector, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector, N_Vector), + x, + w, + id, + ) end function N_VWrmsNormMask_ManyVector(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWrmsNormMask_ManyVector(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) + N_VWrmsNormMask_ManyVector( + convert(N_Vector, __x), + convert(N_Vector, __w), + convert(N_Vector, __id), + ) end function N_VWL2Norm_ManyVector(x::N_Vector, w::N_Vector) - ccall((:N_VWL2Norm_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) + ccall( + (:N_VWL2Norm_ManyVector, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + w, + ) end function N_VWL2Norm_ManyVector(x, w) @@ -210,7 +326,14 @@ function N_VWL2Norm_ManyVector(x, w) end function N_VCompare_ManyVector(c::realtype, x::N_Vector, z::N_Vector) - ccall((:N_VCompare_ManyVector, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) + ccall( + (:N_VCompare_ManyVector, libsundials_nvecserial), + Cvoid, + (realtype, N_Vector, N_Vector), + c, + x, + z, + ) end function N_VCompare_ManyVector(c, x, z) @@ -220,7 +343,15 @@ function N_VCompare_ManyVector(c, x, z) end function N_VLinearCombination_ManyVector(nvec::Cint, c, V, z::N_Vector) - ccall((:N_VLinearCombination_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), nvec, c, V, z) + ccall( + (:N_VLinearCombination_ManyVector, libsundials_nvecserial), + Cint, + (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), + nvec, + c, + V, + z, + ) end function N_VLinearCombination_ManyVector(nvec, c, V, z) @@ -229,7 +360,16 @@ function N_VLinearCombination_ManyVector(nvec, c, V, z) end function N_VScaleAddMulti_ManyVector(nvec::Cint, a, x::N_Vector, Y, Z) - ccall((:N_VScaleAddMulti_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, x, Y, Z) + ccall( + (:N_VScaleAddMulti_ManyVector, libsundials_nvecserial), + Cint, + (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + a, + x, + Y, + Z, + ) end function N_VScaleAddMulti_ManyVector(nvec, a, x, Y, Z) @@ -238,7 +378,15 @@ function N_VScaleAddMulti_ManyVector(nvec, a, x, Y, Z) end function N_VDotProdMulti_ManyVector(nvec::Cint, x::N_Vector, Y, dotprods) - ccall((:N_VDotProdMulti_ManyVector, libsundials_nvecserial), Cint, (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), nvec, x, Y, dotprods) + ccall( + (:N_VDotProdMulti_ManyVector, libsundials_nvecserial), + Cint, + (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), + nvec, + x, + Y, + dotprods, + ) end function N_VDotProdMulti_ManyVector(nvec, x, Y, dotprods) @@ -247,7 +395,17 @@ function N_VDotProdMulti_ManyVector(nvec, x, Y, dotprods) end function N_VLinearSumVectorArray_ManyVector(nvec::Cint, a::realtype, X, b::realtype, Y, Z) - ccall((:N_VLinearSumVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, X, b, Y, Z) + ccall( + (:N_VLinearSumVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + a, + X, + b, + Y, + Z, + ) end function N_VLinearSumVectorArray_ManyVector(nvec, a, X, b, Y, Z) @@ -255,7 +413,15 @@ function N_VLinearSumVectorArray_ManyVector(nvec, a, X, b, Y, Z) end function N_VScaleVectorArray_ManyVector(nvec::Cint, c::realtype, X, Z) - ccall((:N_VScaleVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), nvec, c, X, Z) + ccall( + (:N_VScaleVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + c, + X, + Z, + ) end function N_VScaleVectorArray_ManyVector(nvec, c, X, Z) @@ -263,7 +429,14 @@ function N_VScaleVectorArray_ManyVector(nvec, c, X, Z) end function N_VConstVectorArray_ManyVector(nvecs::Cint, c::realtype, Z) - ccall((:N_VConstVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}), nvecs, c, Z) + ccall( + (:N_VConstVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (Cint, realtype, Ptr{N_Vector}), + nvecs, + c, + Z, + ) end function N_VConstVectorArray_ManyVector(nvecs, c, Z) @@ -271,7 +444,15 @@ function N_VConstVectorArray_ManyVector(nvecs, c, Z) end function N_VWrmsNormVectorArray_ManyVector(nvecs::Cint, X, W, nrm) - ccall((:N_VWrmsNormVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), nvecs, X, W, nrm) + ccall( + (:N_VWrmsNormVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), + nvecs, + X, + W, + nrm, + ) end function N_VWrmsNormVectorArray_ManyVector(nvecs, X, W, nrm) @@ -279,16 +460,37 @@ function N_VWrmsNormVectorArray_ManyVector(nvecs, X, W, nrm) end function N_VWrmsNormMaskVectorArray_ManyVector(nvec, X, W, id::N_Vector, nrm) - ccall((:N_VWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), nvec, X, W, id, nrm) + ccall( + (:N_VWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), + nvec, + X, + W, + id, + nrm, + ) end function N_VWrmsNormMaskVectorArray_ManyVector(nvec, X, W, id, nrm) __id = convert(NVector, id) - N_VWrmsNormMaskVectorArray_ManyVector(convert(Cint, nvec), X, W, convert(N_Vector, __id), nrm) + N_VWrmsNormMaskVectorArray_ManyVector( + convert(Cint, nvec), + X, + W, + convert(N_Vector, __id), + nrm, + ) end function N_VDotProdLocal_ManyVector(x::N_Vector, y::N_Vector) - ccall((:N_VDotProdLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, y) + ccall( + (:N_VDotProdLocal_ManyVector, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + y, + ) end function N_VDotProdLocal_ManyVector(x, y) @@ -325,7 +527,13 @@ function N_VL1NormLocal_ManyVector(x) end function N_VWSqrSumLocal_ManyVector(x::N_Vector, w::N_Vector) - ccall((:N_VWSqrSumLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) + ccall( + (:N_VWSqrSumLocal_ManyVector, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + w, + ) end function N_VWSqrSumLocal_ManyVector(x, w) @@ -335,18 +543,35 @@ function N_VWSqrSumLocal_ManyVector(x, w) end function N_VWSqrSumMaskLocal_ManyVector(x::N_Vector, w::N_Vector, id::N_Vector) - ccall((:N_VWSqrSumMaskLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) + ccall( + (:N_VWSqrSumMaskLocal_ManyVector, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector, N_Vector), + x, + w, + id, + ) end function N_VWSqrSumMaskLocal_ManyVector(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWSqrSumMaskLocal_ManyVector(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) + N_VWSqrSumMaskLocal_ManyVector( + convert(N_Vector, __x), + convert(N_Vector, __w), + convert(N_Vector, __id), + ) end function N_VInvTestLocal_ManyVector(x::N_Vector, z::N_Vector) - ccall((:N_VInvTestLocal_ManyVector, libsundials_nvecserial), Cint, (N_Vector, N_Vector), x, z) + ccall( + (:N_VInvTestLocal_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, N_Vector), + x, + z, + ) end function N_VInvTestLocal_ManyVector(x, z) @@ -356,18 +581,35 @@ function N_VInvTestLocal_ManyVector(x, z) end function N_VConstrMaskLocal_ManyVector(c::N_Vector, x::N_Vector, m::N_Vector) - ccall((:N_VConstrMaskLocal_ManyVector, libsundials_nvecserial), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) + ccall( + (:N_VConstrMaskLocal_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, N_Vector, N_Vector), + c, + x, + m, + ) end function N_VConstrMaskLocal_ManyVector(c, x, m) __c = convert(NVector, c) __x = convert(NVector, x) __m = convert(NVector, m) - N_VConstrMaskLocal_ManyVector(convert(N_Vector, __c), convert(N_Vector, __x), convert(N_Vector, __m)) + N_VConstrMaskLocal_ManyVector( + convert(N_Vector, __c), + convert(N_Vector, __x), + convert(N_Vector, __m), + ) end function N_VMinQuotientLocal_ManyVector(num::N_Vector, denom::N_Vector) - ccall((:N_VMinQuotientLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), num, denom) + ccall( + (:N_VMinQuotientLocal_ManyVector, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + num, + denom, + ) end function N_VMinQuotientLocal_ManyVector(num, denom) @@ -377,7 +619,13 @@ function N_VMinQuotientLocal_ManyVector(num, denom) end function N_VEnableFusedOps_ManyVector(v::N_Vector, tf::Cint) - ccall((:N_VEnableFusedOps_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableFusedOps_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableFusedOps_ManyVector(v, tf) @@ -386,7 +634,13 @@ function N_VEnableFusedOps_ManyVector(v, tf) end function N_VEnableLinearCombination_ManyVector(v::N_Vector, tf::Cint) - ccall((:N_VEnableLinearCombination_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableLinearCombination_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableLinearCombination_ManyVector(v, tf) @@ -395,7 +649,13 @@ function N_VEnableLinearCombination_ManyVector(v, tf) end function N_VEnableScaleAddMulti_ManyVector(v::N_Vector, tf::Cint) - ccall((:N_VEnableScaleAddMulti_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableScaleAddMulti_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableScaleAddMulti_ManyVector(v, tf) @@ -404,7 +664,13 @@ function N_VEnableScaleAddMulti_ManyVector(v, tf) end function N_VEnableDotProdMulti_ManyVector(v::N_Vector, tf::Cint) - ccall((:N_VEnableDotProdMulti_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableDotProdMulti_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableDotProdMulti_ManyVector(v, tf) @@ -413,7 +679,13 @@ function N_VEnableDotProdMulti_ManyVector(v, tf) end function N_VEnableLinearSumVectorArray_ManyVector(v::N_Vector, tf::Cint) - ccall((:N_VEnableLinearSumVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableLinearSumVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableLinearSumVectorArray_ManyVector(v, tf) @@ -422,7 +694,13 @@ function N_VEnableLinearSumVectorArray_ManyVector(v, tf) end function N_VEnableScaleVectorArray_ManyVector(v::N_Vector, tf) - ccall((:N_VEnableScaleVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableScaleVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableScaleVectorArray_ManyVector(v, tf) @@ -431,7 +709,13 @@ function N_VEnableScaleVectorArray_ManyVector(v, tf) end function N_VEnableConstVectorArray_ManyVector(v::N_Vector, tf) - ccall((:N_VEnableConstVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableConstVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableConstVectorArray_ManyVector(v, tf) @@ -440,7 +724,13 @@ function N_VEnableConstVectorArray_ManyVector(v, tf) end function N_VEnableWrmsNormVectorArray_ManyVector(v::N_Vector, tf) - ccall((:N_VEnableWrmsNormVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableWrmsNormVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableWrmsNormVectorArray_ManyVector(v, tf) @@ -449,7 +739,13 @@ function N_VEnableWrmsNormVectorArray_ManyVector(v, tf) end function N_VEnableWrmsNormMaskVectorArray_ManyVector(v::N_Vector, tf) - ccall((:N_VEnableWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableWrmsNormMaskVectorArray_ManyVector(v, tf) @@ -460,21 +756,37 @@ end # Julia wrapper for header: nvector_serial.h # Automatically generated using Clang.jl - function N_VNew_Serial(vec_length::sunindextype) ccall((:N_VNew_Serial, libsundials_nvecserial), N_Vector, (sunindextype,), vec_length) end function N_VNewEmpty_Serial(vec_length::sunindextype) - ccall((:N_VNewEmpty_Serial, libsundials_nvecserial), N_Vector, (sunindextype,), vec_length) + ccall( + (:N_VNewEmpty_Serial, libsundials_nvecserial), + N_Vector, + (sunindextype,), + vec_length, + ) end function N_VMake_Serial(vec_length::sunindextype, v_data) - ccall((:N_VMake_Serial, libsundials_nvecserial), N_Vector, (sunindextype, Ptr{realtype}), vec_length, v_data) + ccall( + (:N_VMake_Serial, libsundials_nvecserial), + N_Vector, + (sunindextype, Ptr{realtype}), + vec_length, + v_data, + ) end function N_VCloneVectorArray_Serial(count::Cint, w::N_Vector) - ccall((:N_VCloneVectorArray_Serial, libsundials_nvecserial), Ptr{N_Vector}, (Cint, N_Vector), count, w) + ccall( + (:N_VCloneVectorArray_Serial, libsundials_nvecserial), + Ptr{N_Vector}, + (Cint, N_Vector), + count, + w, + ) end function N_VCloneVectorArray_Serial(count::Int, w) @@ -483,7 +795,13 @@ function N_VCloneVectorArray_Serial(count::Int, w) end function N_VCloneVectorArrayEmpty_Serial(count::Cint, w::N_Vector) - ccall((:N_VCloneVectorArrayEmpty_Serial, libsundials_nvecserial), Ptr{N_Vector}, (Cint, N_Vector), count, w) + ccall( + (:N_VCloneVectorArrayEmpty_Serial, libsundials_nvecserial), + Ptr{N_Vector}, + (Cint, N_Vector), + count, + w, + ) end function N_VCloneVectorArrayEmpty_Serial(count, w) @@ -492,7 +810,13 @@ function N_VCloneVectorArrayEmpty_Serial(count, w) end function N_VDestroyVectorArray_Serial(vs, count::Cint) - ccall((:N_VDestroyVectorArray_Serial, libsundials_nvecserial), Cvoid, (Ptr{N_Vector}, Cint), vs, count) + ccall( + (:N_VDestroyVectorArray_Serial, libsundials_nvecserial), + Cvoid, + (Ptr{N_Vector}, Cint), + vs, + count, + ) end function N_VDestroyVectorArray_Serial(vs, count) @@ -518,7 +842,13 @@ function N_VPrint_Serial(v) end function N_VPrintFile_Serial(v::N_Vector, outfile) - ccall((:N_VPrintFile_Serial, libsundials_nvecserial), Cvoid, (N_Vector, Ptr{FILE}), v, outfile) + ccall( + (:N_VPrintFile_Serial, libsundials_nvecserial), + Cvoid, + (N_Vector, Ptr{FILE}), + v, + outfile, + ) end function N_VPrintFile_Serial(v, outfile) @@ -563,7 +893,14 @@ function N_VDestroy_Serial(v) end function N_VSpace_Serial(v::N_Vector, lrw, liw) - ccall((:N_VSpace_Serial, libsundials_nvecserial), Cvoid, (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), v, lrw, liw) + ccall( + (:N_VSpace_Serial, libsundials_nvecserial), + Cvoid, + (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), + v, + lrw, + liw, + ) end function N_VSpace_Serial(v, lrw, liw) @@ -572,7 +909,12 @@ function N_VSpace_Serial(v, lrw, liw) end function N_VGetArrayPointer_Serial(v::N_Vector) - ccall((:N_VGetArrayPointer_Serial, libsundials_nvecserial), Ptr{realtype}, (N_Vector,), v) + ccall( + (:N_VGetArrayPointer_Serial, libsundials_nvecserial), + Ptr{realtype}, + (N_Vector,), + v, + ) end function N_VGetArrayPointer_Serial(v) @@ -581,7 +923,13 @@ function N_VGetArrayPointer_Serial(v) end function N_VSetArrayPointer_Serial(v_data, v::N_Vector) - ccall((:N_VSetArrayPointer_Serial, libsundials_nvecserial), Cvoid, (Ptr{realtype}, N_Vector), v_data, v) + ccall( + (:N_VSetArrayPointer_Serial, libsundials_nvecserial), + Cvoid, + (Ptr{realtype}, N_Vector), + v_data, + v, + ) end function N_VSetArrayPointer_Serial(v_data, v) @@ -589,15 +937,36 @@ function N_VSetArrayPointer_Serial(v_data, v) N_VSetArrayPointer_Serial(v_data, convert(N_Vector, __v)) end -function N_VLinearSum_Serial(a::realtype, x::N_Vector, b::realtype, y::N_Vector, z::N_Vector) - ccall((:N_VLinearSum_Serial, libsundials_nvecserial), Cvoid, (realtype, N_Vector, realtype, N_Vector, N_Vector), a, x, b, y, z) +function N_VLinearSum_Serial( + a::realtype, + x::N_Vector, + b::realtype, + y::N_Vector, + z::N_Vector, +) + ccall( + (:N_VLinearSum_Serial, libsundials_nvecserial), + Cvoid, + (realtype, N_Vector, realtype, N_Vector, N_Vector), + a, + x, + b, + y, + z, + ) end function N_VLinearSum_Serial(a, x, b, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VLinearSum_Serial(a, convert(N_Vector, __x), b, convert(N_Vector, __y), convert(N_Vector, __z)) + N_VLinearSum_Serial( + a, + convert(N_Vector, __x), + b, + convert(N_Vector, __y), + convert(N_Vector, __z), + ) end function N_VConst_Serial(c::realtype, z::N_Vector) @@ -610,7 +979,14 @@ function N_VConst_Serial(c, z) end function N_VProd_Serial(x::N_Vector, y::N_Vector, z::N_Vector) - ccall((:N_VProd_Serial, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) + ccall( + (:N_VProd_Serial, libsundials_nvecserial), + Cvoid, + (N_Vector, N_Vector, N_Vector), + x, + y, + z, + ) end function N_VProd_Serial(x, y, z) @@ -621,7 +997,14 @@ function N_VProd_Serial(x, y, z) end function N_VDiv_Serial(x::N_Vector, y::N_Vector, z::N_Vector) - ccall((:N_VDiv_Serial, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) + ccall( + (:N_VDiv_Serial, libsundials_nvecserial), + Cvoid, + (N_Vector, N_Vector, N_Vector), + x, + y, + z, + ) end function N_VDiv_Serial(x, y, z) @@ -632,7 +1015,14 @@ function N_VDiv_Serial(x, y, z) end function N_VScale_Serial(c::realtype, x::N_Vector, z::N_Vector) - ccall((:N_VScale_Serial, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) + ccall( + (:N_VScale_Serial, libsundials_nvecserial), + Cvoid, + (realtype, N_Vector, N_Vector), + c, + x, + z, + ) end function N_VScale_Serial(c, x, z) @@ -662,7 +1052,14 @@ function N_VInv_Serial(x, z) end function N_VAddConst_Serial(x::N_Vector, b::realtype, z::N_Vector) - ccall((:N_VAddConst_Serial, libsundials_nvecserial), Cvoid, (N_Vector, realtype, N_Vector), x, b, z) + ccall( + (:N_VAddConst_Serial, libsundials_nvecserial), + Cvoid, + (N_Vector, realtype, N_Vector), + x, + b, + z, + ) end function N_VAddConst_Serial(x, b, z) @@ -672,7 +1069,13 @@ function N_VAddConst_Serial(x, b, z) end function N_VDotProd_Serial(x::N_Vector, y::N_Vector) - ccall((:N_VDotProd_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, y) + ccall( + (:N_VDotProd_Serial, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + y, + ) end function N_VDotProd_Serial(x, y) @@ -691,7 +1094,13 @@ function N_VMaxNorm_Serial(x) end function N_VWrmsNorm_Serial(x::N_Vector, w::N_Vector) - ccall((:N_VWrmsNorm_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) + ccall( + (:N_VWrmsNorm_Serial, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + w, + ) end function N_VWrmsNorm_Serial(x, w) @@ -701,14 +1110,25 @@ function N_VWrmsNorm_Serial(x, w) end function N_VWrmsNormMask_Serial(x::N_Vector, w::N_Vector, id::N_Vector) - ccall((:N_VWrmsNormMask_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) + ccall( + (:N_VWrmsNormMask_Serial, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector, N_Vector), + x, + w, + id, + ) end function N_VWrmsNormMask_Serial(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWrmsNormMask_Serial(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) + N_VWrmsNormMask_Serial( + convert(N_Vector, __x), + convert(N_Vector, __w), + convert(N_Vector, __id), + ) end function N_VMin_Serial(x::N_Vector) @@ -721,7 +1141,13 @@ function N_VMin_Serial(x) end function N_VWL2Norm_Serial(x::N_Vector, w::N_Vector) - ccall((:N_VWL2Norm_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) + ccall( + (:N_VWL2Norm_Serial, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + w, + ) end function N_VWL2Norm_Serial(x, w) @@ -740,7 +1166,14 @@ function N_VL1Norm_Serial(x) end function N_VCompare_Serial(c::realtype, x::N_Vector, z::N_Vector) - ccall((:N_VCompare_Serial, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) + ccall( + (:N_VCompare_Serial, libsundials_nvecserial), + Cvoid, + (realtype, N_Vector, N_Vector), + c, + x, + z, + ) end function N_VCompare_Serial(c, x, z) @@ -760,18 +1193,35 @@ function N_VInvTest_Serial(x, z) end function N_VConstrMask_Serial(c::N_Vector, x::N_Vector, m::N_Vector) - ccall((:N_VConstrMask_Serial, libsundials_nvecserial), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) + ccall( + (:N_VConstrMask_Serial, libsundials_nvecserial), + Cint, + (N_Vector, N_Vector, N_Vector), + c, + x, + m, + ) end function N_VConstrMask_Serial(c, x, m) __c = convert(NVector, c) __x = convert(NVector, x) __m = convert(NVector, m) - N_VConstrMask_Serial(convert(N_Vector, __c), convert(N_Vector, __x), convert(N_Vector, __m)) + N_VConstrMask_Serial( + convert(N_Vector, __c), + convert(N_Vector, __x), + convert(N_Vector, __m), + ) end function N_VMinQuotient_Serial(num::N_Vector, denom::N_Vector) - ccall((:N_VMinQuotient_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), num, denom) + ccall( + (:N_VMinQuotient_Serial, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + num, + denom, + ) end function N_VMinQuotient_Serial(num, denom) @@ -781,7 +1231,15 @@ function N_VMinQuotient_Serial(num, denom) end function N_VLinearCombination_Serial(nvec::Cint, c, V, z::N_Vector) - ccall((:N_VLinearCombination_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), nvec, c, V, z) + ccall( + (:N_VLinearCombination_Serial, libsundials_nvecserial), + Cint, + (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), + nvec, + c, + V, + z, + ) end function N_VLinearCombination_Serial(nvec, c, V, z) @@ -790,7 +1248,16 @@ function N_VLinearCombination_Serial(nvec, c, V, z) end function N_VScaleAddMulti_Serial(nvec::Cint, a, x::N_Vector, Y, Z) - ccall((:N_VScaleAddMulti_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, x, Y, Z) + ccall( + (:N_VScaleAddMulti_Serial, libsundials_nvecserial), + Cint, + (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + a, + x, + Y, + Z, + ) end function N_VScaleAddMulti_Serial(nvec, a, x, Y, Z) @@ -799,7 +1266,15 @@ function N_VScaleAddMulti_Serial(nvec, a, x, Y, Z) end function N_VDotProdMulti_Serial(nvec::Cint, x::N_Vector, Y, dotprods) - ccall((:N_VDotProdMulti_Serial, libsundials_nvecserial), Cint, (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), nvec, x, Y, dotprods) + ccall( + (:N_VDotProdMulti_Serial, libsundials_nvecserial), + Cint, + (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), + nvec, + x, + Y, + dotprods, + ) end function N_VDotProdMulti_Serial(nvec, x, Y, dotprods) @@ -808,7 +1283,17 @@ function N_VDotProdMulti_Serial(nvec, x, Y, dotprods) end function N_VLinearSumVectorArray_Serial(nvec::Cint, a::realtype, X, b::realtype, Y, Z) - ccall((:N_VLinearSumVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, X, b, Y, Z) + ccall( + (:N_VLinearSumVectorArray_Serial, libsundials_nvecserial), + Cint, + (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + a, + X, + b, + Y, + Z, + ) end function N_VLinearSumVectorArray_Serial(nvec, a, X, b, Y, Z) @@ -816,7 +1301,15 @@ function N_VLinearSumVectorArray_Serial(nvec, a, X, b, Y, Z) end function N_VScaleVectorArray_Serial(nvec::Cint, c, X, Z) - ccall((:N_VScaleVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), nvec, c, X, Z) + ccall( + (:N_VScaleVectorArray_Serial, libsundials_nvecserial), + Cint, + (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), + nvec, + c, + X, + Z, + ) end function N_VScaleVectorArray_Serial(nvec, c, X, Z) @@ -824,7 +1317,14 @@ function N_VScaleVectorArray_Serial(nvec, c, X, Z) end function N_VConstVectorArray_Serial(nvecs::Cint, c::realtype, Z) - ccall((:N_VConstVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}), nvecs, c, Z) + ccall( + (:N_VConstVectorArray_Serial, libsundials_nvecserial), + Cint, + (Cint, realtype, Ptr{N_Vector}), + nvecs, + c, + Z, + ) end function N_VConstVectorArray_Serial(nvecs, c, Z) @@ -832,7 +1332,15 @@ function N_VConstVectorArray_Serial(nvecs, c, Z) end function N_VWrmsNormVectorArray_Serial(nvecs::Cint, X, W, nrm) - ccall((:N_VWrmsNormVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), nvecs, X, W, nrm) + ccall( + (:N_VWrmsNormVectorArray_Serial, libsundials_nvecserial), + Cint, + (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), + nvecs, + X, + W, + nrm, + ) end function N_VWrmsNormVectorArray_Serial(nvecs, X, W, nrm) @@ -840,16 +1348,41 @@ function N_VWrmsNormVectorArray_Serial(nvecs, X, W, nrm) end function N_VWrmsNormMaskVectorArray_Serial(nvecs::Cint, X, W, id::N_Vector, nrm) - ccall((:N_VWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), nvecs, X, W, id, nrm) + ccall( + (:N_VWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), + Cint, + (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), + nvecs, + X, + W, + id, + nrm, + ) end function N_VWrmsNormMaskVectorArray_Serial(nvecs, X, W, id, nrm) __id = convert(NVector, id) - N_VWrmsNormMaskVectorArray_Serial(convert(Cint, nvecs), X, W, convert(N_Vector, __id), nrm) + N_VWrmsNormMaskVectorArray_Serial( + convert(Cint, nvecs), + X, + W, + convert(N_Vector, __id), + nrm, + ) end function N_VScaleAddMultiVectorArray_Serial(nvec::Cint, nsum::Cint, a, X, Y, Z) - ccall((:N_VScaleAddMultiVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), nvec, nsum, a, X, Y, Z) + ccall( + (:N_VScaleAddMultiVectorArray_Serial, libsundials_nvecserial), + Cint, + (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), + nvec, + nsum, + a, + X, + Y, + Z, + ) end function N_VScaleAddMultiVectorArray_Serial(nvec, nsum, a, X, Y, Z) @@ -857,15 +1390,36 @@ function N_VScaleAddMultiVectorArray_Serial(nvec, nsum, a, X, Y, Z) end function N_VLinearCombinationVectorArray_Serial(nvec::Cint, nsum::Cint, c, X, Z) - ccall((:N_VLinearCombinationVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), nvec, nsum, c, X, Z) + ccall( + (:N_VLinearCombinationVectorArray_Serial, libsundials_nvecserial), + Cint, + (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), + nvec, + nsum, + c, + X, + Z, + ) end function N_VLinearCombinationVectorArray_Serial(nvec, nsum, c, X, Z) - N_VLinearCombinationVectorArray_Serial(convert(Cint, nvec), convert(Cint, nsum), c, X, Z) + N_VLinearCombinationVectorArray_Serial( + convert(Cint, nvec), + convert(Cint, nsum), + c, + X, + Z, + ) end function N_VWSqrSumLocal_Serial(x::N_Vector, w::N_Vector) - ccall((:N_VWSqrSumLocal_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) + ccall( + (:N_VWSqrSumLocal_Serial, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector), + x, + w, + ) end function N_VWSqrSumLocal_Serial(x, w) @@ -874,20 +1428,36 @@ function N_VWSqrSumLocal_Serial(x, w) N_VWSqrSumLocal_Serial(convert(N_Vector, __x), convert(N_Vector, __w)) end - function N_VWSqrSumMaskLocal_Serial(x::N_Vector, w::N_Vector, id::N_Vector) - ccall((:N_VWSqrSumMaskLocal_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) + ccall( + (:N_VWSqrSumMaskLocal_Serial, libsundials_nvecserial), + realtype, + (N_Vector, N_Vector, N_Vector), + x, + w, + id, + ) end function N_VWSqrSumMaskLocal_Serial(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWSqrSumMaskLocal_Serial(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) + N_VWSqrSumMaskLocal_Serial( + convert(N_Vector, __x), + convert(N_Vector, __w), + convert(N_Vector, __id), + ) end function N_VEnableFusedOps_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableFusedOps_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableFusedOps_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableFusedOps_Serial(v, tf) @@ -896,7 +1466,13 @@ function N_VEnableFusedOps_Serial(v, tf) end function N_VEnableLinearCombination_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableLinearCombination_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableLinearCombination_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableLinearCombination_Serial(v, tf) @@ -905,7 +1481,13 @@ function N_VEnableLinearCombination_Serial(v, tf) end function N_VEnableScaleAddMulti_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableScaleAddMulti_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableScaleAddMulti_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableScaleAddMulti_Serial(v, tf) @@ -914,7 +1496,13 @@ function N_VEnableScaleAddMulti_Serial(v, tf) end function N_VEnableDotProdMulti_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableDotProdMulti_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableDotProdMulti_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableDotProdMulti_Serial(v, tf) @@ -923,7 +1511,13 @@ function N_VEnableDotProdMulti_Serial(v, tf) end function N_VEnableLinearSumVectorArray_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableLinearSumVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableLinearSumVectorArray_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableLinearSumVectorArray_Serial(v, tf) @@ -932,7 +1526,13 @@ function N_VEnableLinearSumVectorArray_Serial(v, tf) end function N_VEnableScaleVectorArray_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableScaleVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableScaleVectorArray_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableScaleVectorArray_Serial(v, tf) @@ -941,7 +1541,13 @@ function N_VEnableScaleVectorArray_Serial(v, tf) end function N_VEnableConstVectorArray_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableConstVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableConstVectorArray_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableConstVectorArray_Serial(v, tf) @@ -950,7 +1556,13 @@ function N_VEnableConstVectorArray_Serial(v, tf) end function N_VEnableWrmsNormVectorArray_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableWrmsNormVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableWrmsNormVectorArray_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableWrmsNormVectorArray_Serial(v, tf) @@ -959,7 +1571,13 @@ function N_VEnableWrmsNormVectorArray_Serial(v, tf) end function N_VEnableWrmsNormMaskVectorArray_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableWrmsNormMaskVectorArray_Serial(v, tf) @@ -968,7 +1586,13 @@ function N_VEnableWrmsNormMaskVectorArray_Serial(v, tf) end function N_VEnableScaleAddMultiVectorArray_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableScaleAddMultiVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableScaleAddMultiVectorArray_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableScaleAddMultiVectorArray_Serial(v, tf) @@ -977,7 +1601,13 @@ function N_VEnableScaleAddMultiVectorArray_Serial(v, tf) end function N_VEnableLinearCombinationVectorArray_Serial(v::N_Vector, tf::Cint) - ccall((:N_VEnableLinearCombinationVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) + ccall( + (:N_VEnableLinearCombinationVectorArray_Serial, libsundials_nvecserial), + Cint, + (N_Vector, Cint), + v, + tf, + ) end function N_VEnableLinearCombinationVectorArray_Serial(v, tf) diff --git a/src/API/sunlinsol.jl b/src/API/sunlinsol.jl index aaef6bee..fc94c518 100644 --- a/src/API/sunlinsol.jl +++ b/src/API/sunlinsol.jl @@ -1,9 +1,14 @@ # Julia wrapper for header: sunlinsol_band.h # Automatically generated using Clang.jl - function SUNLinSol_Band(y::N_Vector, A::SUNMatrix) - ccall((:SUNLinSol_Band, libsundials_sunlinsolband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNLinSol_Band, libsundials_sunlinsolband), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNLinSol_Band(y, A) @@ -12,7 +17,13 @@ function SUNLinSol_Band(y, A) end function SUNBandLinearSolver(y::N_Vector, A::SUNMatrix) - ccall((:SUNBandLinearSolver, libsundials_sunlinsolband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNBandLinearSolver, libsundials_sunlinsolband), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNBandLinearSolver(y, A) @@ -21,23 +32,59 @@ function SUNBandLinearSolver(y, A) end function SUNLinSolGetType_Band(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_Band, libsundials_sunlinsolband), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_Band, libsundials_sunlinsolband), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_Band(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_Band, libsundials_sunlinsolband), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_Band, libsundials_sunlinsolband), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_Band(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_Band, libsundials_sunlinsolband), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetup_Band(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver, SUNMatrix), S, A) -end - -function SUNLinSolSolve_Band(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) + ccall( + (:SUNLinSolSetup_Band, libsundials_sunlinsolband), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) +end + +function SUNLinSolSolve_Band( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_Band, libsundials_sunlinsolband), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_Band(S, A, x, b, tol) @@ -47,11 +94,23 @@ function SUNLinSolSolve_Band(S, A, x, b, tol) end function SUNLinSolLastFlag_Band(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_Band, libsundials_sunlinsolband), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_Band, libsundials_sunlinsolband), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_Band(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_Band, libsundials_sunlinsolband), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_Band(S::SUNLinearSolver) @@ -60,18 +119,29 @@ end # Julia wrapper for header: sunlinsol_dense.h # Automatically generated using Clang.jl - function SUNLinSol_Dense(y::N_Vector, A::SUNMatrix) - ccall((:SUNLinSol_Dense, libsundials_sunlinsoldense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNLinSol_Dense, libsundials_sunlinsoldense), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNLinSol_Dense(y, A) __y = convert(NVector, y) - SUNLinSol_Dense(convert(N_Vector, __y), A) + SUNLinSol_Dense(convert(N_Vector, __y), A) end function SUNDenseLinearSolver(y::N_Vector, A::SUNMatrix) - ccall((:SUNDenseLinearSolver, libsundials_sunlinsoldense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNDenseLinearSolver, libsundials_sunlinsoldense), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNDenseLinearSolver(y, A) @@ -80,23 +150,59 @@ function SUNDenseLinearSolver(y, A) end function SUNLinSolGetType_Dense(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_Dense, libsundials_sunlinsoldense), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_Dense, libsundials_sunlinsoldense), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_Dense(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_Dense, libsundials_sunlinsoldense), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_Dense, libsundials_sunlinsoldense), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_Dense(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_Dense, libsundials_sunlinsoldense), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetup_Dense(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver, SUNMatrix), S, A) -end - -function SUNLinSolSolve_Dense(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) + ccall( + (:SUNLinSolSetup_Dense, libsundials_sunlinsoldense), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) +end + +function SUNLinSolSolve_Dense( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_Dense, libsundials_sunlinsoldense), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_Dense(S, A, x, b, tol) @@ -106,11 +212,23 @@ function SUNLinSolSolve_Dense(S, A, x, b, tol) end function SUNLinSolLastFlag_Dense(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_Dense, libsundials_sunlinsoldense), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_Dense, libsundials_sunlinsoldense), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_Dense(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_Dense, libsundials_sunlinsoldense), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_Dense(S::SUNLinearSolver) @@ -119,9 +237,14 @@ end # Julia wrapper for header: sunlinsol_klu.h # Automatically generated using Clang.jl - function SUNLinSol_KLU(y::N_Vector, A::SUNMatrix) - ccall((:SUNLinSol_KLU, libsundials_sunlinsolklu), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) + ccall( + (:SUNLinSol_KLU, libsundials_sunlinsolklu), + SUNLinearSolver, + (N_Vector, SUNMatrix), + y, + A, + ) end function SUNLinSol_KLU(y, A) @@ -129,8 +252,21 @@ function SUNLinSol_KLU(y, A) SUNLinSol_KLU(convert(N_Vector, __y), A) end -function SUNLinSol_KLUReInit(S::SUNLinearSolver, A::SUNMatrix, nnz::sunindextype, reinit_type::Cint) - ccall((:SUNLinSol_KLUReInit, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix, sunindextype, Cint), S, A, nnz, reinit_type) +function SUNLinSol_KLUReInit( + S::SUNLinearSolver, + A::SUNMatrix, + nnz::sunindextype, + reinit_type::Cint, +) + ccall( + (:SUNLinSol_KLUReInit, libsundials_sunlinsolklu), + Cint, + (SUNLinearSolver, SUNMatrix, sunindextype, Cint), + S, + A, + nnz, + reinit_type, + ) end function SUNLinSol_KLUReInit(S, A, nnz, reinit_type) @@ -138,7 +274,13 @@ function SUNLinSol_KLUReInit(S, A, nnz, reinit_type) end function SUNLinSol_KLUSetOrdering(S::SUNLinearSolver, ordering_choice::Cint) - ccall((:SUNLinSol_KLUSetOrdering, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, Cint), S, ordering_choice) + ccall( + (:SUNLinSol_KLUSetOrdering, libsundials_sunlinsolklu), + Cint, + (SUNLinearSolver, Cint), + S, + ordering_choice, + ) end function SUNLinSol_KLUSetOrdering(S, ordering_choice) @@ -154,8 +296,21 @@ function SUNKLU(y, A) SUNKLU(convert(N_Vector, y), A) end -function SUNKLUReInit(S::SUNLinearSolver, A::SUNMatrix, nnz::sunindextype, reinit_type::Cint) - ccall((:SUNKLUReInit, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix, sunindextype, Cint), S, A, nnz, reinit_type) +function SUNKLUReInit( + S::SUNLinearSolver, + A::SUNMatrix, + nnz::sunindextype, + reinit_type::Cint, +) + ccall( + (:SUNKLUReInit, libsundials_sunlinsolklu), + Cint, + (SUNLinearSolver, SUNMatrix, sunindextype, Cint), + S, + A, + nnz, + reinit_type, + ) end function SUNKLUReInit(S, A, nnz, reinit_type) @@ -163,7 +318,13 @@ function SUNKLUReInit(S, A, nnz, reinit_type) end function SUNKLUSetOrdering(S::SUNLinearSolver, ordering_choice::Cint) - ccall((:SUNKLUSetOrdering, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, Cint), S, ordering_choice) + ccall( + (:SUNKLUSetOrdering, libsundials_sunlinsolklu), + Cint, + (SUNLinearSolver, Cint), + S, + ordering_choice, + ) end function SUNKLUSetOrdering(S, ordering_choice) @@ -171,23 +332,48 @@ function SUNKLUSetOrdering(S, ordering_choice) end function SUNLinSol_KLUGetSymbolic(S::SUNLinearSolver) - ccall((:SUNLinSol_KLUGetSymbolic, libsundials_sunlinsolklu), Ptr{klu_l_symbolic}, (SUNLinearSolver,), S) + ccall( + (:SUNLinSol_KLUGetSymbolic, libsundials_sunlinsolklu), + Ptr{klu_l_symbolic}, + (SUNLinearSolver,), + S, + ) end function SUNLinSol_KLUGetNumeric(S::SUNLinearSolver) - ccall((:SUNLinSol_KLUGetNumeric, libsundials_sunlinsolklu), Ptr{klu_l_numeric}, (SUNLinearSolver,), S) + ccall( + (:SUNLinSol_KLUGetNumeric, libsundials_sunlinsolklu), + Ptr{klu_l_numeric}, + (SUNLinearSolver,), + S, + ) end function SUNLinSol_KLUGetCommon(S::SUNLinearSolver) - ccall((:SUNLinSol_KLUGetCommon, libsundials_sunlinsolklu), Ptr{klu_l_common}, (SUNLinearSolver,), S) + ccall( + (:SUNLinSol_KLUGetCommon, libsundials_sunlinsolklu), + Ptr{klu_l_common}, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetType_KLU(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_KLU, libsundials_sunlinsolklu), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_KLU, libsundials_sunlinsolklu), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_KLU(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_KLU, libsundials_sunlinsolklu), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_KLU, libsundials_sunlinsolklu), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_KLU(S::SUNLinearSolver) @@ -195,11 +381,32 @@ function SUNLinSolInitialize_KLU(S::SUNLinearSolver) end function SUNLinSolSetup_KLU(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_KLU, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix), S, A) -end - -function SUNLinSolSolve_KLU(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_KLU, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) + ccall( + (:SUNLinSolSetup_KLU, libsundials_sunlinsolklu), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) +end + +function SUNLinSolSolve_KLU( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_KLU, libsundials_sunlinsolklu), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_KLU(S, A, x, b, tol) @@ -209,11 +416,23 @@ function SUNLinSolSolve_KLU(S, A, x, b, tol) end function SUNLinSolLastFlag_KLU(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_KLU, libsundials_sunlinsolklu), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_KLU, libsundials_sunlinsolklu), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_KLU(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_KLU, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_KLU, libsundials_sunlinsolklu), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_KLU(S::SUNLinearSolver) @@ -222,9 +441,15 @@ end # Julia wrapper for header: sunlinsol_pcg.h # Automatically generated using Clang.jl - function SUNLinSol_PCG(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNLinSol_PCG, libsundials_sunlinsolpcg), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNLinSol_PCG, libsundials_sunlinsolpcg), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNLinSol_PCG(y, pretype, maxl) @@ -233,7 +458,13 @@ function SUNLinSol_PCG(y, pretype, maxl) end function SUNLinSol_PCGSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNLinSol_PCGSetPrecType, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNLinSol_PCGSetPrecType, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNLinSol_PCGSetPrecType(S, pretype) @@ -241,7 +472,13 @@ function SUNLinSol_PCGSetPrecType(S, pretype) end function SUNLinSol_PCGSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall((:SUNLinSol_PCGSetMaxl, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, maxl) + ccall( + (:SUNLinSol_PCGSetMaxl, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, Cint), + S, + maxl, + ) end function SUNLinSol_PCGSetMaxl(S, maxl) @@ -249,7 +486,14 @@ function SUNLinSol_PCGSetMaxl(S, maxl) end function SUNPCG(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNPCG, libsundials_sunlinsolpcg), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNPCG, libsundials_sunlinsolpcg), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNPCG(y, pretype, maxl) @@ -258,7 +502,13 @@ function SUNPCG(y, pretype, maxl) end function SUNPCGSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNPCGSetPrecType, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNPCGSetPrecType, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNPCGSetPrecType(S, pretype) @@ -266,7 +516,13 @@ function SUNPCGSetPrecType(S, pretype) end function SUNPCGSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall((:SUNPCGSetMaxl, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, maxl) + ccall( + (:SUNPCGSetMaxl, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, Cint), + S, + maxl, + ) end function SUNPCGSetMaxl(S, maxl) @@ -274,11 +530,21 @@ function SUNPCGSetMaxl(S, maxl) end function SUNLinSolGetType_PCG(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_PCG, libsundials_sunlinsolpcg), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_PCG, libsundials_sunlinsolpcg), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_PCG(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_PCG, libsundials_sunlinsolpcg), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_PCG, libsundials_sunlinsolpcg), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_PCG(S::SUNLinearSolver) @@ -286,15 +552,42 @@ function SUNLinSolInitialize_PCG(S::SUNLinearSolver) end function SUNLinSolSetATimes_PCG(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall((:SUNLinSolSetATimes_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) -end - -function SUNLinSolSetPreconditioner_PCG(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) - ccall((:SUNLinSolSetPreconditioner_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) + ccall( + (:SUNLinSolSetATimes_PCG, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), + S, + A_data, + ATimes, + ) +end + +function SUNLinSolSetPreconditioner_PCG( + S::SUNLinearSolver, + P_data, + Pset::PSetupFn, + Psol::PSolveFn, +) + ccall( + (:SUNLinSolSetPreconditioner_PCG, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), + S, + P_data, + Pset, + Psol, + ) end function SUNLinSolSetScalingVectors_PCG(S::SUNLinearSolver, s::N_Vector, nul::N_Vector) - ccall((:SUNLinSolSetScalingVectors_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s, nul) + ccall( + (:SUNLinSolSetScalingVectors_PCG, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, N_Vector, N_Vector), + S, + s, + nul, + ) end function SUNLinSolSetScalingVectors_PCG(S, s, nul) @@ -304,11 +597,32 @@ function SUNLinSolSetScalingVectors_PCG(S, s, nul) end function SUNLinSolSetup_PCG(S::SUNLinearSolver, nul::SUNMatrix) - ccall((:SUNLinSolSetup_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, SUNMatrix), S, nul) -end - -function SUNLinSolSolve_PCG(S::SUNLinearSolver, nul::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, nul, x, b, tol) + ccall( + (:SUNLinSolSetup_PCG, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + nul, + ) +end + +function SUNLinSolSolve_PCG( + S::SUNLinearSolver, + nul::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_PCG, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + nul, + x, + b, + tol, + ) end function SUNLinSolSolve_PCG(S, nul, x, b, tol) @@ -322,7 +636,12 @@ function SUNLinSolNumIters_PCG(S::SUNLinearSolver) end function SUNLinSolResNorm_PCG(S::SUNLinearSolver) - ccall((:SUNLinSolResNorm_PCG, libsundials_sunlinsolpcg), realtype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResNorm_PCG, libsundials_sunlinsolpcg), + realtype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResid_PCG(S::SUNLinearSolver) @@ -330,11 +649,23 @@ function SUNLinSolResid_PCG(S::SUNLinearSolver) end function SUNLinSolLastFlag_PCG(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_PCG, libsundials_sunlinsolpcg), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_PCG, libsundials_sunlinsolpcg), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_PCG(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_PCG, libsundials_sunlinsolpcg), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_PCG(S::SUNLinearSolver) @@ -343,9 +674,15 @@ end # Julia wrapper for header: sunlinsol_spbcgs.h # Automatically generated using Clang.jl - function SUNLinSol_SPBCGS(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNLinSol_SPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNLinSol_SPBCGS, libsundials_sunlinsolspbcgs), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNLinSol_SPBCGS(y, pretype, maxl) @@ -354,7 +691,13 @@ function SUNLinSol_SPBCGS(y, pretype, maxl) end function SUNLinSol_SPBCGSSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNLinSol_SPBCGSSetPrecType, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNLinSol_SPBCGSSetPrecType, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNLinSol_SPBCGSSetPrecType(S::SUNLinearSolver, pretype) @@ -362,7 +705,13 @@ function SUNLinSol_SPBCGSSetPrecType(S::SUNLinearSolver, pretype) end function SUNLinSol_SPBCGSSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall((:SUNLinSol_SPBCGSSetMaxl, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, maxl) + ccall( + (:SUNLinSol_SPBCGSSetMaxl, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, Cint), + S, + maxl, + ) end function SUNLinSol_SPBCGSSetMaxl(S::SUNLinearSolver, maxl) @@ -370,7 +719,14 @@ function SUNLinSol_SPBCGSSetMaxl(S::SUNLinearSolver, maxl) end function SUNSPBCGS(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNSPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNSPBCGS, libsundials_sunlinsolspbcgs), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNSPBCGS(y, pretype, maxl) @@ -379,7 +735,13 @@ function SUNSPBCGS(y, pretype, maxl) end function SUNSPBCGSSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNSPBCGSSetPrecType, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNSPBCGSSetPrecType, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNSPBCGSSetPrecType(S, pretype) @@ -387,7 +749,13 @@ function SUNSPBCGSSetPrecType(S, pretype) end function SUNSPBCGSSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall((:SUNSPBCGSSetMaxl, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, maxl) + ccall( + (:SUNSPBCGSSetMaxl, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, Cint), + S, + maxl, + ) end function SUNSPBCGSSetMaxl(S, maxl) @@ -395,27 +763,69 @@ function SUNSPBCGSSetMaxl(S, maxl) end function SUNLinSolGetType_SPBCGS(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_SPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_SPBCGS, libsundials_sunlinsolspbcgs), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_SPBCGS(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_SPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_SPBCGS, libsundials_sunlinsolspbcgs), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_SPBCGS(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetATimes_SPBCGS(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall((:SUNLinSolSetATimes_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) -end - -function SUNLinSolSetPreconditioner_SPBCGS(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) - ccall((:SUNLinSolSetPreconditioner_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) + ccall( + (:SUNLinSolSetATimes_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), + S, + A_data, + ATimes, + ) +end + +function SUNLinSolSetPreconditioner_SPBCGS( + S::SUNLinearSolver, + P_data, + Pset::PSetupFn, + Psol::PSolveFn, +) + ccall( + (:SUNLinSolSetPreconditioner_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), + S, + P_data, + Pset, + Psol, + ) end function SUNLinSolSetScalingVectors_SPBCGS(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall((:SUNLinSolSetScalingVectors_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) + ccall( + (:SUNLinSolSetScalingVectors_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, N_Vector, N_Vector), + S, + s1, + s2, + ) end function SUNLinSolSetScalingVectors_SPBCGS(S, s1, s2) @@ -425,11 +835,32 @@ function SUNLinSolSetScalingVectors_SPBCGS(S, s1, s2) end function SUNLinSolSetup_SPBCGS(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, SUNMatrix), S, A) -end - -function SUNLinSolSolve_SPBCGS(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) + ccall( + (:SUNLinSolSetup_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) +end + +function SUNLinSolSolve_SPBCGS( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_SPBCGS(S, A, x, b, tol) @@ -439,23 +870,50 @@ function SUNLinSolSolve_SPBCGS(S, A, x, b, tol) end function SUNLinSolNumIters_SPBCGS(S::SUNLinearSolver) - ccall((:SUNLinSolNumIters_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolNumIters_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResNorm_SPBCGS(S::SUNLinearSolver) - ccall((:SUNLinSolResNorm_SPBCGS, libsundials_sunlinsolspbcgs), realtype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResNorm_SPBCGS, libsundials_sunlinsolspbcgs), + realtype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResid_SPBCGS(S::SUNLinearSolver) - ccall((:SUNLinSolResid_SPBCGS, libsundials_sunlinsolspbcgs), N_Vector, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResid_SPBCGS, libsundials_sunlinsolspbcgs), + N_Vector, + (SUNLinearSolver,), + S, + ) end function SUNLinSolLastFlag_SPBCGS(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_SPBCGS, libsundials_sunlinsolspbcgs), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_SPBCGS, libsundials_sunlinsolspbcgs), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_SPBCGS(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_SPBCGS, libsundials_sunlinsolspbcgs), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_SPBCGS(S::SUNLinearSolver) @@ -464,9 +922,15 @@ end # Julia wrapper for header: sunlinsol_spfgmr.h # Automatically generated using Clang.jl - function SUNLinSol_SPFGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNLinSol_SPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNLinSol_SPFGMR, libsundials_sunlinsolspfgmr), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNLinSol_SPFGMR(y, pretype, maxl) @@ -475,7 +939,13 @@ function SUNLinSol_SPFGMR(y, pretype, maxl) end function SUNLinSol_SPFGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNLinSol_SPFGMRSetPrecType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNLinSol_SPFGMRSetPrecType, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNLinSol_SPFGMRSetPrecType(S, pretype) @@ -483,7 +953,13 @@ function SUNLinSol_SPFGMRSetPrecType(S, pretype) end function SUNLinSol_SPFGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall((:SUNLinSol_SPFGMRSetGSType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, gstype) + ccall( + (:SUNLinSol_SPFGMRSetGSType, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Cint), + S, + gstype, + ) end function SUNLinSol_SPFGMRSetGSType(S, gstype) @@ -491,7 +967,13 @@ function SUNLinSol_SPFGMRSetGSType(S, gstype) end function SUNLinSol_SPFGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall((:SUNLinSol_SPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) + ccall( + (:SUNLinSol_SPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Cint), + S, + maxrs, + ) end function SUNLinSol_SPFGMRSetMaxRestarts(S, maxrs) @@ -499,7 +981,14 @@ function SUNLinSol_SPFGMRSetMaxRestarts(S, maxrs) end function SUNSPFGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNSPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNSPFGMR, libsundials_sunlinsolspfgmr), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNSPFGMR(y, pretype, maxl) @@ -508,7 +997,13 @@ function SUNSPFGMR(y, pretype, maxl) end function SUNSPFGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNSPFGMRSetPrecType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNSPFGMRSetPrecType, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNSPFGMRSetPrecType(S, pretype) @@ -516,7 +1011,13 @@ function SUNSPFGMRSetPrecType(S, pretype) end function SUNSPFGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall((:SUNSPFGMRSetGSType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, gstype) + ccall( + (:SUNSPFGMRSetGSType, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Cint), + S, + gstype, + ) end function SUNSPFGMRSetGSType(S, gstype) @@ -524,7 +1025,13 @@ function SUNSPFGMRSetGSType(S, gstype) end function SUNSPFGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall((:SUNSPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) + ccall( + (:SUNSPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Cint), + S, + maxrs, + ) end function SUNSPFGMRSetMaxRestarts(S, maxrs) @@ -532,27 +1039,69 @@ function SUNSPFGMRSetMaxRestarts(S, maxrs) end function SUNLinSolGetType_SPFGMR(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_SPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_SPFGMR, libsundials_sunlinsolspfgmr), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_SPFGMR(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_SPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_SPFGMR, libsundials_sunlinsolspfgmr), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_SPFGMR(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetATimes_SPFGMR(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall((:SUNLinSolSetATimes_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) -end - -function SUNLinSolSetPreconditioner_SPFGMR(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) - ccall((:SUNLinSolSetPreconditioner_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) + ccall( + (:SUNLinSolSetATimes_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), + S, + A_data, + ATimes, + ) +end + +function SUNLinSolSetPreconditioner_SPFGMR( + S::SUNLinearSolver, + P_data, + Pset::PSetupFn, + Psol::PSolveFn, +) + ccall( + (:SUNLinSolSetPreconditioner_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), + S, + P_data, + Pset, + Psol, + ) end function SUNLinSolSetScalingVectors_SPFGMR(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall((:SUNLinSolSetScalingVectors_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) + ccall( + (:SUNLinSolSetScalingVectors_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, N_Vector, N_Vector), + S, + s1, + s2, + ) end function SUNLinSolSetScalingVectors_SPFGMR(S, s1, s2) @@ -562,11 +1111,32 @@ function SUNLinSolSetScalingVectors_SPFGMR(S, s1, s2) end function SUNLinSolSetup_SPFGMR(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, SUNMatrix), S, A) -end - -function SUNLinSolSolve_SPFGMR(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) + ccall( + (:SUNLinSolSetup_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) +end + +function SUNLinSolSolve_SPFGMR( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_SPFGMR(S, A, x, b, tol) @@ -576,23 +1146,50 @@ function SUNLinSolSolve_SPFGMR(S, A, x, b, tol) end function SUNLinSolNumIters_SPFGMR(S::SUNLinearSolver) - ccall((:SUNLinSolNumIters_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolNumIters_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResNorm_SPFGMR(S::SUNLinearSolver) - ccall((:SUNLinSolResNorm_SPFGMR, libsundials_sunlinsolspfgmr), realtype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResNorm_SPFGMR, libsundials_sunlinsolspfgmr), + realtype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResid_SPFGMR(S::SUNLinearSolver) - ccall((:SUNLinSolResid_SPFGMR, libsundials_sunlinsolspfgmr), N_Vector, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResid_SPFGMR, libsundials_sunlinsolspfgmr), + N_Vector, + (SUNLinearSolver,), + S, + ) end function SUNLinSolLastFlag_SPFGMR(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_SPFGMR, libsundials_sunlinsolspfgmr), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_SPFGMR, libsundials_sunlinsolspfgmr), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_SPFGMR(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_SPFGMR, libsundials_sunlinsolspfgmr), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_SPFGMR(S::SUNLinearSolver) @@ -601,9 +1198,15 @@ end # Julia wrapper for header: sunlinsol_spgmr.h # Automatically generated using Clang.jl - function SUNLinSol_SPGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNLinSol_SPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNLinSol_SPGMR, libsundials_sunlinsolspgmr), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNLinSol_SPGMR(y, pretype, maxl) @@ -612,7 +1215,13 @@ function SUNLinSol_SPGMR(y, pretype, maxl) end function SUNLinSol_SPGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNLinSol_SPGMRSetPrecType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNLinSol_SPGMRSetPrecType, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNLinSol_SPGMRSetPrecType(S, pretype) @@ -620,7 +1229,13 @@ function SUNLinSol_SPGMRSetPrecType(S, pretype) end function SUNLinSol_SPGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall((:SUNLinSol_SPGMRSetGSType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, gstype) + ccall( + (:SUNLinSol_SPGMRSetGSType, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Cint), + S, + gstype, + ) end function SUNLinSol_SPGMRSetGSType(S, gstype) @@ -628,7 +1243,13 @@ function SUNLinSol_SPGMRSetGSType(S, gstype) end function SUNLinSol_SPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall((:SUNLinSol_SPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) + ccall( + (:SUNLinSol_SPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Cint), + S, + maxrs, + ) end function SUNLinSol_SPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs) @@ -636,7 +1257,14 @@ function SUNLinSol_SPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs) end function SUNSPGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNSPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNSPGMR, libsundials_sunlinsolspgmr), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNSPGMR(y, pretype, maxl) @@ -645,7 +1273,13 @@ function SUNSPGMR(y, pretype, maxl) end function SUNSPGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNSPGMRSetPrecType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNSPGMRSetPrecType, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNSPGMRSetPrecType(S, pretype) @@ -653,7 +1287,13 @@ function SUNSPGMRSetPrecType(S, pretype) end function SUNSPGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall((:SUNSPGMRSetGSType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, gstype) + ccall( + (:SUNSPGMRSetGSType, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Cint), + S, + gstype, + ) end function SUNSPGMRSetGSType(S, gstype) @@ -661,7 +1301,13 @@ function SUNSPGMRSetGSType(S, gstype) end function SUNSPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall((:SUNSPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) + ccall( + (:SUNSPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Cint), + S, + maxrs, + ) end function SUNSPGMRSetMaxRestarts(S, maxrs) @@ -669,27 +1315,69 @@ function SUNSPGMRSetMaxRestarts(S, maxrs) end function SUNLinSolGetType_SPGMR(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_SPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_SPGMR, libsundials_sunlinsolspgmr), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_SPGMR(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_SPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_SPGMR, libsundials_sunlinsolspgmr), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_SPGMR(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetATimes_SPGMR(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall((:SUNLinSolSetATimes_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) -end - -function SUNLinSolSetPreconditioner_SPGMR(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) - ccall((:SUNLinSolSetPreconditioner_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) + ccall( + (:SUNLinSolSetATimes_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), + S, + A_data, + ATimes, + ) +end + +function SUNLinSolSetPreconditioner_SPGMR( + S::SUNLinearSolver, + P_data, + Pset::PSetupFn, + Psol::PSolveFn, +) + ccall( + (:SUNLinSolSetPreconditioner_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), + S, + P_data, + Pset, + Psol, + ) end function SUNLinSolSetScalingVectors_SPGMR(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall((:SUNLinSolSetScalingVectors_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) + ccall( + (:SUNLinSolSetScalingVectors_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, N_Vector, N_Vector), + S, + s1, + s2, + ) end function SUNLinSolSetScalingVectors_SPGMR(S, s1, s2) @@ -699,11 +1387,32 @@ function SUNLinSolSetScalingVectors_SPGMR(S, s1, s2) end function SUNLinSolSetup_SPGMR(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, SUNMatrix), S, A) -end - -function SUNLinSolSolve_SPGMR(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) + ccall( + (:SUNLinSolSetup_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) +end + +function SUNLinSolSolve_SPGMR( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_SPGMR(S, A, x, b, tol) @@ -713,23 +1422,50 @@ function SUNLinSolSolve_SPGMR(S, A, x, b, tol) end function SUNLinSolNumIters_SPGMR(S::SUNLinearSolver) - ccall((:SUNLinSolNumIters_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolNumIters_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResNorm_SPGMR(S::SUNLinearSolver) - ccall((:SUNLinSolResNorm_SPGMR, libsundials_sunlinsolspgmr), realtype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResNorm_SPGMR, libsundials_sunlinsolspgmr), + realtype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResid_SPGMR(S::SUNLinearSolver) - ccall((:SUNLinSolResid_SPGMR, libsundials_sunlinsolspgmr), N_Vector, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResid_SPGMR, libsundials_sunlinsolspgmr), + N_Vector, + (SUNLinearSolver,), + S, + ) end function SUNLinSolLastFlag_SPGMR(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_SPGMR, libsundials_sunlinsolspgmr), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_SPGMR, libsundials_sunlinsolspgmr), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_SPGMR(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_SPGMR, libsundials_sunlinsolspgmr), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_SPGMR(S::SUNLinearSolver) @@ -738,9 +1474,15 @@ end # Julia wrapper for header: sunlinsol_sptfqmr.h # Automatically generated using Clang.jl - function SUNLinSol_SPTFQMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNLinSol_SPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNLinSol_SPTFQMR, libsundials_sunlinsolsptfqmr), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNLinSol_SPTFQMR(y, pretype, maxl) @@ -749,7 +1491,13 @@ function SUNLinSol_SPTFQMR(y, pretype, maxl) end function SUNLinSol_SPTFQMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNLinSol_SPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNLinSol_SPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNLinSol_SPTFQMRSetPrecType(S, pretype) @@ -757,7 +1505,13 @@ function SUNLinSol_SPTFQMRSetPrecType(S, pretype) end function SUNLinSol_SPTFQMRSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall((:SUNLinSol_SPTFQMRSetMaxl, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Cint), S, maxl) + ccall( + (:SUNLinSol_SPTFQMRSetMaxl, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, Cint), + S, + maxl, + ) end function SUNLinSol_SPTFQMRSetMaxl(S, maxl) @@ -765,7 +1519,14 @@ function SUNLinSol_SPTFQMRSetMaxl(S, maxl) end function SUNSPTFQMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall((:SUNSPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) + ccall( + (:SUNSPTFQMR, libsundials_sunlinsolsptfqmr), + SUNLinearSolver, + (N_Vector, Cint, Cint), + y, + pretype, + maxl, + ) end function SUNSPTFQMR(y, pretype, maxl) @@ -774,7 +1535,13 @@ function SUNSPTFQMR(y, pretype, maxl) end function SUNSPTFQMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall((:SUNSPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Cint), S, pretype) + ccall( + (:SUNSPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, Cint), + S, + pretype, + ) end function SUNSPTFQMRSetPrecType(S, pretype) @@ -782,27 +1549,69 @@ function SUNSPTFQMRSetPrecType(S, pretype) end function SUNLinSolGetType_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolGetType_SPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver_Type, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetType_SPTFQMR, libsundials_sunlinsolsptfqmr), + SUNLinearSolver_Type, + (SUNLinearSolver,), + S, + ) end function SUNLinSolGetID_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolGetID_SPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver_ID, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolGetID_SPTFQMR, libsundials_sunlinsolsptfqmr), + SUNLinearSolver_ID, + (SUNLinearSolver,), + S, + ) end function SUNLinSolInitialize_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolInitialize_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolInitialize_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSetATimes_SPTFQMR(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall((:SUNLinSolSetATimes_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) -end - -function SUNLinSolSetPreconditioner_SPTFQMR(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) - ccall((:SUNLinSolSetPreconditioner_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) + ccall( + (:SUNLinSolSetATimes_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), + S, + A_data, + ATimes, + ) +end + +function SUNLinSolSetPreconditioner_SPTFQMR( + S::SUNLinearSolver, + P_data, + Pset::PSetupFn, + Psol::PSolveFn, +) + ccall( + (:SUNLinSolSetPreconditioner_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), + S, + P_data, + Pset, + Psol, + ) end function SUNLinSolSetScalingVectors_SPTFQMR(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall((:SUNLinSolSetScalingVectors_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) + ccall( + (:SUNLinSolSetScalingVectors_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, N_Vector, N_Vector), + S, + s1, + s2, + ) end function SUNLinSolSetScalingVectors_SPTFQMR(S, s1, s2) @@ -812,11 +1621,32 @@ function SUNLinSolSetScalingVectors_SPTFQMR(S, s1, s2) end function SUNLinSolSetup_SPTFQMR(S::SUNLinearSolver, A::SUNMatrix) - ccall((:SUNLinSolSetup_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, SUNMatrix), S, A) -end - -function SUNLinSolSolve_SPTFQMR(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) - ccall((:SUNLinSolSolve_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) + ccall( + (:SUNLinSolSetup_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, SUNMatrix), + S, + A, + ) +end + +function SUNLinSolSolve_SPTFQMR( + S::SUNLinearSolver, + A::SUNMatrix, + x::N_Vector, + b::N_Vector, + tol::realtype, +) + ccall( + (:SUNLinSolSolve_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), + S, + A, + x, + b, + tol, + ) end function SUNLinSolSolve_SPTFQMR(S, A, x, b, tol) @@ -826,25 +1656,57 @@ function SUNLinSolSolve_SPTFQMR(S, A, x, b, tol) end function SUNLinSolNumIters_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolNumIters_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolNumIters_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResNorm_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolResNorm_SPTFQMR, libsundials_sunlinsolsptfqmr), realtype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResNorm_SPTFQMR, libsundials_sunlinsolsptfqmr), + realtype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolResid_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolResid_SPTFQMR, libsundials_sunlinsolsptfqmr), N_Vector, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolResid_SPTFQMR, libsundials_sunlinsolsptfqmr), + N_Vector, + (SUNLinearSolver,), + S, + ) end function SUNLinSolLastFlag_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolLastFlag_SPTFQMR, libsundials_sunlinsolsptfqmr), sunindextype, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolLastFlag_SPTFQMR, libsundials_sunlinsolsptfqmr), + sunindextype, + (SUNLinearSolver,), + S, + ) end function SUNLinSolSpace_SPTFQMR(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall((:SUNLinSolSpace_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) + ccall( + (:SUNLinSolSpace_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), + S, + lenrwLS, + leniwLS, + ) end function SUNLinSolFree_SPTFQMR(S::SUNLinearSolver) - ccall((:SUNLinSolFree_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver,), S) + ccall( + (:SUNLinSolFree_SPTFQMR, libsundials_sunlinsolsptfqmr), + Cint, + (SUNLinearSolver,), + S, + ) end diff --git a/src/API/sunmatrix.jl b/src/API/sunmatrix.jl index 9b48fae3..5a420dee 100644 --- a/src/API/sunmatrix.jl +++ b/src/API/sunmatrix.jl @@ -1,17 +1,42 @@ # Julia wrapper for header: sunmatrix_band.h # Automatically generated using Clang.jl - function SUNBandMatrix(N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall((:SUNBandMatrix, libsundials_sunmatrixband), SUNMatrix, (sunindextype, sunindextype, sunindextype), N, mu, ml) -end - -function SUNBandMatrixStorage(N::sunindextype, mu::sunindextype, ml::sunindextype, smu::sunindextype) - ccall((:SUNBandMatrixStorage, libsundials_sunmatrixband), SUNMatrix, (sunindextype, sunindextype, sunindextype, sunindextype), N, mu, ml, smu) + ccall( + (:SUNBandMatrix, libsundials_sunmatrixband), + SUNMatrix, + (sunindextype, sunindextype, sunindextype), + N, + mu, + ml, + ) +end + +function SUNBandMatrixStorage( + N::sunindextype, + mu::sunindextype, + ml::sunindextype, + smu::sunindextype, +) + ccall( + (:SUNBandMatrixStorage, libsundials_sunmatrixband), + SUNMatrix, + (sunindextype, sunindextype, sunindextype, sunindextype), + N, + mu, + ml, + smu, + ) end function SUNBandMatrix_Print(A::SUNMatrix, outfile) - ccall((:SUNBandMatrix_Print, libsundials_sunmatrixband), Cvoid, (SUNMatrix, Ptr{FILE}), A, outfile) + ccall( + (:SUNBandMatrix_Print, libsundials_sunmatrixband), + Cvoid, + (SUNMatrix, Ptr{FILE}), + A, + outfile, + ) end function SUNBandMatrix_Rows(A::SUNMatrix) @@ -19,19 +44,39 @@ function SUNBandMatrix_Rows(A::SUNMatrix) end function SUNBandMatrix_Columns(A::SUNMatrix) - ccall((:SUNBandMatrix_Columns, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNBandMatrix_Columns, libsundials_sunmatrixband), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNBandMatrix_LowerBandwidth(A::SUNMatrix) - ccall((:SUNBandMatrix_LowerBandwidth, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNBandMatrix_LowerBandwidth, libsundials_sunmatrixband), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNBandMatrix_UpperBandwidth(A::SUNMatrix) - ccall((:SUNBandMatrix_UpperBandwidth, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNBandMatrix_UpperBandwidth, libsundials_sunmatrixband), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNBandMatrix_StoredUpperBandwidth(A::SUNMatrix) - ccall((:SUNBandMatrix_StoredUpperBandwidth, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNBandMatrix_StoredUpperBandwidth, libsundials_sunmatrixband), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNBandMatrix_LDim(A::SUNMatrix) @@ -43,11 +88,22 @@ function SUNBandMatrix_Data(A::SUNMatrix) end function SUNBandMatrix_Cols(A::SUNMatrix) - ccall((:SUNBandMatrix_Cols, libsundials_sunmatrixband), Ptr{Ptr{realtype}}, (SUNMatrix,), A) + ccall( + (:SUNBandMatrix_Cols, libsundials_sunmatrixband), + Ptr{Ptr{realtype}}, + (SUNMatrix,), + A, + ) end function SUNBandMatrix_Column(A::SUNMatrix, j::sunindextype) - ccall((:SUNBandMatrix_Column, libsundials_sunmatrixband), Ptr{realtype}, (SUNMatrix, sunindextype), A, j) + ccall( + (:SUNBandMatrix_Column, libsundials_sunmatrixband), + Ptr{realtype}, + (SUNMatrix, sunindextype), + A, + j, + ) end function SUNMatGetID_Band(A::SUNMatrix) @@ -71,15 +127,35 @@ function SUNMatCopy_Band(A::SUNMatrix, B::SUNMatrix) end function SUNMatScaleAdd_Band(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall((:SUNMatScaleAdd_Band, libsundials_sunmatrixband), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) + ccall( + (:SUNMatScaleAdd_Band, libsundials_sunmatrixband), + Cint, + (realtype, SUNMatrix, SUNMatrix), + c, + A, + B, + ) end function SUNMatScaleAddI_Band(c::realtype, A::SUNMatrix) - ccall((:SUNMatScaleAddI_Band, libsundials_sunmatrixband), Cint, (realtype, SUNMatrix), c, A) + ccall( + (:SUNMatScaleAddI_Band, libsundials_sunmatrixband), + Cint, + (realtype, SUNMatrix), + c, + A, + ) end function SUNMatMatvec_Band(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall((:SUNMatMatvec_Band, libsundials_sunmatrixband), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) + ccall( + (:SUNMatMatvec_Band, libsundials_sunmatrixband), + Cint, + (SUNMatrix, N_Vector, N_Vector), + A, + x, + y, + ) end function SUNMatMatvec_Band(A, x, y) @@ -89,18 +165,36 @@ function SUNMatMatvec_Band(A, x, y) end function SUNMatSpace_Band(A::SUNMatrix, lenrw, leniw) - ccall((:SUNMatSpace_Band, libsundials_sunmatrixband), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) + ccall( + (:SUNMatSpace_Band, libsundials_sunmatrixband), + Cint, + (SUNMatrix, Ptr{Clong}, Ptr{Clong}), + A, + lenrw, + leniw, + ) end # Julia wrapper for header: sunmatrix_dense.h # Automatically generated using Clang.jl - function SUNDenseMatrix(M::sunindextype, N::sunindextype) - ccall((:SUNDenseMatrix, libsundials_sunmatrixdense), SUNMatrix, (sunindextype, sunindextype), M, N) + ccall( + (:SUNDenseMatrix, libsundials_sunmatrixdense), + SUNMatrix, + (sunindextype, sunindextype), + M, + N, + ) end function SUNDenseMatrix_Print(A::SUNMatrix, outfile) - ccall((:SUNDenseMatrix_Print, libsundials_sunmatrixdense), Cvoid, (SUNMatrix, Ptr{FILE}), A, outfile) + ccall( + (:SUNDenseMatrix_Print, libsundials_sunmatrixdense), + Cvoid, + (SUNMatrix, Ptr{FILE}), + A, + outfile, + ) end function SUNDenseMatrix_Rows(A::SUNMatrix) @@ -108,23 +202,49 @@ function SUNDenseMatrix_Rows(A::SUNMatrix) end function SUNDenseMatrix_Columns(A::SUNMatrix) - ccall((:SUNDenseMatrix_Columns, libsundials_sunmatrixdense), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNDenseMatrix_Columns, libsundials_sunmatrixdense), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNDenseMatrix_LData(A::SUNMatrix) - ccall((:SUNDenseMatrix_LData, libsundials_sunmatrixdense), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNDenseMatrix_LData, libsundials_sunmatrixdense), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNDenseMatrix_Data(A::SUNMatrix) - ccall((:SUNDenseMatrix_Data, libsundials_sunmatrixdense), Ptr{realtype}, (SUNMatrix,), A) + ccall( + (:SUNDenseMatrix_Data, libsundials_sunmatrixdense), + Ptr{realtype}, + (SUNMatrix,), + A, + ) end function SUNDenseMatrix_Cols(A::SUNMatrix) - ccall((:SUNDenseMatrix_Cols, libsundials_sunmatrixdense), Ptr{Ptr{realtype}}, (SUNMatrix,), A) + ccall( + (:SUNDenseMatrix_Cols, libsundials_sunmatrixdense), + Ptr{Ptr{realtype}}, + (SUNMatrix,), + A, + ) end function SUNDenseMatrix_Column(A::SUNMatrix, j::sunindextype) - ccall((:SUNDenseMatrix_Column, libsundials_sunmatrixdense), Ptr{realtype}, (SUNMatrix, sunindextype), A, j) + ccall( + (:SUNDenseMatrix_Column, libsundials_sunmatrixdense), + Ptr{realtype}, + (SUNMatrix, sunindextype), + A, + j, + ) end function SUNMatGetID_Dense(A::SUNMatrix) @@ -144,19 +264,45 @@ function SUNMatZero_Dense(A::SUNMatrix) end function SUNMatCopy_Dense(A::SUNMatrix, B::SUNMatrix) - ccall((:SUNMatCopy_Dense, libsundials_sunmatrixdense), Cint, (SUNMatrix, SUNMatrix), A, B) + ccall( + (:SUNMatCopy_Dense, libsundials_sunmatrixdense), + Cint, + (SUNMatrix, SUNMatrix), + A, + B, + ) end function SUNMatScaleAdd_Dense(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall((:SUNMatScaleAdd_Dense, libsundials_sunmatrixdense), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) + ccall( + (:SUNMatScaleAdd_Dense, libsundials_sunmatrixdense), + Cint, + (realtype, SUNMatrix, SUNMatrix), + c, + A, + B, + ) end function SUNMatScaleAddI_Dense(c::realtype, A::SUNMatrix) - ccall((:SUNMatScaleAddI_Dense, libsundials_sunmatrixdense), Cint, (realtype, SUNMatrix), c, A) + ccall( + (:SUNMatScaleAddI_Dense, libsundials_sunmatrixdense), + Cint, + (realtype, SUNMatrix), + c, + A, + ) end function SUNMatMatvec_Dense(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall((:SUNMatMatvec_Dense, libsundials_sunmatrixdense), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) + ccall( + (:SUNMatMatvec_Dense, libsundials_sunmatrixdense), + Cint, + (SUNMatrix, N_Vector, N_Vector), + A, + x, + y, + ) end function SUNMatMatvec_Dense(A, x, y) @@ -166,14 +312,33 @@ function SUNMatMatvec_Dense(A, x, y) end function SUNMatSpace_Dense(A::SUNMatrix, lenrw, leniw) - ccall((:SUNMatSpace_Dense, libsundials_sunmatrixdense), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) + ccall( + (:SUNMatSpace_Dense, libsundials_sunmatrixdense), + Cint, + (SUNMatrix, Ptr{Clong}, Ptr{Clong}), + A, + lenrw, + leniw, + ) end # Julia wrapper for header: sunmatrix_sparse.h # Automatically generated using Clang.jl - -function SUNSparseMatrix(M::sunindextype, N::sunindextype, NNZ::sunindextype, sparsetype::Cint) - ccall((:SUNSparseMatrix, libsundials_sunmatrixsparse), SUNMatrix, (sunindextype, sunindextype, sunindextype, Cint), M, N, NNZ, sparsetype) +function SUNSparseMatrix( + M::sunindextype, + N::sunindextype, + NNZ::sunindextype, + sparsetype::Cint, +) + ccall( + (:SUNSparseMatrix, libsundials_sunmatrixsparse), + SUNMatrix, + (sunindextype, sunindextype, sunindextype, Cint), + M, + N, + NNZ, + sparsetype, + ) end function SUNSparseMatrix(M, N, NNZ, sparsetype) @@ -181,7 +346,14 @@ function SUNSparseMatrix(M, N, NNZ, sparsetype) end function SUNSparseFromDenseMatrix(A::SUNMatrix, droptol::realtype, sparsetype::Cint) - ccall((:SUNSparseFromDenseMatrix, libsundials_sunmatrixdense), SUNMatrix, (SUNMatrix, realtype, Cint), A, droptol, sparsetype) + ccall( + (:SUNSparseFromDenseMatrix, libsundials_sunmatrixdense), + SUNMatrix, + (SUNMatrix, realtype, Cint), + A, + droptol, + sparsetype, + ) end function SUNSparseFromDenseMatrix(A, droptol, sparsetype) @@ -189,7 +361,14 @@ function SUNSparseFromDenseMatrix(A, droptol, sparsetype) end function SUNSparseFromBandMatrix(A::SUNMatrix, droptol::realtype, sparsetype::Cint) - ccall((:SUNSparseFromBandMatrix, libsundials_sunmatrixband), SUNMatrix, (SUNMatrix, realtype, Cint), A, droptol, sparsetype) + ccall( + (:SUNSparseFromBandMatrix, libsundials_sunmatrixband), + SUNMatrix, + (SUNMatrix, realtype, Cint), + A, + droptol, + sparsetype, + ) end function SUNSparseFromBandMatrix(A, droptol, sparsetype) @@ -201,23 +380,50 @@ function SUNSparseMatrix_Realloc(A::SUNMatrix) end function SUNSparseMatrix_Reallocate(A::SUNMatrix, NNZ::sunindextype) - ccall((:SUNSparseMatrix_Reallocate, libsundials_sunmatrixsparse), Cint, (SUNMatrix, sunindextype), A, NNZ) + ccall( + (:SUNSparseMatrix_Reallocate, libsundials_sunmatrixsparse), + Cint, + (SUNMatrix, sunindextype), + A, + NNZ, + ) end function SUNSparseMatrix_Print(A::SUNMatrix, outfile) - ccall((:SUNSparseMatrix_Print, libsundials_sunmatrixsparse), Cvoid, (SUNMatrix, Ptr{FILE}), A, outfile) + ccall( + (:SUNSparseMatrix_Print, libsundials_sunmatrixsparse), + Cvoid, + (SUNMatrix, Ptr{FILE}), + A, + outfile, + ) end function SUNSparseMatrix_Rows(A::SUNMatrix) - ccall((:SUNSparseMatrix_Rows, libsundials_sunmatrixsparse), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNSparseMatrix_Rows, libsundials_sunmatrixsparse), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNSparseMatrix_Columns(A::SUNMatrix) - ccall((:SUNSparseMatrix_Columns, libsundials_sunmatrixsparse), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNSparseMatrix_Columns, libsundials_sunmatrixsparse), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNSparseMatrix_NNZ(A::SUNMatrix) - ccall((:SUNSparseMatrix_NNZ, libsundials_sunmatrixsparse), sunindextype, (SUNMatrix,), A) + ccall( + (:SUNSparseMatrix_NNZ, libsundials_sunmatrixsparse), + sunindextype, + (SUNMatrix,), + A, + ) end function SUNSparseMatrix_NP(A::SUNMatrix) @@ -229,15 +435,30 @@ function SUNSparseMatrix_SparseType(A::SUNMatrix) end function SUNSparseMatrix_Data(A::SUNMatrix) - ccall((:SUNSparseMatrix_Data, libsundials_sunmatrixsparse), Ptr{realtype}, (SUNMatrix,), A) + ccall( + (:SUNSparseMatrix_Data, libsundials_sunmatrixsparse), + Ptr{realtype}, + (SUNMatrix,), + A, + ) end function SUNSparseMatrix_IndexValues(A::SUNMatrix) - ccall((:SUNSparseMatrix_IndexValues, libsundials_sunmatrixsparse), Ptr{sunindextype}, (SUNMatrix,), A) + ccall( + (:SUNSparseMatrix_IndexValues, libsundials_sunmatrixsparse), + Ptr{sunindextype}, + (SUNMatrix,), + A, + ) end function SUNSparseMatrix_IndexPointers(A::SUNMatrix) - ccall((:SUNSparseMatrix_IndexPointers, libsundials_sunmatrixsparse), Ptr{sunindextype}, (SUNMatrix,), A) + ccall( + (:SUNSparseMatrix_IndexPointers, libsundials_sunmatrixsparse), + Ptr{sunindextype}, + (SUNMatrix,), + A, + ) end function SUNMatGetID_Sparse(A::SUNMatrix) @@ -257,19 +478,45 @@ function SUNMatZero_Sparse(A::SUNMatrix) end function SUNMatCopy_Sparse(A::SUNMatrix, B::SUNMatrix) - ccall((:SUNMatCopy_Sparse, libsundials_sunmatrixsparse), Cint, (SUNMatrix, SUNMatrix), A, B) + ccall( + (:SUNMatCopy_Sparse, libsundials_sunmatrixsparse), + Cint, + (SUNMatrix, SUNMatrix), + A, + B, + ) end function SUNMatScaleAdd_Sparse(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall((:SUNMatScaleAdd_Sparse, libsundials_sunmatrixsparse), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) + ccall( + (:SUNMatScaleAdd_Sparse, libsundials_sunmatrixsparse), + Cint, + (realtype, SUNMatrix, SUNMatrix), + c, + A, + B, + ) end function SUNMatScaleAddI_Sparse(c::realtype, A::SUNMatrix) - ccall((:SUNMatScaleAddI_Sparse, libsundials_sunmatrixsparse), Cint, (realtype, SUNMatrix), c, A) + ccall( + (:SUNMatScaleAddI_Sparse, libsundials_sunmatrixsparse), + Cint, + (realtype, SUNMatrix), + c, + A, + ) end function SUNMatMatvec_Sparse(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall((:SUNMatMatvec_Sparse, libsundials_sunmatrixsparse), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) + ccall( + (:SUNMatMatvec_Sparse, libsundials_sunmatrixsparse), + Cint, + (SUNMatrix, N_Vector, N_Vector), + A, + x, + y, + ) end function SUNMatMatvec_Sparse(A, x, y) @@ -279,5 +526,12 @@ function SUNMatMatvec_Sparse(A, x, y) end function SUNMatSpace_Sparse(A::SUNMatrix, lenrw, leniw) - ccall((:SUNMatSpace_Sparse, libsundials_sunmatrixsparse), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) + ccall( + (:SUNMatSpace_Sparse, libsundials_sunmatrixsparse), + Cint, + (SUNMatrix, Ptr{Clong}, Ptr{Clong}), + A, + lenrw, + leniw, + ) end diff --git a/src/API/sunnonlinsol.jl b/src/API/sunnonlinsol.jl index b17607d3..2e950bd2 100644 --- a/src/API/sunnonlinsol.jl +++ b/src/API/sunnonlinsol.jl @@ -1,9 +1,14 @@ # Julia wrapper for header: sunnonlinsol_fixedpoint.h # Automatically generated using Clang.jl - function SUNNonlinSol_FixedPoint(y::N_Vector, m::Cint) - ccall((:SUNNonlinSol_FixedPoint, libsundials_sunnonlinsolfixedpoint), SUNNonlinearSolver, (N_Vector, Cint), y, m) + ccall( + (:SUNNonlinSol_FixedPoint, libsundials_sunnonlinsolfixedpoint), + SUNNonlinearSolver, + (N_Vector, Cint), + y, + m, + ) end function SUNNonlinSol_FixedPoint(y, m) @@ -12,47 +17,131 @@ function SUNNonlinSol_FixedPoint(y, m) end function SUNNonlinSol_FixedPointSens(count::Cint, y::N_Vector, m::Cint) - ccall((:SUNNonlinSol_FixedPointSens, libsundials_sunnonlinsolfixedpoint), SUNNonlinearSolver, (Cint, N_Vector, Cint), count, y, m) + ccall( + (:SUNNonlinSol_FixedPointSens, libsundials_sunnonlinsolfixedpoint), + SUNNonlinearSolver, + (Cint, N_Vector, Cint), + count, + y, + m, + ) end function SUNNonlinSol_FixedPointSens(count, y, m) __y = convert(NVector, y) - SUNNonlinSol_FixedPointSens(convert(Cint, count), convert(N_Vector, __y), convert(Cint, m)) + SUNNonlinSol_FixedPointSens( + convert(Cint, count), + convert(N_Vector, __y), + convert(Cint, m), + ) end function SUNNonlinSolGetType_FixedPoint(NLS::SUNNonlinearSolver) - ccall((:SUNNonlinSolGetType_FixedPoint, libsundials_sunnonlinsolfixedpoint), SUNNonlinearSolver_Type, (SUNNonlinearSolver,), NLS) + ccall( + (:SUNNonlinSolGetType_FixedPoint, libsundials_sunnonlinsolfixedpoint), + SUNNonlinearSolver_Type, + (SUNNonlinearSolver,), + NLS, + ) end function SUNNonlinSolInitialize_FixedPoint(NLS::SUNNonlinearSolver) - ccall((:SUNNonlinSolInitialize_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver,), NLS) -end - -function SUNNonlinSolSolve_FixedPoint(NLS::SUNNonlinearSolver, y0::N_Vector, y::N_Vector, w::N_Vector, tol::realtype, callSetup::Cint, mem) - ccall((:SUNNonlinSolSolve_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), NLS, y0, y, w, tol, callSetup, mem) -end - -function SUNNonlinSolSolve_FixedPoint(NLS::SUNNonlinearSolver, y0, y, w, tol, callSetup, mem) + ccall( + (:SUNNonlinSolInitialize_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver,), + NLS, + ) +end + +function SUNNonlinSolSolve_FixedPoint( + NLS::SUNNonlinearSolver, + y0::N_Vector, + y::N_Vector, + w::N_Vector, + tol::realtype, + callSetup::Cint, + mem, +) + ccall( + (:SUNNonlinSolSolve_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), + NLS, + y0, + y, + w, + tol, + callSetup, + mem, + ) +end + +function SUNNonlinSolSolve_FixedPoint( + NLS::SUNNonlinearSolver, + y0, + y, + w, + tol, + callSetup, + mem, +) __y0 = convert(NVector, y0) __y = convert(NVector, y) __w = convert(NVector, w) - SUNNonlinSolSolve_FixedPoint(NLS, convert(N_Vector, __y0), convert(N_Vector, __y), convert(N_Vector, __w), tol, convert(Cint, callSetup), mem) + SUNNonlinSolSolve_FixedPoint( + NLS, + convert(N_Vector, __y0), + convert(N_Vector, __y), + convert(N_Vector, __w), + tol, + convert(Cint, callSetup), + mem, + ) end function SUNNonlinSolFree_FixedPoint(NLS::SUNNonlinearSolver) - ccall((:SUNNonlinSolFree_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver,), NLS) + ccall( + (:SUNNonlinSolFree_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver,), + NLS, + ) end function SUNNonlinSolSetSysFn_FixedPoint(NLS::SUNNonlinearSolver, SysFn::SUNNonlinSolSysFn) - ccall((:SUNNonlinSolSetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, SUNNonlinSolSysFn), NLS, SysFn) -end - -function SUNNonlinSolSetConvTestFn_FixedPoint(NLS::SUNNonlinearSolver, CTestFn::SUNNonlinSolConvTestFn, ctest_data) - ccall((:SUNNonlinSolSetConvTestFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), NLS, CTestFn, ctest_data) + ccall( + (:SUNNonlinSolSetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, SUNNonlinSolSysFn), + NLS, + SysFn, + ) +end + +function SUNNonlinSolSetConvTestFn_FixedPoint( + NLS::SUNNonlinearSolver, + CTestFn::SUNNonlinSolConvTestFn, + ctest_data, +) + ccall( + (:SUNNonlinSolSetConvTestFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), + NLS, + CTestFn, + ctest_data, + ) end function SUNNonlinSolSetMaxIters_FixedPoint(NLS::SUNNonlinearSolver, maxiters::Cint) - ccall((:SUNNonlinSolSetMaxIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Cint), NLS, maxiters) + ccall( + (:SUNNonlinSolSetMaxIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, Cint), + NLS, + maxiters, + ) end function SUNNonlinSolSetMaxIters_FixedPoint(NLS, maxiters) @@ -60,30 +149,64 @@ function SUNNonlinSolSetMaxIters_FixedPoint(NLS, maxiters) end function SUNNonlinSolSetDamping_FixedPoint(NLS::SUNNonlinearSolver, beta::realtype) - ccall((:SUNNonlinSolSetDamping_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, realtype), NLS, beta) + ccall( + (:SUNNonlinSolSetDamping_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, realtype), + NLS, + beta, + ) end function SUNNonlinSolGetNumIters_FixedPoint(NLS::SUNNonlinearSolver, niters) - ccall((:SUNNonlinSolGetNumIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, niters) + ccall( + (:SUNNonlinSolGetNumIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, Ptr{Clong}), + NLS, + niters, + ) end function SUNNonlinSolGetCurIter_FixedPoint(NLS::SUNNonlinearSolver, iter) - ccall((:SUNNonlinSolGetCurIter_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{Cint}), NLS, iter) + ccall( + (:SUNNonlinSolGetCurIter_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, Ptr{Cint}), + NLS, + iter, + ) end function SUNNonlinSolGetNumConvFails_FixedPoint(NLS::SUNNonlinearSolver, nconvfails) - ccall((:SUNNonlinSolGetNumConvFails_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, nconvfails) + ccall( + (:SUNNonlinSolGetNumConvFails_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, Ptr{Clong}), + NLS, + nconvfails, + ) end function SUNNonlinSolGetSysFn_FixedPoint(NLS::SUNNonlinearSolver, SysFn) - ccall((:SUNNonlinSolGetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), NLS, SysFn) + ccall( + (:SUNNonlinSolGetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), + Cint, + (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), + NLS, + SysFn, + ) end # Julia wrapper for header: sunnonlinsol_newton.h # Automatically generated using Clang.jl - function SUNNonlinSol_Newton(y::N_Vector) - ccall((:SUNNonlinSol_Newton, libsundials_sunnonlinsolnewton), SUNNonlinearSolver, (N_Vector,), y) + ccall( + (:SUNNonlinSol_Newton, libsundials_sunnonlinsolnewton), + SUNNonlinearSolver, + (N_Vector,), + y, + ) end function SUNNonlinSol_Newton(y) @@ -92,7 +215,13 @@ function SUNNonlinSol_Newton(y) end function SUNNonlinSol_NewtonSens(count::Cint, y::N_Vector) - ccall((:SUNNonlinSol_NewtonSens, libsundials_sunnonlinsolnewton), SUNNonlinearSolver, (Cint, N_Vector), count, y) + ccall( + (:SUNNonlinSol_NewtonSens, libsundials_sunnonlinsolnewton), + SUNNonlinearSolver, + (Cint, N_Vector), + count, + y, + ) end function SUNNonlinSol_NewtonSens(count, y) @@ -101,46 +230,129 @@ function SUNNonlinSol_NewtonSens(count, y) end function SUNNonlinSolGetType_Newton(NLS::SUNNonlinearSolver) - ccall((:SUNNonlinSolGetType_Newton, libsundials_sunnonlinsolnewton), SUNNonlinearSolver_Type, (SUNNonlinearSolver,), NLS) + ccall( + (:SUNNonlinSolGetType_Newton, libsundials_sunnonlinsolnewton), + SUNNonlinearSolver_Type, + (SUNNonlinearSolver,), + NLS, + ) end function SUNNonlinSolInitialize_Newton(NLS::SUNNonlinearSolver) - ccall((:SUNNonlinSolInitialize_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver,), NLS) -end - -function SUNNonlinSolSolve_Newton(NLS::SUNNonlinearSolver, y0::N_Vector, y::N_Vector, w::N_Vector, tol::realtype, callLSetup::Cint, mem) - ccall((:SUNNonlinSolSolve_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), NLS, y0, y, w, tol, callLSetup, mem) + ccall( + (:SUNNonlinSolInitialize_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver,), + NLS, + ) +end + +function SUNNonlinSolSolve_Newton( + NLS::SUNNonlinearSolver, + y0::N_Vector, + y::N_Vector, + w::N_Vector, + tol::realtype, + callLSetup::Cint, + mem, +) + ccall( + (:SUNNonlinSolSolve_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), + NLS, + y0, + y, + w, + tol, + callLSetup, + mem, + ) end function SUNNonlinSolSolve_Newton(NLS, y0, y, w, tol, callLSetup, mem) __y0 = convert(NVector, y0) __y = convert(NVector, y) __w = convert(NVector, w) - SUNNonlinSolSolve_Newton(NLS, convert(N_Vector, __y0), convert(N_Vector, __y), convert(N_Vector, __w), tol, convert(Cint, callLSetup), mem) + SUNNonlinSolSolve_Newton( + NLS, + convert(N_Vector, __y0), + convert(N_Vector, __y), + convert(N_Vector, __w), + tol, + convert(Cint, callLSetup), + mem, + ) end function SUNNonlinSolFree_Newton(NLS::SUNNonlinearSolver) - ccall((:SUNNonlinSolFree_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver,), NLS) + ccall( + (:SUNNonlinSolFree_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver,), + NLS, + ) end function SUNNonlinSolSetSysFn_Newton(NLS::SUNNonlinearSolver, SysFn::SUNNonlinSolSysFn) - ccall((:SUNNonlinSolSetSysFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolSysFn), NLS, SysFn) -end - -function SUNNonlinSolSetLSetupFn_Newton(NLS::SUNNonlinearSolver, LSetupFn::SUNNonlinSolLSetupFn) - ccall((:SUNNonlinSolSetLSetupFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolLSetupFn), NLS, LSetupFn) -end - -function SUNNonlinSolSetLSolveFn_Newton(NLS::SUNNonlinearSolver, LSolveFn::SUNNonlinSolLSolveFn) - ccall((:SUNNonlinSolSetLSolveFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolLSolveFn), NLS, LSolveFn) -end - -function SUNNonlinSolSetConvTestFn_Newton(NLS::SUNNonlinearSolver, CTestFn::SUNNonlinSolConvTestFn, ctest_data) - ccall((:SUNNonlinSolSetConvTestFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), NLS, CTestFn, ctest_data) + ccall( + (:SUNNonlinSolSetSysFn_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, SUNNonlinSolSysFn), + NLS, + SysFn, + ) +end + +function SUNNonlinSolSetLSetupFn_Newton( + NLS::SUNNonlinearSolver, + LSetupFn::SUNNonlinSolLSetupFn, +) + ccall( + (:SUNNonlinSolSetLSetupFn_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, SUNNonlinSolLSetupFn), + NLS, + LSetupFn, + ) +end + +function SUNNonlinSolSetLSolveFn_Newton( + NLS::SUNNonlinearSolver, + LSolveFn::SUNNonlinSolLSolveFn, +) + ccall( + (:SUNNonlinSolSetLSolveFn_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, SUNNonlinSolLSolveFn), + NLS, + LSolveFn, + ) +end + +function SUNNonlinSolSetConvTestFn_Newton( + NLS::SUNNonlinearSolver, + CTestFn::SUNNonlinSolConvTestFn, + ctest_data, +) + ccall( + (:SUNNonlinSolSetConvTestFn_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), + NLS, + CTestFn, + ctest_data, + ) end function SUNNonlinSolSetMaxIters_Newton(NLS::SUNNonlinearSolver, maxiters::Cint) - ccall((:SUNNonlinSolSetMaxIters_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Cint), NLS, maxiters) + ccall( + (:SUNNonlinSolSetMaxIters_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, Cint), + NLS, + maxiters, + ) end function SUNNonlinSolSetMaxIters_Newton(NLS, maxiters) @@ -148,17 +360,41 @@ function SUNNonlinSolSetMaxIters_Newton(NLS, maxiters) end function SUNNonlinSolGetNumIters_Newton(NLS::SUNNonlinearSolver, niters) - ccall((:SUNNonlinSolGetNumIters_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, niters) + ccall( + (:SUNNonlinSolGetNumIters_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, Ptr{Clong}), + NLS, + niters, + ) end function SUNNonlinSolGetCurIter_Newton(NLS::SUNNonlinearSolver, iter) - ccall((:SUNNonlinSolGetCurIter_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{Cint}), NLS, iter) + ccall( + (:SUNNonlinSolGetCurIter_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, Ptr{Cint}), + NLS, + iter, + ) end function SUNNonlinSolGetNumConvFails_Newton(NLS::SUNNonlinearSolver, nconvfails) - ccall((:SUNNonlinSolGetNumConvFails_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, nconvfails) + ccall( + (:SUNNonlinSolGetNumConvFails_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, Ptr{Clong}), + NLS, + nconvfails, + ) end function SUNNonlinSolGetSysFn_Newton(NLS::SUNNonlinearSolver, SysFn) - ccall((:SUNNonlinSolGetSysFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), NLS, SysFn) + ccall( + (:SUNNonlinSolGetSysFn_Newton, libsundials_sunnonlinsolnewton), + Cint, + (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), + NLS, + SysFn, + ) end diff --git a/src/API/types_and_consts.jl b/src/API/types_and_consts.jl index 9768b7b5..3bd0ab5f 100644 --- a/src/API/types_and_consts.jl +++ b/src/API/types_and_consts.jl @@ -173,7 +173,6 @@ CEnum.@cenum MRISTEP_ID::UInt32 begin MRISTEP_ARKSTEP = 0 end - const MRIStepPreInnerFn = Ptr{Cvoid} const MRIStepPostInnerFn = Ptr{Cvoid} const CV_ADAMS = Cint(1) @@ -700,8 +699,6 @@ CEnum.@cenum SUNLinearSolver_ID::UInt32 begin SUNLINEARSOLVER_CUSTOM = 13 end - - struct _generic_SUNLinearSolver_Ops gettype::Ptr{Cvoid} getid::Ptr{Cvoid} @@ -742,7 +739,6 @@ const SUNMAT_MEM_FAIL = Cint(-702) const SUNMAT_OPERATION_FAIL = Cint(-703) const SUNMAT_MATVEC_SETUP_REQUIRED = Cint(-704) - CEnum.@cenum SUNMatrix_ID::UInt32 begin SUNMATRIX_DENSE = 0 SUNMATRIX_BAND = 1 @@ -751,7 +747,6 @@ CEnum.@cenum SUNMatrix_ID::UInt32 begin SUNMATRIX_CUSTOM = 4 end - struct _generic_SUNMatrix_Ops getid::Ptr{Cvoid} clone::Ptr{Cvoid} @@ -837,7 +832,6 @@ CEnum.@cenum N_Vector_ID::UInt32 begin SUNDIALS_NVEC_CUSTOM = 13 end - const N_Vector_S = Ptr{N_Vector} # Skipping MacroDefinition: RCONST ( x ) x diff --git a/src/Sundials.jl b/src/Sundials.jl index cdcb51db..3cd1fe9a 100644 --- a/src/Sundials.jl +++ b/src/Sundials.jl @@ -22,18 +22,30 @@ const Ctime_t = UInt const Cclock_t = UInt export Ctm, Ctime_t, Cclock_t -const warnkeywords = - (:save_idxs, :d_discontinuities, :isoutofdomain, :unstable_check, - :calck, :internalnorm, :gamma, :beta1, :beta2, :qmax, :qmin, :qoldinit) +const warnkeywords = ( + :save_idxs, + :d_discontinuities, + :isoutofdomain, + :unstable_check, + :calck, + :internalnorm, + :gamma, + :beta1, + :beta2, + :qmax, + :qmin, + :qoldinit, +) function __init__() global warnlist = Set(warnkeywords) - global warnida = union(warnlist, Set((:dtmin,))) + global warnida = union(warnlist, Set((:dtmin,))) end using Sundials_jll -export solve, SundialsODEAlgorithm, SundialsDAEAlgorithm, ARKODE, CVODE_BDF, CVODE_Adams, IDA +export solve, + SundialsODEAlgorithm, SundialsDAEAlgorithm, ARKODE, CVODE_BDF, CVODE_Adams, IDA # some definitions from the system C headers wrapped into the types_and_consts.jl const DBL_MAX = prevfloat(Inf) diff --git a/src/common_interface/algorithms.jl b/src/common_interface/algorithms.jl index 00c241cc..7e18a9b3 100644 --- a/src/common_interface/algorithms.jl +++ b/src/common_interface/algorithms.jl @@ -1,11 +1,11 @@ # Sundials.jl algorithms # Abstract Types -abstract type SundialsODEAlgorithm{Method,LinearSolver} <: DiffEqBase.AbstractODEAlgorithm end +abstract type SundialsODEAlgorithm{Method, LinearSolver} <: DiffEqBase.AbstractODEAlgorithm end abstract type SundialsDAEAlgorithm{LinearSolver} <: DiffEqBase.AbstractDAEAlgorithm end # ODE Algorithms -struct CVODE_BDF{Method,LinearSolver,P,PS} <: SundialsODEAlgorithm{Method,LinearSolver} +struct CVODE_BDF{Method, LinearSolver, P, PS} <: SundialsODEAlgorithm{Method, LinearSolver} jac_upper::Int jac_lower::Int krylov_dim::Int @@ -19,33 +19,62 @@ struct CVODE_BDF{Method,LinearSolver,P,PS} <: SundialsODEAlgorithm{Method,Linear psetup::PS prec_side::Int end -Base.@pure function CVODE_BDF(;method=:Newton,linear_solver=:Dense, - jac_upper=0,jac_lower=0,non_zero=0,krylov_dim=0, - stability_limit_detect=false, - max_hnil_warns = 10, - max_order = 5, - max_error_test_failures = 7, - max_nonlinear_iters = 3, - max_convergence_failures = 10, - prec = nothing, psetup = nothing, prec_side = 0) - if linear_solver == :Band && (jac_upper==0 || jac_lower==0) +Base.@pure function CVODE_BDF(; + method = :Newton, + linear_solver = :Dense, + jac_upper = 0, + jac_lower = 0, + non_zero = 0, + krylov_dim = 0, + stability_limit_detect = false, + max_hnil_warns = 10, + max_order = 5, + max_error_test_failures = 7, + max_nonlinear_iters = 3, + max_convergence_failures = 10, + prec = nothing, + psetup = nothing, + prec_side = 0, +) + if linear_solver == :Band && (jac_upper == 0 || jac_lower == 0) error("Banded solver must set the jac_upper and jac_lower") end - if !(linear_solver in (:None, :Diagonal, :Dense, :LapackDense, :Band, :LapackBand, :BCG, :GMRES, :FGMRES, :PCG, :TFQMR, :KLU)) + if !( + linear_solver in ( + :None, + :Diagonal, + :Dense, + :LapackDense, + :Band, + :LapackBand, + :BCG, + :GMRES, + :FGMRES, + :PCG, + :TFQMR, + :KLU, + ) + ) error("Linear solver choice not accepted.") end - CVODE_BDF{method,linear_solver, typeof(prec), typeof(psetup)}( - jac_upper,jac_lower, - krylov_dim, - stability_limit_detect, - max_hnil_warns, - max_order, - max_error_test_failures, - max_nonlinear_iters, - max_convergence_failures, prec, psetup, prec_side) + CVODE_BDF{method, linear_solver, typeof(prec), typeof(psetup)}( + jac_upper, + jac_lower, + krylov_dim, + stability_limit_detect, + max_hnil_warns, + max_order, + max_error_test_failures, + max_nonlinear_iters, + max_convergence_failures, + prec, + psetup, + prec_side, + ) end -struct CVODE_Adams{Method,LinearSolver,P,PS} <: SundialsODEAlgorithm{Method,LinearSolver} +struct CVODE_Adams{Method, LinearSolver, P, PS} <: + SundialsODEAlgorithm{Method, LinearSolver} jac_upper::Int jac_lower::Int krylov_dim::Int @@ -59,36 +88,61 @@ struct CVODE_Adams{Method,LinearSolver,P,PS} <: SundialsODEAlgorithm{Method,Line psetup::PS prec_side::Int end -Base.@pure function CVODE_Adams(;method=:Functional,linear_solver=:None, - jac_upper=0,jac_lower=0, - krylov_dim=0, - stability_limit_detect=false, - max_hnil_warns = 10, - max_order = 12, - max_error_test_failures = 7, - max_nonlinear_iters = 3, - max_convergence_failures = 10, - prec = nothing, psetup = nothing, prec_side = 0 - ) - if linear_solver == :Band && (jac_upper==0 || jac_lower==0) +Base.@pure function CVODE_Adams(; + method = :Functional, + linear_solver = :None, + jac_upper = 0, + jac_lower = 0, + krylov_dim = 0, + stability_limit_detect = false, + max_hnil_warns = 10, + max_order = 12, + max_error_test_failures = 7, + max_nonlinear_iters = 3, + max_convergence_failures = 10, + prec = nothing, + psetup = nothing, + prec_side = 0, +) + if linear_solver == :Band && (jac_upper == 0 || jac_lower == 0) error("Banded solver must set the jac_upper and jac_lower") end - if !(linear_solver in (:None, :Diagonal, :Dense, :LapackDense, :Band, :LapackBand, :BCG, :GMRES, :FGMRES, :PCG, :TFQMR, :KLU)) + if !( + linear_solver in ( + :None, + :Diagonal, + :Dense, + :LapackDense, + :Band, + :LapackBand, + :BCG, + :GMRES, + :FGMRES, + :PCG, + :TFQMR, + :KLU, + ) + ) error("Linear solver choice not accepted.") end - CVODE_Adams{method,linear_solver,typeof(prec),typeof(psetup)}( - jac_upper,jac_lower, - krylov_dim, - stability_limit_detect, - max_hnil_warns, - max_order, - max_error_test_failures, - max_nonlinear_iters, - max_convergence_failures,prec,psetup, - prec_side) + CVODE_Adams{method, linear_solver, typeof(prec), typeof(psetup)}( + jac_upper, + jac_lower, + krylov_dim, + stability_limit_detect, + max_hnil_warns, + max_order, + max_error_test_failures, + max_nonlinear_iters, + max_convergence_failures, + prec, + psetup, + prec_side, + ) end -struct ARKODE{Method,LinearSolver,MassLinearSolver,T,T1,T2,P,PS} <: SundialsODEAlgorithm{Method,LinearSolver} +struct ARKODE{Method, LinearSolver, MassLinearSolver, T, T1, T2, P, PS} <: + SundialsODEAlgorithm{Method, LinearSolver} stiffness::T jac_upper::Int jac_lower::Int @@ -116,123 +170,203 @@ struct ARKODE{Method,LinearSolver,MassLinearSolver,T,T1,T2,P,PS} <: SundialsODEA prec_side::Int end -Base.@pure function ARKODE(stiffness=Implicit();method=:Newton,linear_solver=:Dense, - mass_linear_solver=:Dense, - jac_upper=0,jac_lower=0, - mass_upper=0,mass_lower=0, - non_zero=0,krylov_dim=0,mass_krylov_dim=0, - max_hnil_warns = 10, - max_error_test_failures = 7, - max_nonlinear_iters = 3, - max_convergence_failures = 10, - predictor_method = 0, - nonlinear_convergence_coefficient = 0.1, - dense_order = 3, - order = 4, - set_optimal_params = false, - crdown = 0.3, - dgmax = 0.2, - rdiv = 2.3, - msbp = 20, - adaptivity_method = 0, - itable = nothing, - etable = nothing, - prec = nothing, psetup = nothing, prec_side = 0 - ) - if linear_solver == :Band && (jac_upper==0 || jac_lower==0) +Base.@pure function ARKODE( + stiffness = Implicit(); + method = :Newton, + linear_solver = :Dense, + mass_linear_solver = :Dense, + jac_upper = 0, + jac_lower = 0, + mass_upper = 0, + mass_lower = 0, + non_zero = 0, + krylov_dim = 0, + mass_krylov_dim = 0, + max_hnil_warns = 10, + max_error_test_failures = 7, + max_nonlinear_iters = 3, + max_convergence_failures = 10, + predictor_method = 0, + nonlinear_convergence_coefficient = 0.1, + dense_order = 3, + order = 4, + set_optimal_params = false, + crdown = 0.3, + dgmax = 0.2, + rdiv = 2.3, + msbp = 20, + adaptivity_method = 0, + itable = nothing, + etable = nothing, + prec = nothing, + psetup = nothing, + prec_side = 0, +) + if linear_solver == :Band && (jac_upper == 0 || jac_lower == 0) error("Banded solver must set the jac_upper and jac_lower") end - if !(linear_solver in (:None, :Diagonal, :Dense, :LapackDense, :Band, :LapackBand, :BCG, :GMRES, :FGMRES, :PCG, :TFQMR, :KLU)) + if !( + linear_solver in ( + :None, + :Diagonal, + :Dense, + :LapackDense, + :Band, + :LapackBand, + :BCG, + :GMRES, + :FGMRES, + :PCG, + :TFQMR, + :KLU, + ) + ) error("Linear solver choice not accepted.") end - if !(mass_linear_solver in (:None, :Diagonal, :Dense, :LapackDense, :Band, :LapackBand, :BCG, :GMRES, :FGMRES, :PCG, :TFQMR, :KLU)) + if !( + mass_linear_solver in ( + :None, + :Diagonal, + :Dense, + :LapackDense, + :Band, + :LapackBand, + :BCG, + :GMRES, + :FGMRES, + :PCG, + :TFQMR, + :KLU, + ) + ) error("Mass Matrix Linear solver choice not accepted.") end - ARKODE{method,linear_solver,mass_linear_solver, - typeof(stiffness), - typeof(itable),typeof(etable), - typeof(prec),typeof(psetup)}( - stiffness, - jac_upper,jac_lower, - mass_upper,mass_lower, - krylov_dim,mass_krylov_dim, - max_hnil_warns, - max_error_test_failures, - max_nonlinear_iters, - max_convergence_failures, - predictor_method, - nonlinear_convergence_coefficient, - dense_order, - order, - set_optimal_params, - crdown, - dgmax, - rdiv, - msbp, - itable, - etable, - prec, psetup, prec_side) + ARKODE{ + method, + linear_solver, + mass_linear_solver, + typeof(stiffness), + typeof(itable), + typeof(etable), + typeof(prec), + typeof(psetup), + }( + stiffness, + jac_upper, + jac_lower, + mass_upper, + mass_lower, + krylov_dim, + mass_krylov_dim, + max_hnil_warns, + max_error_test_failures, + max_nonlinear_iters, + max_convergence_failures, + predictor_method, + nonlinear_convergence_coefficient, + dense_order, + order, + set_optimal_params, + crdown, + dgmax, + rdiv, + msbp, + itable, + etable, + prec, + psetup, + prec_side, + ) end # DAE Algorithms -struct IDA{LinearSolver,P,PS} <: SundialsDAEAlgorithm{LinearSolver} - jac_upper::Int - jac_lower::Int - krylov_dim::Int - max_order::Int - max_error_test_failures::Int - nonlinear_convergence_coefficient::Float64 - max_nonlinear_iters::Int - max_convergence_failures::Int - nonlinear_convergence_coefficient_ic::Float64 - max_num_steps_ic::Int - max_num_jacs_ic::Int - max_num_iters_ic::Int - max_num_backs_ic::Int - use_linesearch_ic::Bool - init_all::Bool - prec::P - psetup::PS - prec_side::Int +struct IDA{LinearSolver, P, PS} <: SundialsDAEAlgorithm{LinearSolver} + jac_upper::Int + jac_lower::Int + krylov_dim::Int + max_order::Int + max_error_test_failures::Int + nonlinear_convergence_coefficient::Float64 + max_nonlinear_iters::Int + max_convergence_failures::Int + nonlinear_convergence_coefficient_ic::Float64 + max_num_steps_ic::Int + max_num_jacs_ic::Int + max_num_iters_ic::Int + max_num_backs_ic::Int + use_linesearch_ic::Bool + init_all::Bool + prec::P + psetup::PS + prec_side::Int end -Base.@pure function IDA(;linear_solver=:Dense,jac_upper=0,jac_lower=0, - krylov_dim=0, - max_order = 5, - max_error_test_failures = 7, - max_nonlinear_iters = 3, - nonlinear_convergence_coefficient = 0.33, - nonlinear_convergence_coefficient_ic = 0.0033, - max_num_steps_ic = 5, - max_num_jacs_ic = 4, - max_num_iters_ic = 10, - max_num_backs_ic = 100, - use_linesearch_ic = true, - init_all = false, - max_convergence_failures = 10, - prec = nothing, psetup = nothing, prec_side = 0) - if linear_solver == :Band && (jac_upper==0 || jac_lower==0) - error("Banded solver must set the jac_upper and jac_lower") - end - if !(linear_solver in (:None, :Diagonal, :Dense, :LapackDense, :Band, :LapackBand, :BCG, :GMRES, :FGMRES, :PCG, :TFQMR, :KLU)) - error("Linear solver choice not accepted.") - end - IDA{linear_solver,typeof(prec),typeof(psetup)}( - jac_upper,jac_lower,krylov_dim, - max_order, - max_error_test_failures, - nonlinear_convergence_coefficient, - max_nonlinear_iters, - max_convergence_failures, - nonlinear_convergence_coefficient_ic, - max_num_steps_ic, - max_num_jacs_ic, - max_num_iters_ic, - max_num_backs_ic, - use_linesearch_ic, - init_all,prec, psetup, prec_side) +Base.@pure function IDA(; + linear_solver = :Dense, + jac_upper = 0, + jac_lower = 0, + krylov_dim = 0, + max_order = 5, + max_error_test_failures = 7, + max_nonlinear_iters = 3, + nonlinear_convergence_coefficient = 0.33, + nonlinear_convergence_coefficient_ic = 0.0033, + max_num_steps_ic = 5, + max_num_jacs_ic = 4, + max_num_iters_ic = 10, + max_num_backs_ic = 100, + use_linesearch_ic = true, + init_all = false, + max_convergence_failures = 10, + prec = nothing, + psetup = nothing, + prec_side = 0, +) + if linear_solver == :Band && (jac_upper == 0 || jac_lower == 0) + error("Banded solver must set the jac_upper and jac_lower") + end + if !( + linear_solver in ( + :None, + :Diagonal, + :Dense, + :LapackDense, + :Band, + :LapackBand, + :BCG, + :GMRES, + :FGMRES, + :PCG, + :TFQMR, + :KLU, + ) + ) + error("Linear solver choice not accepted.") + end + IDA{linear_solver, typeof(prec), typeof(psetup)}( + jac_upper, + jac_lower, + krylov_dim, + max_order, + max_error_test_failures, + nonlinear_convergence_coefficient, + max_nonlinear_iters, + max_convergence_failures, + nonlinear_convergence_coefficient_ic, + max_num_steps_ic, + max_num_jacs_ic, + max_num_iters_ic, + max_num_backs_ic, + use_linesearch_ic, + init_all, + prec, + psetup, + prec_side, + ) end -method_choice(alg::SundialsODEAlgorithm{Method}) where Method = Method +method_choice(alg::SundialsODEAlgorithm{Method}) where {Method} = Method method_choice(alg::SundialsDAEAlgorithm) = :Newton -linear_solver(alg::SundialsODEAlgorithm{Method,LinearSolver}) where {Method,LinearSolver}= LinearSolver -linear_solver(alg::SundialsDAEAlgorithm{LinearSolver}) where LinearSolver = LinearSolver +linear_solver( + alg::SundialsODEAlgorithm{Method, LinearSolver}, +) where {Method, LinearSolver} = LinearSolver +linear_solver(alg::SundialsDAEAlgorithm{LinearSolver}) where {LinearSolver} = LinearSolver diff --git a/src/common_interface/function_types.jl b/src/common_interface/function_types.jl index 1ff8f9cd..c626e5c1 100644 --- a/src/common_interface/function_types.jl +++ b/src/common_interface/function_types.jl @@ -12,60 +12,62 @@ mutable struct FunJac{F, F2, J, P, M, J2, uType, uType2, Prec, PS} <: AbstractFu du::uType resid::uType2 end -FunJac(fun,jac,p,m,jac_prototype,prec,psetup,u,du) = FunJac(fun,nothing,jac,p,m,jac_prototype,prec,psetup,u,du,nothing) -FunJac(fun,jac,p,m,jac_prototype,prec,psetup,u,du,resid) = FunJac(fun,nothing,jac,p,m,jac_prototype,prec,psetup,u,du,resid) - -function cvodefunjac(t::Float64, - u::N_Vector, - du::N_Vector, - funjac::FunJac) - funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u),length(funjac.u)) - funjac.du = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du),length(funjac.du)) +FunJac(fun, jac, p, m, jac_prototype, prec, psetup, u, du) = + FunJac(fun, nothing, jac, p, m, jac_prototype, prec, psetup, u, du, nothing) +FunJac(fun, jac, p, m, jac_prototype, prec, psetup, u, du, resid) = + FunJac(fun, nothing, jac, p, m, jac_prototype, prec, psetup, u, du, resid) + +function cvodefunjac(t::Float64, u::N_Vector, du::N_Vector, funjac::FunJac) + funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u), length(funjac.u)) + funjac.du = + unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du), length(funjac.du)) _du = funjac.du _u = funjac.u funjac.fun(_du, _u, funjac.p, t) return CV_SUCCESS end -function cvodefunjac2(t::Float64, - u::N_Vector, - du::N_Vector, - funjac::FunJac) - funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u),length(funjac.u)) - funjac.du = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du),length(funjac.du)) +function cvodefunjac2(t::Float64, u::N_Vector, du::N_Vector, funjac::FunJac) + funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u), length(funjac.u)) + funjac.du = + unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du), length(funjac.du)) _du = funjac.du _u = funjac.u funjac.fun2(_du, _u, funjac.p, t) return CV_SUCCESS end -function cvodejac(t::realtype, - u::N_Vector, - du::N_Vector, - J::SUNMatrix, - funjac::AbstractFunJac{Nothing}, - tmp1::N_Vector, - tmp2::N_Vector, - tmp3::N_Vector) +function cvodejac( + t::realtype, + u::N_Vector, + du::N_Vector, + J::SUNMatrix, + funjac::AbstractFunJac{Nothing}, + tmp1::N_Vector, + tmp2::N_Vector, + tmp3::N_Vector, +) - funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u),length(funjac.u)) + funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u), length(funjac.u)) _u = funjac.u funjac.jac(convert(Matrix, J), _u, funjac.p, t) return CV_SUCCESS end -function cvodejac(t::realtype, - u::N_Vector, - du::N_Vector, - _J::SUNMatrix, - funjac::AbstractFunJac{<:SparseArrays.SparseMatrixCSC}, - tmp1::N_Vector, - tmp2::N_Vector, - tmp3::N_Vector) +function cvodejac( + t::realtype, + u::N_Vector, + du::N_Vector, + _J::SUNMatrix, + funjac::AbstractFunJac{<:SparseArrays.SparseMatrixCSC}, + tmp1::N_Vector, + tmp2::N_Vector, + tmp3::N_Vector, +) jac_prototype = funjac.jac_prototype - J = convert(SparseArrays.SparseMatrixCSC,_J) + J = convert(SparseArrays.SparseMatrixCSC, _J) - funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u),length(funjac.u)) + funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u), length(funjac.u)) _u = funjac.u funjac.jac(jac_prototype, _u, funjac.p, t) @@ -77,154 +79,202 @@ function cvodejac(t::realtype, end function idasolfun(t::Float64, u::N_Vector, du::N_Vector, resid::N_Vector, funjac::FunJac) - funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u),length(funjac.u)) + funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u), length(funjac.u)) _u = funjac.u - funjac.du = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du),length(funjac.du)) + funjac.du = + unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du), length(funjac.du)) _du = funjac.du - funjac.resid = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(resid),length(funjac.resid)) + funjac.resid = + unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(resid), length(funjac.resid)) _resid = funjac.resid funjac.fun(_resid, _du, _u, funjac.p, t) return IDA_SUCCESS end -function idajac(t::realtype, - cj::realtype, - u::N_Vector, - du::N_Vector, - res::N_Vector, - J::SUNMatrix, - funjac::AbstractFunJac{Nothing}, - tmp1::N_Vector, - tmp2::N_Vector, - tmp3::N_Vector) - +function idajac( + t::realtype, + cj::realtype, + u::N_Vector, + du::N_Vector, + res::N_Vector, + J::SUNMatrix, + funjac::AbstractFunJac{Nothing}, + tmp1::N_Vector, + tmp2::N_Vector, + tmp3::N_Vector, +) - funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u),length(funjac.u)) + funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u), length(funjac.u)) _u = funjac.u - funjac.du = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du),length(funjac.du)) + funjac.du = + unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du), length(funjac.du)) _du = funjac.du - funjac.jac(convert(Matrix, J), _du, - _u, funjac.p, cj, t) + funjac.jac(convert(Matrix, J), _du, _u, funjac.p, cj, t) return IDA_SUCCESS end -function idajac(t::realtype, - cj::realtype, - u::N_Vector, - du::N_Vector, - res::N_Vector, - _J::SUNMatrix, - funjac::AbstractFunJac{<:SparseArrays.SparseMatrixCSC}, - tmp1::N_Vector, - tmp2::N_Vector, - tmp3::N_Vector) - - jac_prototype = funjac.jac_prototype - J = convert(SparseArrays.SparseMatrixCSC,_J) - - funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u),length(funjac.u)) - _u = funjac.u - funjac.du = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du),length(funjac.du)) - _du = funjac.du - - funjac.jac(jac_prototype, _du, convert(Vector, _u), funjac.p, cj, t) - J.nzval .= jac_prototype.nzval - # Sundials resets the value pointers each time, so reset it too - @. J.rowval = jac_prototype.rowval - 1 - @. J.colptr = jac_prototype.colptr - 1 - - return IDA_SUCCESS +function idajac( + t::realtype, + cj::realtype, + u::N_Vector, + du::N_Vector, + res::N_Vector, + _J::SUNMatrix, + funjac::AbstractFunJac{<:SparseArrays.SparseMatrixCSC}, + tmp1::N_Vector, + tmp2::N_Vector, + tmp3::N_Vector, +) + + jac_prototype = funjac.jac_prototype + J = convert(SparseArrays.SparseMatrixCSC, _J) + + funjac.u = unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(u), length(funjac.u)) + _u = funjac.u + funjac.du = + unsafe_wrap(Vector{Float64}, N_VGetArrayPointer_Serial(du), length(funjac.du)) + _du = funjac.du + + funjac.jac(jac_prototype, _du, convert(Vector, _u), funjac.p, cj, t) + J.nzval .= jac_prototype.nzval + # Sundials resets the value pointers each time, so reset it too + @. J.rowval = jac_prototype.rowval - 1 + @. J.colptr = jac_prototype.colptr - 1 + + return IDA_SUCCESS end -function massmat(t::Float64, - _M::SUNMatrix, - mmf::AbstractFunJac, - tmp1::N_Vector, - tmp2::N_Vector, - tmp3::N_Vector) - if typeof(mmf.mass_matrix) <: Array - M = convert(Matrix, _M) - else - M = convert(SparseArrays.SparseMatrixCSC, _M) - end - M .= mmf.mass_matrix - - return IDA_SUCCESS +function massmat( + t::Float64, + _M::SUNMatrix, + mmf::AbstractFunJac, + tmp1::N_Vector, + tmp2::N_Vector, + tmp3::N_Vector, +) + if typeof(mmf.mass_matrix) <: Array + M = convert(Matrix, _M) + else + M = convert(SparseArrays.SparseMatrixCSC, _M) + end + M .= mmf.mass_matrix + + return IDA_SUCCESS end -function jactimes(v::N_Vector, - Jv::N_Vector, - t::Float64, - y::N_Vector, - fy::N_Vector, - fj::AbstractFunJac, - tmp::N_Vector) - DiffEqBase.update_coefficients!(fj.jac_prototype,y,fj.p,t) - LinearAlgebra.mul!(convert(Vector,Jv),fj.jac_prototype,convert(Vector,v)) +function jactimes( + v::N_Vector, + Jv::N_Vector, + t::Float64, + y::N_Vector, + fy::N_Vector, + fj::AbstractFunJac, + tmp::N_Vector, +) + DiffEqBase.update_coefficients!(fj.jac_prototype, y, fj.p, t) + LinearAlgebra.mul!(convert(Vector, Jv), fj.jac_prototype, convert(Vector, v)) return CV_SUCCESS end function idajactimes( - t::Float64, - y::N_Vector, - fy::N_Vector, - r::N_Vector, - v::N_Vector, - Jv::N_Vector, - cj::Float64, - fj::AbstractFunJac, - tmp1::N_Vector, - tmp2::N_Vector) - DiffEqBase.update_coefficients!(fj.jac_prototype,y,fj.p,t) - LinearAlgebra.mul!(convert(Vector,Jv),fj.jac_prototype,convert(Vector,v)) + t::Float64, + y::N_Vector, + fy::N_Vector, + r::N_Vector, + v::N_Vector, + Jv::N_Vector, + cj::Float64, + fj::AbstractFunJac, + tmp1::N_Vector, + tmp2::N_Vector, +) + DiffEqBase.update_coefficients!(fj.jac_prototype, y, fj.p, t) + LinearAlgebra.mul!(convert(Vector, Jv), fj.jac_prototype, convert(Vector, v)) return IDA_SUCCESS end -function precsolve(t::Float64, - y::N_Vector, - fy::N_Vector, - r::N_Vector, - z::N_Vector, - gamma::Float64, - delta::Float64, - lr::Int, - fj::AbstractFunJac) - fj.prec(convert(Vector,z),convert(Vector,r),fj.p,t,convert(Vector,y),convert(Vector,fy),gamma,delta,lr) +function precsolve( + t::Float64, + y::N_Vector, + fy::N_Vector, + r::N_Vector, + z::N_Vector, + gamma::Float64, + delta::Float64, + lr::Int, + fj::AbstractFunJac, +) + fj.prec( + convert(Vector, z), + convert(Vector, r), + fj.p, + t, + convert(Vector, y), + convert(Vector, fy), + gamma, + delta, + lr, + ) return CV_SUCCESS end -function precsetup(t::Float64, - y::N_Vector, - fy::N_Vector, - jok::Int, - jcurPtr::Ref{Int}, - gamma::Float64, - fj::AbstractFunJac) - fj.psetup(fj.p,t,convert(Vector,y),convert(Vector,fy),jok==1,Base.unsafe_wrap(Vector{Int}, jcurPtr, 1),gamma) +function precsetup( + t::Float64, + y::N_Vector, + fy::N_Vector, + jok::Int, + jcurPtr::Ref{Int}, + gamma::Float64, + fj::AbstractFunJac, +) + fj.psetup( + fj.p, + t, + convert(Vector, y), + convert(Vector, fy), + jok == 1, + Base.unsafe_wrap(Vector{Int}, jcurPtr, 1), + gamma, + ) return CV_SUCCESS end -function idaprecsolve(t::Float64, - y::N_Vector, - fy::N_Vector, - resid::N_Vector, - r::N_Vector, - z::N_Vector, - gamma::Float64, - delta::Float64, - lr::Int, - fj::AbstractFunJac) - fj.prec(convert(Vector,z),convert(Vector,r),fj.p,t,convert(Vector,y),convert(Vector,fy),convert(Vector,resid),gamma,delta,lr) +function idaprecsolve( + t::Float64, + y::N_Vector, + fy::N_Vector, + resid::N_Vector, + r::N_Vector, + z::N_Vector, + gamma::Float64, + delta::Float64, + lr::Int, + fj::AbstractFunJac, +) + fj.prec( + convert(Vector, z), + convert(Vector, r), + fj.p, + t, + convert(Vector, y), + convert(Vector, fy), + convert(Vector, resid), + gamma, + delta, + lr, + ) return IDA_SUCCESS end -function idaprecsetup(t::Float64, - y::N_Vector, - fy::N_Vector, - rr::N_Vector, - gamma::Float64, - fj::AbstractFunJac) - fj.psetup(fj.p,t,convert(Vector,rr),convert(Vector,y),convert(Vector,fy),gamma) +function idaprecsetup( + t::Float64, + y::N_Vector, + fy::N_Vector, + rr::N_Vector, + gamma::Float64, + fj::AbstractFunJac, +) + fj.psetup(fj.p, t, convert(Vector, rr), convert(Vector, y), convert(Vector, fy), gamma) return IDA_SUCCESS end diff --git a/src/common_interface/integrator_types.jl b/src/common_interface/integrator_types.jl index afe14c76..3db36676 100644 --- a/src/common_interface/integrator_types.jl +++ b/src/common_interface/integrator_types.jl @@ -1,4 +1,4 @@ -mutable struct DEOptions{SType,TstopType,CType,reltolType,abstolType,F5} +mutable struct DEOptions{SType, TstopType, CType, reltolType, abstolType, F5} saveat::SType tstops::TstopType save_everystep::Bool @@ -19,9 +19,26 @@ mutable struct DEOptions{SType,TstopType,CType,reltolType,abstolType,F5} maxiters::Int end -abstract type AbstractSundialsIntegrator{algType} <: DiffEqBase.AbstractODEIntegrator{algType,true,Vector{Float64},Float64} end +abstract type AbstractSundialsIntegrator{algType} <: + DiffEqBase.AbstractODEIntegrator{algType, true, Vector{Float64}, Float64} end -mutable struct CVODEIntegrator{uType,pType,memType,solType,algType,fType,UFType,JType,oType,toutType,sizeType,tmpType,LStype,Atype,CallbackCacheType} <: AbstractSundialsIntegrator{algType} +mutable struct CVODEIntegrator{ + uType, + pType, + memType, + solType, + algType, + fType, + UFType, + JType, + oType, + toutType, + sizeType, + tmpType, + LStype, + Atype, + CallbackCacheType, +} <: AbstractSundialsIntegrator{algType} u::uType p::pType t::Float64 @@ -49,18 +66,45 @@ mutable struct CVODEIntegrator{uType,pType,memType,solType,algType,fType,UFType, last_event_error::Float64 end -function (integrator::CVODEIntegrator)(t::Number,deriv::Type{Val{T}}=Val{0};idxs=nothing) where T +function (integrator::CVODEIntegrator)( + t::Number, + deriv::Type{Val{T}} = Val{0}; + idxs = nothing, +) where {T} out = similar(integrator.u) integrator.flag = @checkflag CVodeGetDky(integrator.mem, t, Cint(T), out) return idxs == nothing ? out : out[idxs] end -function (integrator::CVODEIntegrator)(out,t::Number,deriv::Type{Val{T}}=Val{0};idxs=nothing) where T +function (integrator::CVODEIntegrator)( + out, + t::Number, + deriv::Type{Val{T}} = Val{0}; + idxs = nothing, +) where {T} integrator.flag = @checkflag CVodeGetDky(integrator.mem, t, Cint(T), out) return idxs == nothing ? out : @view out[idxs] end -mutable struct ARKODEIntegrator{uType,pType,memType,solType,algType,fType,UFType,JType,oType,toutType,sizeType,tmpType,LStype,Atype,MLStype,Mtype,CallbackCacheType} <: AbstractSundialsIntegrator{ARKODE} +mutable struct ARKODEIntegrator{ + uType, + pType, + memType, + solType, + algType, + fType, + UFType, + JType, + oType, + toutType, + sizeType, + tmpType, + LStype, + Atype, + MLStype, + Mtype, + CallbackCacheType, +} <: AbstractSundialsIntegrator{ARKODE} u::uType p::pType t::Float64 @@ -90,18 +134,45 @@ mutable struct ARKODEIntegrator{uType,pType,memType,solType,algType,fType,UFType last_event_error::Float64 end -function (integrator::ARKODEIntegrator)(t::Number,deriv::Type{Val{T}}=Val{0};idxs=nothing) where T +function (integrator::ARKODEIntegrator)( + t::Number, + deriv::Type{Val{T}} = Val{0}; + idxs = nothing, +) where {T} out = similar(integrator.u) integrator.flag = @checkflag ARKStepGetDky(integrator.mem, t, Cint(T), out) return idxs == nothing ? out : out[idxs] end -function (integrator::ARKODEIntegrator)(out,t::Number,deriv::Type{Val{T}}=Val{0};idxs=nothing) where T +function (integrator::ARKODEIntegrator)( + out, + t::Number, + deriv::Type{Val{T}} = Val{0}; + idxs = nothing, +) where {T} integrator.flag = @checkflag ARKStepGetDky(integrator.mem, t, Cint(T), out) return idxs == nothing ? out : @view out[idxs] end -mutable struct IDAIntegrator{uType,duType,pType,memType,solType,algType,fType,UFType,JType,oType,toutType,sizeType,sizeDType,tmpType,LStype,Atype,CallbackCacheType} <: AbstractSundialsIntegrator{IDA} +mutable struct IDAIntegrator{ + uType, + duType, + pType, + memType, + solType, + algType, + fType, + UFType, + JType, + oType, + toutType, + sizeType, + sizeDType, + tmpType, + LStype, + Atype, + CallbackCacheType, +} <: AbstractSundialsIntegrator{IDA} u::uType du::duType p::pType @@ -131,13 +202,22 @@ mutable struct IDAIntegrator{uType,duType,pType,memType,solType,algType,fType,UF last_event_error::Float64 end -function (integrator::IDAIntegrator)(t::Number,deriv::Type{Val{T}}=Val{0};idxs=nothing) where T +function (integrator::IDAIntegrator)( + t::Number, + deriv::Type{Val{T}} = Val{0}; + idxs = nothing, +) where {T} out = similar(integrator.u) integrator.flag = @checkflag IDAGetDky(integrator.mem, t, Cint(T), out) return idxs == nothing ? out : out[idxs] end -function (integrator::IDAIntegrator)(out,t::Number,deriv::Type{Val{T}}=Val{0};idxs=nothing) where T +function (integrator::IDAIntegrator)( + out, + t::Number, + deriv::Type{Val{T}} = Val{0}; + idxs = nothing, +) where {T} integrator.flag = @checkflag IDAGetDky(integrator.mem, t, Cint(T), out) return idxs == nothing ? out : @view out[idxs] end @@ -154,38 +234,38 @@ DiffEqBase.postamble!(integrator::AbstractSundialsIntegrator) = nothing ### Iterator interface @inline function DiffEqBase.step!(integrator::AbstractSundialsIntegrator) - if integrator.opts.advance_to_tstop - # The call to first is an overload of Base.first implemented in DataStructures - while integrator.tdir*(integrator.t-first(integrator.opts.tstops)) < -1e6eps() - tstop = first(integrator.opts.tstops) - set_stop_time(integrator,tstop) + if integrator.opts.advance_to_tstop + # The call to first is an overload of Base.first implemented in DataStructures + while integrator.tdir * (integrator.t - first(integrator.opts.tstops)) < -1e6eps() + tstop = first(integrator.opts.tstops) + set_stop_time(integrator, tstop) + integrator.tprev = integrator.t + if !(typeof(integrator.opts.callback.continuous_callbacks) <: Tuple{}) + integrator.uprev .= integrator.u + end + solver_step(integrator, tstop) + integrator.t = first(integrator.tout) + DiffEqBase.check_error!(integrator) != :Success && return + handle_callbacks!(integrator) + DiffEqBase.check_error!(integrator) != :Success && return + end + else integrator.tprev = integrator.t - if !(typeof(integrator.opts.callback.continuous_callbacks)<:Tuple{}) + if !(typeof(integrator.opts.callback.continuous_callbacks) <: Tuple{}) integrator.uprev .= integrator.u end - solver_step(integrator,tstop) + if !isempty(integrator.opts.tstops) + tstop = first(integrator.opts.tstops) + set_stop_time(integrator, tstop) + solver_step(integrator, tstop) + else + solver_step(integrator, 1.0) # fake tstop + end integrator.t = first(integrator.tout) DiffEqBase.check_error!(integrator) != :Success && return handle_callbacks!(integrator) DiffEqBase.check_error!(integrator) != :Success && return end - else - integrator.tprev = integrator.t - if !(typeof(integrator.opts.callback.continuous_callbacks)<:Tuple{}) - integrator.uprev .= integrator.u - end - if !isempty(integrator.opts.tstops) - tstop = first(integrator.opts.tstops) - set_stop_time(integrator,tstop) - solver_step(integrator,tstop) - else - solver_step(integrator,1.0) # fake tstop - end - integrator.t = first(integrator.tout) - DiffEqBase.check_error!(integrator) != :Success && return - handle_callbacks!(integrator) - DiffEqBase.check_error!(integrator) != :Success && return - end - handle_tstop!(integrator) - nothing + handle_tstop!(integrator) + nothing end diff --git a/src/common_interface/integrator_utils.jl b/src/common_interface/integrator_utils.jl index c8561ead..52271c9f 100644 --- a/src/common_interface/integrator_utils.jl +++ b/src/common_interface/integrator_utils.jl @@ -1,175 +1,212 @@ function handle_callbacks!(integrator) - discrete_callbacks = integrator.opts.callback.discrete_callbacks - continuous_callbacks = integrator.opts.callback.continuous_callbacks - atleast_one_callback = false - - continuous_modified = false - discrete_modified = false - saved_in_cb = false - if !(typeof(continuous_callbacks)<:Tuple{}) - time,upcrossing,event_occured,event_idx,idx,counter = - DiffEqBase.find_first_continuous_callback(integrator,continuous_callbacks...) - if event_occured - integrator.event_last_time = idx - integrator.vector_event_last_time = event_idx - continuous_modified,saved_in_cb = DiffEqBase.apply_callback!(integrator,continuous_callbacks[idx],time,upcrossing,event_idx) - else - integrator.event_last_time = 0 - integrator.vector_event_last_time = 1 + discrete_callbacks = integrator.opts.callback.discrete_callbacks + continuous_callbacks = integrator.opts.callback.continuous_callbacks + atleast_one_callback = false + + continuous_modified = false + discrete_modified = false + saved_in_cb = false + if !(typeof(continuous_callbacks) <: Tuple{}) + time, upcrossing, event_occured, event_idx, idx, counter = + DiffEqBase.find_first_continuous_callback(integrator, continuous_callbacks...) + if event_occured + integrator.event_last_time = idx + integrator.vector_event_last_time = event_idx + continuous_modified, saved_in_cb = DiffEqBase.apply_callback!( + integrator, + continuous_callbacks[idx], + time, + upcrossing, + event_idx, + ) + else + integrator.event_last_time = 0 + integrator.vector_event_last_time = 1 + end end - end - if !(typeof(discrete_callbacks)<:Tuple{}) - discrete_modified,saved_in_cb = DiffEqBase.apply_discrete_callback!(integrator,discrete_callbacks...) - end - - integrator.u_modified = continuous_modified || discrete_modified - if integrator.u_modified - handle_callback_modifiers!(integrator) - end - - if !saved_in_cb - savevalues!(integrator) - end - - integrator.u_modified = false -end - -function DiffEqBase.savevalues!(integrator::AbstractSundialsIntegrator,force_save=false)::Tuple{Bool,Bool} - saved, savedexactly = false, false - !integrator.opts.save_on && return saved, savedexactly - uType = eltype(integrator.sol.u) - # The call to first is an overload of Base.first implemented in DataStructures - while !isempty(integrator.opts.saveat) && - integrator.tdir*first(integrator.opts.saveat) < integrator.tdir*integrator.t - saved = true - curt = pop!(integrator.opts.saveat) - - tmp = integrator(curt) - save_value!(integrator.sol.u,tmp,uType,integrator.sizeu,Val{false}) - push!(integrator.sol.t,curt) - if integrator.opts.dense - tmp = integrator(curt,Val{1}) - save_value!(integrator.sol.interp.du,tmp,uType,integrator.sizeu,Val{false}) + if !(typeof(discrete_callbacks) <: Tuple{}) + discrete_modified, saved_in_cb = + DiffEqBase.apply_discrete_callback!(integrator, discrete_callbacks...) end - end - - if integrator.opts.save_everystep || force_save - saved = true - save_value!(integrator.sol.u,integrator.u,uType,integrator.sizeu) - push!(integrator.sol.t, integrator.t) - if integrator.opts.dense - tmp = integrator(integrator.t,Val{1}) - save_value!(integrator.sol.interp.du,tmp,uType,integrator.sizeu) + + integrator.u_modified = continuous_modified || discrete_modified + if integrator.u_modified + handle_callback_modifiers!(integrator) end - end - savedexactly = !isempty(integrator.sol.t) && last(integrator.sol.t) == integrator.t - return saved, savedexactly -end -function save_value!(save_array,val,::Type{T},sizeu, - make_copy::Type{Val{bool}}=Val{true}) where {T <: Number,bool} - push!(save_array,first(val)) -end -function save_value!(save_array,val,::Type{T},sizeu, - make_copy::Type{Val{bool}}=Val{true}) where {T <: Vector,bool} + if !saved_in_cb + savevalues!(integrator) + end + + integrator.u_modified = false +end + +function DiffEqBase.savevalues!( + integrator::AbstractSundialsIntegrator, + force_save = false, +)::Tuple{Bool, Bool} + saved, savedexactly = false, false + !integrator.opts.save_on && return saved, savedexactly + uType = eltype(integrator.sol.u) + # The call to first is an overload of Base.first implemented in DataStructures + while !isempty(integrator.opts.saveat) && + integrator.tdir * first(integrator.opts.saveat) < integrator.tdir * integrator.t + saved = true + curt = pop!(integrator.opts.saveat) + + tmp = integrator(curt) + save_value!(integrator.sol.u, tmp, uType, integrator.sizeu, Val{false}) + push!(integrator.sol.t, curt) + if integrator.opts.dense + tmp = integrator(curt, Val{1}) + save_value!(integrator.sol.interp.du, tmp, uType, integrator.sizeu, Val{false}) + end + end + + if integrator.opts.save_everystep || force_save + saved = true + save_value!(integrator.sol.u, integrator.u, uType, integrator.sizeu) + push!(integrator.sol.t, integrator.t) + if integrator.opts.dense + tmp = integrator(integrator.t, Val{1}) + save_value!(integrator.sol.interp.du, tmp, uType, integrator.sizeu) + end + end + savedexactly = !isempty(integrator.sol.t) && last(integrator.sol.t) == integrator.t + return saved, savedexactly +end + +function save_value!( + save_array, + val, + ::Type{T}, + sizeu, + make_copy::Type{Val{bool}} = Val{true}, +) where {T <: Number, bool} + push!(save_array, first(val)) +end +function save_value!( + save_array, + val, + ::Type{T}, + sizeu, + make_copy::Type{Val{bool}} = Val{true}, +) where {T <: Vector, bool} bool ? save = copy(val) : save = val - push!(save_array,save) -end -function save_value!(save_array,val,::Type{T},sizeu, - make_copy::Type{Val{bool}}=Val{true}) where {T <: Array,bool} + push!(save_array, save) +end +function save_value!( + save_array, + val, + ::Type{T}, + sizeu, + make_copy::Type{Val{bool}} = Val{true}, +) where {T <: Array, bool} bool ? save = copy(val) : save = val - push!(save_array,reshape(save,sizeu)) -end -function save_value!(save_array,val,::Type{T},sizeu, - make_copy::Type{Val{bool}}=Val{true}) where {T <: AbstractArray,bool} + push!(save_array, reshape(save, sizeu)) +end +function save_value!( + save_array, + val, + ::Type{T}, + sizeu, + make_copy::Type{Val{bool}} = Val{true}, +) where {T <: AbstractArray, bool} bool ? save = copy(val) : save = val - push!(save_array,convert(T,reshape(save,sizeu))) + push!(save_array, convert(T, reshape(save, sizeu))) end function handle_callback_modifiers!(integrator::CVODEIntegrator) - CVodeReInit(integrator.mem,integrator.t,integrator.u) + CVodeReInit(integrator.mem, integrator.t, integrator.u) end function handle_callback_modifiers!(integrator::ARKODEIntegrator) - ARKStepReInit(integrator.mem,integrator.t,integrator.u) + ARKStepReInit(integrator.mem, integrator.t, integrator.u) end function handle_callback_modifiers!(integrator::IDAIntegrator) - IDAReInit(integrator.mem,integrator.t,integrator.u,integrator.du) - DiffEqBase.initialize_dae!(integrator) + IDAReInit(integrator.mem, integrator.t, integrator.u, integrator.du) + DiffEqBase.initialize_dae!(integrator) end -function DiffEqBase.add_tstop!(integrator::AbstractSundialsIntegrator,t) - t < integrator.t && error("Tried to add a tstop that is behind the current time. This is strictly forbidden") - push!(integrator.opts.tstops,t) +function DiffEqBase.add_tstop!(integrator::AbstractSundialsIntegrator, t) + t < integrator.t && + error("Tried to add a tstop that is behind the current time. This is strictly forbidden") + push!(integrator.opts.tstops, t) end -function DiffEqBase.add_saveat!(integrator::AbstractSundialsIntegrator,t) - integrator.tdir * (t - integrator.t) < 0 && error("Tried to add a saveat that is behind the current time. This is strictly forbidden") - push!(integrator.opts.saveat,t) +function DiffEqBase.add_saveat!(integrator::AbstractSundialsIntegrator, t) + integrator.tdir * (t - integrator.t) < 0 && + error("Tried to add a saveat that is behind the current time. This is strictly forbidden") + push!(integrator.opts.saveat, t) end DiffEqBase.get_tmp_cache(integrator::AbstractSundialsIntegrator) = (integrator.tmp,) -@inline function DiffEqBase.u_modified!(integrator::AbstractSundialsIntegrator,bool::Bool) - integrator.u_modified = bool +@inline function DiffEqBase.u_modified!(integrator::AbstractSundialsIntegrator, bool::Bool) + integrator.u_modified = bool end -function DiffEqBase.terminate!(integrator::AbstractSundialsIntegrator, - retcode = :Terminated) - integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, retcode) - integrator.opts.tstops.valtree = typeof(integrator.opts.tstops.valtree)() +function DiffEqBase.terminate!( + integrator::AbstractSundialsIntegrator, + retcode = :Terminated, +) + integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, retcode) + integrator.opts.tstops.valtree = typeof(integrator.opts.tstops.valtree)() end @inline function DiffEqBase.get_du(integrator::CVODEIntegrator) - integrator(integrator.t,Val{1}) + integrator(integrator.t, Val{1}) end -@inline function DiffEqBase.get_du!(out,integrator::CVODEIntegrator) - integrator(out,integrator.t,Val{1}) +@inline function DiffEqBase.get_du!(out, integrator::CVODEIntegrator) + integrator(out, integrator.t, Val{1}) end @inline function DiffEqBase.get_du(integrator::IDAIntegrator) - reshape(integrator.du,integrator.sizedu) + reshape(integrator.du, integrator.sizedu) end -@inline function DiffEqBase.get_du!(out,integrator::IDAIntegrator) - out .= reshape(integrator.du,integrator.sizedu) +@inline function DiffEqBase.get_du!(out, integrator::IDAIntegrator) + out .= reshape(integrator.du, integrator.sizedu) end -function DiffEqBase.change_t_via_interpolation!(integrator::AbstractSundialsIntegrator,t) +function DiffEqBase.change_t_via_interpolation!(integrator::AbstractSundialsIntegrator, t) integrator.t = t - integrator(integrator.u,integrator.t) + integrator(integrator.u, integrator.t) return nothing end @inline function Base.getproperty(integrator::AbstractSundialsIntegrator, sym::Symbol) - if sym == :dt - return integrator.t-integrator.tprev - else - return getfield(integrator, sym) - end + if sym == :dt + return integrator.t - integrator.tprev + else + return getfield(integrator, sym) + end end -DiffEqBase.reeval_internals_due_to_modification!(integrator::AbstractSundialsIntegrator) = nothing -DiffEqBase.reeval_internals_due_to_modification!(integrator::IDAIntegrator) = handle_callback_modifiers!(integrator::IDAIntegrator) +DiffEqBase.reeval_internals_due_to_modification!(integrator::AbstractSundialsIntegrator) = + nothing +DiffEqBase.reeval_internals_due_to_modification!(integrator::IDAIntegrator) = + handle_callback_modifiers!(integrator::IDAIntegrator) # Required for callbacks -DiffEqBase.set_proposed_dt!(i::AbstractSundialsIntegrator,dt) = nothing +DiffEqBase.set_proposed_dt!(i::AbstractSundialsIntegrator, dt) = nothing DiffEqBase.initialize_dae!(integrator::AbstractSundialsIntegrator) = nothing function DiffEqBase.initialize_dae!(integrator::IDAIntegrator) - integrator.f(integrator.tmp, integrator.du, integrator.u, integrator.p, integrator.t) - if any(abs.(integrator.tmp) .>= integrator.opts.reltol) - if integrator.sol.prob.differential_vars === nothing && !integrator.alg.init_all - error("Must supply differential_vars argument to DAEProblem constructor to use IDA initial value solver.") - end - if integrator.alg.init_all - init_type = IDA_Y_INIT - else - init_type = IDA_YA_YDP_INIT - integrator.flag = IDASetId(integrator.mem, integrator.sol.prob.differential_vars) - end - integrator.flag = IDACalcIC(integrator.mem, init_type, integrator.dt) - end + integrator.f(integrator.tmp, integrator.du, integrator.u, integrator.p, integrator.t) + if any(abs.(integrator.tmp) .>= integrator.opts.reltol) + if integrator.sol.prob.differential_vars === nothing && !integrator.alg.init_all + error("Must supply differential_vars argument to DAEProblem constructor to use IDA initial value solver.") + end + if integrator.alg.init_all + init_type = IDA_Y_INIT + else + init_type = IDA_YA_YDP_INIT + integrator.flag = + IDASetId(integrator.mem, integrator.sol.prob.differential_vars) + end + integrator.flag = IDACalcIC(integrator.mem, init_type, integrator.dt) + end end diff --git a/src/common_interface/solve.jl b/src/common_interface/solve.jl index 69ed5c10..18ce55dc 100644 --- a/src/common_interface/solve.jl +++ b/src/common_interface/solve.jl @@ -1,43 +1,57 @@ ## Common Interface Solve Functions function DiffEqBase.__solve( - prob::Union{DiffEqBase.AbstractODEProblem,DiffEqBase.AbstractDAEProblem}, - alg::algType,timeseries=[],ts=[],ks=[], - recompile::Type{Val{recompile_flag}}=Val{true}; - kwargs...) where {algType<:Union{SundialsODEAlgorithm,SundialsDAEAlgorithm}, - recompile_flag} - - integrator = DiffEqBase.__init(prob,alg,timeseries,ts,ks;kwargs...) - if integrator.sol.retcode == :Default - solve!(integrator) - end - integrator.sol + prob::Union{DiffEqBase.AbstractODEProblem, DiffEqBase.AbstractDAEProblem}, + alg::algType, + timeseries = [], + ts = [], + ks = [], + recompile::Type{Val{recompile_flag}} = Val{true}; + kwargs..., +) where {algType <: Union{SundialsODEAlgorithm, SundialsDAEAlgorithm}, recompile_flag} + + integrator = DiffEqBase.__init(prob, alg, timeseries, ts, ks; kwargs...) + if integrator.sol.retcode == :Default + solve!(integrator) + end + integrator.sol end function DiffEqBase.__init( prob::DiffEqBase.AbstractODEProblem{uType, tupType, isinplace}, - alg::SundialsODEAlgorithm{Method,LinearSolver}, - timeseries=[], ts=[], ks=[]; - - verbose=true, - callback=nothing, abstol=1/10^6, reltol=1/10^3, - saveat=Float64[], tstops=Float64[], - maxiters=Int(1e5), - dt = nothing, dtmin = 0.0, dtmax = 0.0, - timeseries_errors=true, + alg::SundialsODEAlgorithm{Method, LinearSolver}, + timeseries = [], + ts = [], + ks = []; + verbose = true, + callback = nothing, + abstol = 1 / 10^6, + reltol = 1 / 10^3, + saveat = Float64[], + tstops = Float64[], + maxiters = Int(1e5), + dt = nothing, + dtmin = 0.0, + dtmax = 0.0, + timeseries_errors = true, dense_errors = false, - save_everystep=isempty(saveat), + save_everystep = isempty(saveat), save_on = true, - save_start = save_everystep || isempty(saveat) || typeof(saveat) <: Number ? true : prob.tspan[1] in saveat, - save_end = save_everystep || isempty(saveat) || typeof(saveat) <: Number ? true : prob.tspan[2] in saveat, + save_start = save_everystep || isempty(saveat) || typeof(saveat) <: Number ? true : + prob.tspan[1] in saveat, + save_end = save_everystep || isempty(saveat) || typeof(saveat) <: Number ? true : + prob.tspan[2] in saveat, dense = save_everystep && isempty(saveat), - progress=false,progress_name="ODE", + progress = false, + progress_name = "ODE", progress_message = DiffEqBase.ODE_DEFAULT_PROG_MESSAGE, save_timeseries = nothing, - advance_to_tstop = false,stop_at_next_tstop=false, - userdata=nothing, - alias_u0=false, - kwargs...) where {uType, tupType, isinplace, Method, LinearSolver} + advance_to_tstop = false, + stop_at_next_tstop = false, + userdata = nothing, + alias_u0 = false, + kwargs..., +) where {uType, tupType, isinplace, Method, LinearSolver} tType = eltype(tupType) @@ -54,24 +68,24 @@ function DiffEqBase.__init( error("Sundials only allows scalar reltol.") end - progress && Logging.@logmsg(-1,progress_name,_id=_id = :Sundials,progress=0) + progress && Logging.@logmsg(-1, progress_name, _id = _id = :Sundials, progress = 0) callbacks_internal = DiffEqBase.CallbackSet(callback) max_len_cb = DiffEqBase.max_vector_callback_length(callbacks_internal) if max_len_cb isa VectorContinuousCallback - callback_cache = DiffEqBase.CallbackCache(max_len_cb.len,Float64,Float64) + callback_cache = DiffEqBase.CallbackCache(max_len_cb.len, Float64, Float64) else - callback_cache = nothing + callback_cache = nothing end tspan = prob.tspan t0 = tspan[1] - tdir = sign(tspan[2]-tspan[1]) + tdir = sign(tspan[2] - tspan[1]) tstops_internal, saveat_internal = - tstop_saveat_disc_handling(tstops,saveat,tdir,tspan,tType) + tstop_saveat_disc_handling(tstops, saveat, tdir, tspan, tType) if typeof(prob.u0) <: Number u0 = [prob.u0] @@ -86,22 +100,23 @@ function DiffEqBase.__init( sizeu = size(prob.u0) ### Fix the more general function to Sundials allowed style - if !isinplace && typeof(prob.u0)<:Number + if !isinplace && typeof(prob.u0) <: Number f! = (du, u, p, t) -> (du .= prob.f(first(u), p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:Vector{Float64} + elseif !isinplace && typeof(prob.u0) <: Vector{Float64} f! = (du, u, p, t) -> (du .= prob.f(u, p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:AbstractArray + elseif !isinplace && typeof(prob.u0) <: AbstractArray f! = (du, u, p, t) -> (du .= vec(prob.f(reshape(u, sizeu), p, t)); Cint(0)) - elseif typeof(prob.u0)<:Vector{Float64} + elseif typeof(prob.u0) <: Vector{Float64} f! = prob.f else # Then it's an in-place function on an abstract array f! = (du, u, p, t) -> (prob.f(reshape(du, sizeu), reshape(u, sizeu), p, t); - du=vec(du); 0) + du = vec(du); + 0) end if typeof(alg) <: CVODE_BDF alg_code = CV_BDF - elseif typeof(alg) <: CVODE_Adams + elseif typeof(alg) <: CVODE_Adams alg_code = CV_ADAMS end @@ -115,11 +130,13 @@ function DiffEqBase.__init( (mem_ptr == C_NULL) && error("Failed to allocate CVODE solver object") mem = Handle(mem_ptr) - !verbose && CVodeSetErrHandlerFn(mem,@cfunction(null_error_handler, Nothing, - (Cint, Char, - Char, Ptr{Cvoid})),C_NULL) + !verbose && CVodeSetErrHandlerFn( + mem, + @cfunction(null_error_handler, Nothing, (Cint, Char, Char, Ptr{Cvoid})), + C_NULL, + ) - ures = Vector{uType}() + ures = Vector{uType}() dures = Vector{uType}() save_start ? ts = [t0] : ts = Float64[] @@ -127,14 +144,23 @@ function DiffEqBase.__init( _u0 = copy(u0) utmp = NVector(_u0) - userfun = FunJac(f!,prob.f.jac,prob.p,nothing,prob.f.jac_prototype,alg.prec,alg.psetup,u0,_u0) - - function getcfunf(::T) where T + userfun = FunJac( + f!, + prob.f.jac, + prob.p, + nothing, + prob.f.jac_prototype, + alg.prec, + alg.psetup, + u0, + _u0, + ) + + function getcfunf(::T) where {T} @cfunction(cvodefunjac, Cint, (realtype, N_Vector, N_Vector, Ref{T})) end - flag = CVodeInit(mem,getcfunf(userfun), - t0, convert(N_Vector, utmp)) + flag = CVodeInit(mem, getcfunf(userfun), t0, convert(N_Vector, utmp)) dt != nothing && (flag = CVodeSetInitStep(mem, dt)) flag = CVodeSetMinStep(mem, dtmin) @@ -158,25 +184,25 @@ function DiffEqBase.__init( if Method == :Newton # Only use a linear solver if it's a Newton-based method if LinearSolver in (:Dense, :LapackDense) nojacobian = false - A = SUNDenseMatrix(length(u0),length(u0)) - _A = MatrixHandle(A,DenseMatrix()) + A = SUNDenseMatrix(length(u0), length(u0)) + _A = MatrixHandle(A, DenseMatrix()) if LinearSolver === :Dense - LS = SUNLinSol_Dense(u0,A) - _LS = LinSolHandle(LS,Dense()) + LS = SUNLinSol_Dense(u0, A) + _LS = LinSolHandle(LS, Dense()) else - LS = SUNLinSol_LapackDense(u0,A) - _LS = LinSolHandle(LS,LapackDense()) + LS = SUNLinSol_LapackDense(u0, A) + _LS = LinSolHandle(LS, LapackDense()) end elseif LinearSolver in (:Band, :LapackBand) nojacobian = false A = SUNBandMatrix(length(u0), alg.jac_upper, alg.jac_lower) - _A = MatrixHandle(A,BandMatrix()) + _A = MatrixHandle(A, BandMatrix()) if LinearSolver === :Band - LS = SUNLinSol_Band(u0,A) - _LS = LinSolHandle(LS,Band()) + LS = SUNLinSol_Band(u0, A) + _LS = LinSolHandle(LS, Band()) else - LS = SUNLinSol_LapackBand(u0,A) - _LS = LinSolHandle(LS,LapackBand()) + LS = SUNLinSol_LapackBand(u0, A) + _LS = LinSolHandle(LS, LapackBand()) end elseif LinearSolver == :Diagonal nojacobian = false @@ -186,30 +212,30 @@ function DiffEqBase.__init( elseif LinearSolver == :GMRES LS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = Sundials.LinSolHandle(LS,Sundials.SPGMR()) + _LS = Sundials.LinSolHandle(LS, Sundials.SPGMR()) elseif LinearSolver == :FGMRES LS = SUNLinSol_SPFGMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,SPFGMR()) + _LS = LinSolHandle(LS, SPFGMR()) elseif LinearSolver == :BCG LS = SUNLinSol_SPBCGS(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,SPBCGS()) + _LS = LinSolHandle(LS, SPBCGS()) elseif LinearSolver == :PCG LS = SUNLinSol_PCG(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,PCG()) + _LS = LinSolHandle(LS, PCG()) elseif LinearSolver == :TFQMR LS = SUNLinSol_SPTFQMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,PTFQMR()) + _LS = LinSolHandle(LS, PTFQMR()) elseif LinearSolver == :KLU nojacobian = false nnz = length(SparseArrays.nonzeros(prob.f.jac_prototype)) - A = SUNSparseMatrix(length(u0),length(u0), nnz, CSC_MAT) + A = SUNSparseMatrix(length(u0), length(u0), nnz, CSC_MAT) LS = SUNLinSol_KLU(u0, A) - _A = MatrixHandle(A,SparseMatrix()) - _LS = LinSolHandle(LS,KLU()) + _A = MatrixHandle(A, SparseMatrix()) + _LS = LinSolHandle(LS, KLU()) end if LinearSolver !== :Diagonal flag = CVodeSetLinearSolver(mem, LS, _A === nothing ? C_NULL : A) @@ -225,62 +251,67 @@ function DiffEqBase.__init( CVodeSetNonlinearSolver(mem, NLS) if DiffEqBase.has_jac(prob.f) && Method == :Newton - function getcfunjac(::T) where T - @cfunction(cvodejac, - Cint, - (realtype, - N_Vector, - N_Vector, - SUNMatrix, - Ref{T}, - N_Vector, - N_Vector, - N_Vector)) - end - jac = getcfunjac(userfun) - flag = CVodeSetUserData(mem, userfun) - nojacobian || (flag = CVodeSetJacFn(mem, jac)) + function getcfunjac(::T) where {T} + @cfunction( + cvodejac, + Cint, + ( + realtype, + N_Vector, + N_Vector, + SUNMatrix, + Ref{T}, + N_Vector, + N_Vector, + N_Vector, + ) + ) + end + jac = getcfunjac(userfun) + flag = CVodeSetUserData(mem, userfun) + nojacobian || (flag = CVodeSetJacFn(mem, jac)) else jac = nothing end if typeof(prob.f.jac_prototype) <: DiffEqBase.AbstractDiffEqLinearOperator - function getcfunjtimes(::T) where T - @cfunction(jactimes, - Cint, - (N_Vector, - N_Vector, - realtype, - N_Vector, - N_Vector, - Ref{T}, - N_Vector)) + function getcfunjtimes(::T) where {T} + @cfunction( + jactimes, + Cint, + (N_Vector, N_Vector, realtype, N_Vector, N_Vector, Ref{T}, N_Vector) + ) end jtimes = getcfunjtimes(userfun) CVodeSetJacTimes(mem, C_NULL, jtimes) end if alg.prec !== nothing - function getpercfun(::T) where T - @cfunction(precsolve, - Cint, - (Float64, - N_Vector, - N_Vector, - N_Vector, - N_Vector,Float64,Float64,Int, - Ref{T})) + function getpercfun(::T) where {T} + @cfunction( + precsolve, + Cint, + ( + Float64, + N_Vector, + N_Vector, + N_Vector, + N_Vector, + Float64, + Float64, + Int, + Ref{T}, + ) + ) end precfun = getpercfun(userfun) - function getpsetupfun(::T) where T - @cfunction(precsetup, - Cint, - (Float64, - N_Vector, - N_Vector, - Int, - Ptr{Int},Float64,Ref{T})) + function getpsetupfun(::T) where {T} + @cfunction( + precsetup, + Cint, + (Float64, N_Vector, N_Vector, Int, Ptr{Int}, Float64, Ref{T}) + ) end psetupfun = alg.psetup === nothing ? C_NULL : getpsetupfun(userfun) @@ -292,26 +323,72 @@ function DiffEqBase.__init( tout = [tspan[1]] if save_start - save_value!(ures,u0,uType,sizeu) - if dense - f!(_u0,u0,prob.p,tspan[1]) - save_value!(dures,utmp,uType,sizeu) - end + save_value!(ures, u0, uType, sizeu) + if dense + f!(_u0, u0, prob.p, tspan[1]) + save_value!(dures, utmp, uType, sizeu) + end end - sol = DiffEqBase.build_solution(prob, alg, ts, ures, - dense = dense, - interp = dense ? DiffEqBase.HermiteInterpolation(ts,ures,dures) : - DiffEqBase.LinearInterpolation(ts,ures), - timeseries_errors = timeseries_errors, - destats = DiffEqBase.DEStats(0), - calculate_error = false) - opts = DEOptions(saveat_internal,tstops_internal,save_everystep,dense, - timeseries_errors,dense_errors,save_on,save_end, - callbacks_internal,abstol,reltol,verbose,advance_to_tstop,stop_at_next_tstop, - progress,progress_name,progress_message,maxiters) - integrator = CVODEIntegrator(u0,prob.p,t0,t0,mem,_LS,_A,sol,alg,f!,userfun,jac,opts, - tout,tdir,sizeu,false,tmp,uprev,Cint(flag),false,0,1,callback_cache,0.) + sol = DiffEqBase.build_solution( + prob, + alg, + ts, + ures, + dense = dense, + interp = dense ? DiffEqBase.HermiteInterpolation(ts, ures, dures) : + DiffEqBase.LinearInterpolation(ts, ures), + timeseries_errors = timeseries_errors, + destats = DiffEqBase.DEStats(0), + calculate_error = false, + ) + opts = DEOptions( + saveat_internal, + tstops_internal, + save_everystep, + dense, + timeseries_errors, + dense_errors, + save_on, + save_end, + callbacks_internal, + abstol, + reltol, + verbose, + advance_to_tstop, + stop_at_next_tstop, + progress, + progress_name, + progress_message, + maxiters, + ) + integrator = CVODEIntegrator( + u0, + prob.p, + t0, + t0, + mem, + _LS, + _A, + sol, + alg, + f!, + userfun, + jac, + opts, + tout, + tdir, + sizeu, + false, + tmp, + uprev, + Cint(flag), + false, + 0, + 1, + callback_cache, + 0.0, + ) initialize_callbacks!(integrator) integrator @@ -319,25 +396,37 @@ end # function solve function DiffEqBase.__init( prob::DiffEqBase.AbstractODEProblem{uType, tupType, isinplace}, - alg::ARKODE{Method,LinearSolver,MassLinearSolver}, - timeseries=[], ts=[], ks=[]; - - verbose=true, - callback=nothing, abstol=1/10^6, reltol=1/10^3, - saveat=Float64[], tstops=Float64[], - maxiters=Int(1e5), - dt = nothing, dtmin = 0.0, dtmax = 0.0, - timeseries_errors=true, + alg::ARKODE{Method, LinearSolver, MassLinearSolver}, + timeseries = [], + ts = [], + ks = []; + verbose = true, + callback = nothing, + abstol = 1 / 10^6, + reltol = 1 / 10^3, + saveat = Float64[], + tstops = Float64[], + maxiters = Int(1e5), + dt = nothing, + dtmin = 0.0, + dtmax = 0.0, + timeseries_errors = true, dense_errors = false, - save_everystep=isempty(saveat), dense = save_everystep, - save_on = true, save_start = true, save_end = true, + save_everystep = isempty(saveat), + dense = save_everystep, + save_on = true, + save_start = true, + save_end = true, save_timeseries = nothing, - progress=false,progress_name="ODE", + progress = false, + progress_name = "ODE", progress_message = DiffEqBase.ODE_DEFAULT_PROG_MESSAGE, - advance_to_tstop = false,stop_at_next_tstop=false, - userdata=nothing, - alias_u0=false, - kwargs...) where {uType, tupType, isinplace, Method, LinearSolver, MassLinearSolver} + advance_to_tstop = false, + stop_at_next_tstop = false, + userdata = nothing, + alias_u0 = false, + kwargs..., +) where {uType, tupType, isinplace, Method, LinearSolver, MassLinearSolver} tType = eltype(tupType) @@ -350,24 +439,24 @@ function DiffEqBase.__init( error("Sundials only allows scalar reltol.") end - progress && Logging.@logmsg(-1,progress_name,_id=_id = :Sundials,progress=0) + progress && Logging.@logmsg(-1, progress_name, _id = _id = :Sundials, progress = 0) callbacks_internal = DiffEqBase.CallbackSet(callback) max_len_cb = DiffEqBase.max_vector_callback_length(callbacks_internal) if max_len_cb isa VectorContinuousCallback - callback_cache = DiffEqBase.CallbackCache(max_len_cb.len,Float64,Float64) + callback_cache = DiffEqBase.CallbackCache(max_len_cb.len, Float64, Float64) else - callback_cache = nothing + callback_cache = nothing end tspan = prob.tspan t0 = tspan[1] - tdir = sign(tspan[2]-tspan[1]) + tdir = sign(tspan[2] - tspan[1]) tstops_internal, saveat_internal = - tstop_saveat_disc_handling(tstops,saveat,tdir,tspan,tType) + tstop_saveat_disc_handling(tstops, saveat, tdir, tspan, tType) if typeof(prob.u0) <: Number u0 = [prob.u0] @@ -381,97 +470,115 @@ function DiffEqBase.__init( sizeu = size(prob.u0) - - - ures = Vector{uType}() + ures = Vector{uType}() dures = Vector{uType}() save_start ? ts = [t0] : ts = Float64[] u0nv = NVector(u0) _u0 = copy(u0) utmp = NVector(_u0) - function arkodemem(;fe=C_NULL, fi=C_NULL, t0=t0, u0=convert(N_Vector, u0nv)) + function arkodemem(; fe = C_NULL, fi = C_NULL, t0 = t0, u0 = convert(N_Vector, u0nv)) mem_ptr = ARKStepCreate(fe, fi, t0, u0) (mem_ptr == C_NULL) && error("Failed to allocate ARKODE solver object") mem = Handle(mem_ptr) - !verbose && ARKStepSetErrHandlerFn(mem,@cfunction(null_error_handler, Nothing, - (Cint, Char, - Char, Ptr{Cvoid})),C_NULL) + !verbose && ARKStepSetErrHandlerFn( + mem, + @cfunction(null_error_handler, Nothing, (Cint, Char, Char, Ptr{Cvoid})), + C_NULL, + ) return mem end ### Fix the more general function to Sundials allowed style - if !isinplace && typeof(prob.u0)<:Number + if !isinplace && typeof(prob.u0) <: Number f! = (du, u, p, t) -> (du .= prob.f(first(u), p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:Vector{Float64} + elseif !isinplace && typeof(prob.u0) <: Vector{Float64} f! = (du, u, p, t) -> (du .= prob.f(u, p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:AbstractArray + elseif !isinplace && typeof(prob.u0) <: AbstractArray f! = (du, u, p, t) -> (du .= vec(prob.f(reshape(u, sizeu), p, t)); Cint(0)) - elseif typeof(prob.u0)<:Vector{Float64} + elseif typeof(prob.u0) <: Vector{Float64} f! = prob.f else # Then it's an in-place function on an abstract array f! = (du, u, p, t) -> (prob.f(reshape(du, sizeu), reshape(u, sizeu), p, t); - du=vec(du); Cint(0)) + du = vec(du); + Cint(0)) end if typeof(prob.problem_type) <: SplitODEProblem ### Fix the more general function to Sundials allowed style - if !isinplace && typeof(prob.u0)<:Number + if !isinplace && typeof(prob.u0) <: Number f1! = (du, u, p, t) -> (du .= prob.f.f1(first(u), p, t); Cint(0)) f2! = (du, u, p, t) -> (du .= prob.f.f2(first(u), p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:Vector{Float64} + elseif !isinplace && typeof(prob.u0) <: Vector{Float64} f1! = (du, u, p, t) -> (du .= prob.f.f1(u, p, t); Cint(0)) f2! = (du, u, p, t) -> (du .= prob.f.f2(u, p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:AbstractArray + elseif !isinplace && typeof(prob.u0) <: AbstractArray f1! = (du, u, p, t) -> (du .= vec(prob.f.f1(reshape(u, sizeu), p, t)); Cint(0)) f2! = (du, u, p, t) -> (du .= vec(prob.f.f2(reshape(u, sizeu), p, t)); Cint(0)) - elseif typeof(prob.u0)<:Vector{Float64} + elseif typeof(prob.u0) <: Vector{Float64} f1! = prob.f.f1 f2! = prob.f.f2 else # Then it's an in-place function on an abstract array - f1! = (du, u, p, t) -> (prob.f.f1(reshape(du, sizeu), reshape(u, sizeu), p, t); - du=vec(du); Cint(0)) - f2! = (du, u, p, t) -> (prob.f.f2(reshape(du, sizeu), reshape(u, sizeu), p, t); - du=vec(du); Cint(0)) + f1! = + (du, u, p, t) -> (prob.f.f1(reshape(du, sizeu), reshape(u, sizeu), p, t); + du = vec(du); + Cint(0)) + f2! = + (du, u, p, t) -> (prob.f.f2(reshape(du, sizeu), reshape(u, sizeu), p, t); + du = vec(du); + Cint(0)) end - userfun = FunJac(f1!,f2!,prob.f.f1.jac,prob.p,prob.f.mass_matrix, - prob.f.f1.jac_prototype,alg.prec,alg.psetup,u0,_u0,nothing) - - function getcfunjac(::T) where T - @cfunction(cvodefunjac, Cint, - (realtype, N_Vector, - N_Vector, Ref{T})) + userfun = FunJac( + f1!, + f2!, + prob.f.f1.jac, + prob.p, + prob.f.mass_matrix, + prob.f.f1.jac_prototype, + alg.prec, + alg.psetup, + u0, + _u0, + nothing, + ) + + function getcfunjac(::T) where {T} + @cfunction(cvodefunjac, Cint, (realtype, N_Vector, N_Vector, Ref{T})) end - function getcfunjac2(::T) where T - @cfunction(cvodefunjac2, Cint, - (realtype, N_Vector, - N_Vector, Ref{T})) + function getcfunjac2(::T) where {T} + @cfunction(cvodefunjac2, Cint, (realtype, N_Vector, N_Vector, Ref{T})) end cfj1 = getcfunjac(userfun) cfj2 = getcfunjac2(userfun) - mem = arkodemem(fi=cfj1, fe=cfj2) + mem = arkodemem(fi = cfj1, fe = cfj2) else - userfun = FunJac(f!,prob.f.jac,prob.p,prob.f.mass_matrix,prob.f.jac_prototype,alg.prec,alg.psetup,u0,_u0) + userfun = FunJac( + f!, + prob.f.jac, + prob.p, + prob.f.mass_matrix, + prob.f.jac_prototype, + alg.prec, + alg.psetup, + u0, + _u0, + ) if alg.stiffness == Explicit() - function getcfun1(::T) where T - @cfunction(cvodefunjac, Cint, - (realtype, N_Vector, - N_Vector, Ref{T})) + function getcfun1(::T) where {T} + @cfunction(cvodefunjac, Cint, (realtype, N_Vector, N_Vector, Ref{T})) end cfj1 = getcfun1(userfun) - mem = arkodemem(fe=cfj1) + mem = arkodemem(fe = cfj1) elseif alg.stiffness == Implicit() - function getcfun2(::T) where T - @cfunction(cvodefunjac, Cint, - (realtype, N_Vector, - N_Vector, Ref{T})) + function getcfun2(::T) where {T} + @cfunction(cvodefunjac, Cint, (realtype, N_Vector, N_Vector, Ref{T})) end cfj2 = getcfun2(userfun) - mem = arkodemem(fi=cfj2) + mem = arkodemem(fi = cfj2) end end @@ -491,7 +598,7 @@ function DiffEqBase.__init( flag = ARKStepSetMaxConvFails(mem, alg.max_convergence_failures) flag = ARKStepSetPredictorMethod(mem, alg.predictor_method) flag = ARKStepSetNonlinConvCoef(mem, alg.nonlinear_convergence_coefficient) - flag = ARKStepSetDenseOrder(mem,alg.dense_order) + flag = ARKStepSetDenseOrder(mem, alg.dense_order) #= Reference from Manual on ARKODE @@ -499,7 +606,7 @@ function DiffEqBase.__init( To select an implicit table, set etable to a negative value. This automatically calls ARKStepSetImplicit(). If both itable and etable are non-negative, then these should match an existing implicit/explicit pair, listed in the section Additive Butcher tables. This automatically calls ARKStepSetImEx(). =# if alg.itable == nothing && alg.etable == nothing - flag = ARKStepSetOrder(mem,alg.order) + flag = ARKStepSetOrder(mem, alg.order) elseif alg.itable == nothing && alg.etable != nothing flag = ARKStepSetTableNum(mem, -1, alg.etable) elseif alg.itable != nothing && alg.etable == nothing @@ -508,65 +615,64 @@ function DiffEqBase.__init( flag = ARKStepSetTableNum(mem, alg.itable, alg.etable) end - flag = ARKStepSetNonlinCRDown(mem,alg.crdown) + flag = ARKStepSetNonlinCRDown(mem, alg.crdown) flag = ARKStepSetNonlinRDiv(mem, alg.rdiv) flag = ARKStepSetDeltaGammaMax(mem, alg.dgmax) flag = ARKStepSetMaxStepsBetweenLSet(mem, alg.msbp) #flag = ARKStepSetAdaptivityMethod(mem,alg.adaptivity_method,1,0) - #flag = ARKStepSetFixedStep(mem,) alg.set_optimal_params && (flag = ARKStepSetOptimalParams(mem)) if Method == :Newton # Only use a linear solver if it's a Newton-based method if LinearSolver in (:Dense, :LapackDense) nojacobian = false - A = SUNDenseMatrix(length(u0),length(u0)) - _A = MatrixHandle(A,DenseMatrix()) + A = SUNDenseMatrix(length(u0), length(u0)) + _A = MatrixHandle(A, DenseMatrix()) if LinearSolver === :Dense - LS = SUNLinSol_Dense(u0,A) - _LS = LinSolHandle(LS,Dense()) + LS = SUNLinSol_Dense(u0, A) + _LS = LinSolHandle(LS, Dense()) else - LS = SUNLinSol_LapackDense(u0,A) - _LS = LinSolHandle(LS,LapackDense()) + LS = SUNLinSol_LapackDense(u0, A) + _LS = LinSolHandle(LS, LapackDense()) end elseif LinearSolver in (:Band, :LapackBand) nojacobian = false A = SUNBandMatrix(length(u0), alg.jac_upper, alg.jac_lower) - _A = MatrixHandle(A,BandMatrix()) + _A = MatrixHandle(A, BandMatrix()) if LinearSolver === :Band - LS = SUNLinSol_Band(u0,A) - _LS = LinSolHandle(LS,Band()) + LS = SUNLinSol_Band(u0, A) + _LS = LinSolHandle(LS, Band()) else - LS = SUNLinSol_LapackBand(u0,A) - _LS = LinSolHandle(LS,LapackBand()) + LS = SUNLinSol_LapackBand(u0, A) + _LS = LinSolHandle(LS, LapackBand()) end elseif LinearSolver == :GMRES LS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = Sundials.LinSolHandle(LS,Sundials.SPGMR()) + _LS = Sundials.LinSolHandle(LS, Sundials.SPGMR()) elseif LinearSolver == :FGMRES LS = SUNLinSol_SPFGMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,SPFGMR()) + _LS = LinSolHandle(LS, SPFGMR()) elseif LinearSolver == :BCG LS = SUNLinSol_SPBCGS(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,SPBCGS()) + _LS = LinSolHandle(LS, SPBCGS()) elseif LinearSolver == :PCG LS = SUNLinSol_PCG(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,PCG()) + _LS = LinSolHandle(LS, PCG()) elseif LinearSolver == :TFQMR LS = SUNLinSol_SPTFQMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,PTFQMR()) + _LS = LinSolHandle(LS, PTFQMR()) elseif LinearSolver == :KLU nnz = length(SparseArrays.nonzeros(prob.f.jac_prototype)) - A = SUNSparseMatrix(length(u0),length(u0), nnz, CSC_MAT) + A = SUNSparseMatrix(length(u0), length(u0), nnz, CSC_MAT) LS = SUNLinSol_KLU(u0, A) - _A = MatrixHandle(A,SparseMatrix()) - _LS = LinSolHandle(LS,KLU()) + _A = MatrixHandle(A, SparseMatrix()) + _LS = LinSolHandle(LS, KLU()) end flag = ARKStepSetLinearSolver(mem, LS, _A === nothing ? C_NULL : A) elseif Method == :Functional @@ -576,20 +682,19 @@ function DiffEqBase.__init( _LS = nothing end - if (typeof(prob.problem_type) <: SplitODEProblem && - typeof(prob.f.f1.jac_prototype) <: DiffEqBase.AbstractDiffEqLinearOperator) || - (!(typeof(prob.problem_type) <: SplitODEProblem) && - typeof(prob.f.jac_prototype) <: DiffEqBase.AbstractDiffEqLinearOperator) - function getcfunjtimes(::T) where T - @cfunction(jactimes, - Cint, - (N_Vector, - N_Vector, - realtype, - N_Vector, - N_Vector, - Ref{T}, - N_Vector)) + if ( + typeof(prob.problem_type) <: SplitODEProblem && + typeof(prob.f.f1.jac_prototype) <: DiffEqBase.AbstractDiffEqLinearOperator + ) || ( + !(typeof(prob.problem_type) <: SplitODEProblem) && + typeof(prob.f.jac_prototype) <: DiffEqBase.AbstractDiffEqLinearOperator + ) + function getcfunjtimes(::T) where {T} + @cfunction( + jactimes, + Cint, + (N_Vector, N_Vector, realtype, N_Vector, N_Vector, Ref{T}, N_Vector) + ) end jtimes = getcfunjtimes(userfun) ARKStepSetJacTimes(mem, C_NULL, jtimes) @@ -598,112 +703,118 @@ function DiffEqBase.__init( if prob.f.mass_matrix != LinearAlgebra.I if MassLinearSolver in (:Dense, :LapackDense) nojacobian = false - M = SUNDenseMatrix(length(u0),length(u0)) - _M = MatrixHandle(M,DenseMatrix()) + M = SUNDenseMatrix(length(u0), length(u0)) + _M = MatrixHandle(M, DenseMatrix()) if MassLinearSolver === :Dense - MLS = SUNLinSol_Dense(u0,M) - _MLS = LinSolHandle(MLS,Dense()) + MLS = SUNLinSol_Dense(u0, M) + _MLS = LinSolHandle(MLS, Dense()) else - MLS = SUNLinSol_LapackDense(u0,M) - _MLS = LinSolHandle(MLS,LapackDense()) + MLS = SUNLinSol_LapackDense(u0, M) + _MLS = LinSolHandle(MLS, LapackDense()) end elseif MassLinearSolver in (:Band, :LapackBand) nojacobian = false M = SUNBandMatrix(length(u0), alg.jac_upper, alg.jac_lower) - _M = MatrixHandle(M,BandMatrix()) + _M = MatrixHandle(M, BandMatrix()) if MassLinearSolver === :Band - MLS = SUNLinSol_Band(u0,M) - _MLS = LinSolHandle(MLS,Band()) + MLS = SUNLinSol_Band(u0, M) + _MLS = LinSolHandle(MLS, Band()) else - MLS = SUNLinSol_LapackBand(u0,M) - _MLS = LinSolHandle(MLS,LapackBand()) + MLS = SUNLinSol_LapackBand(u0, M) + _MLS = LinSolHandle(MLS, LapackBand()) end elseif MassLinearSolver == :GMRES MLS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.mass_krylov_dim) _M = nothing - _MLS = LinSolHandle(MLS,SPGMR()) + _MLS = LinSolHandle(MLS, SPGMR()) elseif MassLinearSolver == :FGMRES MLS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.mass_krylov_dim) _M = nothing - _MLS = LinSolHandle(MLS,SPFGMR()) + _MLS = LinSolHandle(MLS, SPFGMR()) elseif MassLinearSolver == :BCG MLS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.mass_krylov_dim) _M = nothing - _MLS = LinSolHandle(MLS,SPBCGS()) + _MLS = LinSolHandle(MLS, SPBCGS()) elseif MassLinearSolver == :PCG MLS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.mass_krylov_dim) _M = nothing - _MLS = LinSolHandle(MLS,PCG()) + _MLS = LinSolHandle(MLS, PCG()) elseif MassLinearSolver == :TFQMR MLS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.mass_krylov_dim) _M = nothing - _MLS = LinSolHandle(MLS,PTFQMR()) + _MLS = LinSolHandle(MLS, PTFQMR()) elseif MassLinearSolver == :KLU nnz = length(SparseArrays.nonzeros(prob.f.mass_matrix)) - M = SUNSparseMatrix(length(u0),length(u0), nnz, CSC_MAT) + M = SUNSparseMatrix(length(u0), length(u0), nnz, CSC_MAT) MLS = SUNLinSol_KLU(u0, M) - _M = MatrixHandle(M,SparseMatrix()) - _MLS = LinSolHandle(MLS,KLU()) + _M = MatrixHandle(M, SparseMatrix()) + _MLS = LinSolHandle(MLS, KLU()) end flag = ARKStepSetMassLinearSolver(mem, MLS, _M === nothing ? C_NULL : M, false) - function getmatfun(::T) where T - @cfunction(massmat, - Cint, - (realtype, - SUNMatrix, - Ref{T}, - N_Vector, - N_Vector, - N_Vector)) + function getmatfun(::T) where {T} + @cfunction( + massmat, + Cint, + (realtype, SUNMatrix, Ref{T}, N_Vector, N_Vector, N_Vector) + ) end matfun = getmatfun(userfun) - ARKStepSetMassFn(mem,matfun) + ARKStepSetMassFn(mem, matfun) else _M = nothing _MLS = nothing end if DiffEqBase.has_jac(prob.f) - function getfunjac(::T) where T - @cfunction(cvodejac, - Cint, - (realtype, - N_Vector, - N_Vector, - SUNMatrix, - Ref{T}, - N_Vector, - N_Vector, - N_Vector)) - end - jac = getfunjac(userfun) - flag = ARKStepSetUserData(mem, userfun) - flag = ARKStepSetJacFn(mem, jac) + function getfunjac(::T) where {T} + @cfunction( + cvodejac, + Cint, + ( + realtype, + N_Vector, + N_Vector, + SUNMatrix, + Ref{T}, + N_Vector, + N_Vector, + N_Vector, + ) + ) + end + jac = getfunjac(userfun) + flag = ARKStepSetUserData(mem, userfun) + flag = ARKStepSetJacFn(mem, jac) else jac = nothing end if alg.prec !== nothing - function getpercfun(::T) where T - @cfunction(precsolve, - Cint, - (Float64, - N_Vector, - N_Vector, - N_Vector, - N_Vector,Float64,Float64,Int, - Ref{T})) + function getpercfun(::T) where {T} + @cfunction( + precsolve, + Cint, + ( + Float64, + N_Vector, + N_Vector, + N_Vector, + N_Vector, + Float64, + Float64, + Int, + Ref{T}, + ) + ) end precfun = getpercfun(userfun) - function getpsetupfun(::T) where T - @cfunction(precsetup, - Cint, - (Float64, - N_Vector, - N_Vector, - Int, - Ptr{Int},Float64,Ref{T})) + function getpsetupfun(::T) where {T} + @cfunction( + precsetup, + Cint, + (Float64, N_Vector, N_Vector, Int, Ptr{Int}, Float64, Ref{T}) + ) end psetupfun = alg.psetup === nothing ? C_NULL : getpsetupfun(userfun) @@ -715,64 +826,127 @@ function DiffEqBase.__init( tout = [tspan[1]] if save_start - save_value!(ures,u0,uType,sizeu) - if dense - f!(_u0,u0,prob.p,tspan[1]) - save_value!(dures,utmp,uType,sizeu) - end + save_value!(ures, u0, uType, sizeu) + if dense + f!(_u0, u0, prob.p, tspan[1]) + save_value!(dures, utmp, uType, sizeu) + end end - sol = DiffEqBase.build_solution(prob, alg, ts, ures, - dense = dense, - interp = dense ? DiffEqBase.HermiteInterpolation(ts,ures,dures) : - DiffEqBase.LinearInterpolation(ts,ures), - timeseries_errors = timeseries_errors, - destats = DiffEqBase.DEStats(0), - calculate_error = false) - opts = DEOptions(saveat_internal,tstops_internal,save_everystep,dense, - timeseries_errors,dense_errors,save_on,save_end, - callbacks_internal,abstol,reltol,verbose,advance_to_tstop,stop_at_next_tstop, - progress,progress_name,progress_message,maxiters) - integrator = ARKODEIntegrator(utmp,prob.p,t0,t0,mem,_LS,_A,_MLS,_M,sol,alg,f!,userfun,jac,opts, - tout,tdir,sizeu,false,tmp,uprev,Cint(flag),false,0,1,callback_cache,0.) + sol = DiffEqBase.build_solution( + prob, + alg, + ts, + ures, + dense = dense, + interp = dense ? DiffEqBase.HermiteInterpolation(ts, ures, dures) : + DiffEqBase.LinearInterpolation(ts, ures), + timeseries_errors = timeseries_errors, + destats = DiffEqBase.DEStats(0), + calculate_error = false, + ) + opts = DEOptions( + saveat_internal, + tstops_internal, + save_everystep, + dense, + timeseries_errors, + dense_errors, + save_on, + save_end, + callbacks_internal, + abstol, + reltol, + verbose, + advance_to_tstop, + stop_at_next_tstop, + progress, + progress_name, + progress_message, + maxiters, + ) + integrator = ARKODEIntegrator( + utmp, + prob.p, + t0, + t0, + mem, + _LS, + _A, + _MLS, + _M, + sol, + alg, + f!, + userfun, + jac, + opts, + tout, + tdir, + sizeu, + false, + tmp, + uprev, + Cint(flag), + false, + 0, + 1, + callback_cache, + 0.0, + ) initialize_callbacks!(integrator) integrator end # function solve -function tstop_saveat_disc_handling(tstops,saveat,tdir,tspan,tType) +function tstop_saveat_disc_handling(tstops, saveat, tdir, tspan, tType) - if isempty(tstops) # TODO: Specialize more - tstops_vec = [tspan[2]] - else - tstops_vec = vec(collect(tType,Iterators.filter(x->tdir*tspan[1] tdir * tspan[1] < tdir * x ≤ tdir * tspan[end], + Iterators.flatten((tstops, tspan[end])), + ), + )) + end - if tdir>0 - tstops_internal = DataStructures.BinaryMinHeap(tstops_vec) - else - tstops_internal = DataStructures.BinaryMaxHeap(tstops_vec) - end + if tdir > 0 + tstops_internal = DataStructures.BinaryMinHeap(tstops_vec) + else + tstops_internal = DataStructures.BinaryMaxHeap(tstops_vec) + end - if typeof(saveat) <: Number - if (tspan[1]:saveat:tspan[end])[end] == tspan[end] - saveat_vec = convert(Vector{tType},collect(tType,tspan[1]+saveat:saveat:tspan[end])) + if typeof(saveat) <: Number + if (tspan[1]:saveat:tspan[end])[end] == tspan[end] + saveat_vec = convert( + Vector{tType}, + collect(tType, (tspan[1] + saveat):saveat:tspan[end]), + ) + else + saveat_vec = convert( + Vector{tType}, + collect(tType, (tspan[1] + saveat):saveat:(tspan[end] - saveat)), + ) + end + elseif isempty(saveat) + saveat_vec = saveat else - saveat_vec = convert(Vector{tType},collect(tType,tspan[1]+saveat:saveat:(tspan[end]-saveat))) + saveat_vec = vec(collect( + tType, + Iterators.filter(x -> tdir * tspan[1] < tdir * x < tdir * tspan[end], saveat), + )) end - elseif isempty(saveat) - saveat_vec = saveat - else - saveat_vec = vec(collect(tType,Iterators.filter(x->tdir*tspan[1]0 - saveat_internal = DataStructures.BinaryMinHeap(saveat_vec) - else - saveat_internal = DataStructures.BinaryMaxHeap(saveat_vec) - end - - tstops_internal,saveat_internal + + if tdir > 0 + saveat_internal = DataStructures.BinaryMinHeap(saveat_vec) + else + saveat_internal = DataStructures.BinaryMaxHeap(saveat_vec) + end + + tstops_internal, saveat_internal end ## Solve for DAEs uses IDA @@ -780,22 +954,34 @@ end function DiffEqBase.__init( prob::DiffEqBase.AbstractDAEProblem{uType, duType, tupType, isinplace}, alg::SundialsDAEAlgorithm{LinearSolver}, - timeseries=[], ts=[], ks=[]; - - verbose=true, - dt=nothing, dtmax=0.0, - save_on=true, save_start=true, - callback=nothing, abstol=1/10^6, reltol=1/10^3, - saveat=Float64[], tstops=Float64[], maxiters=Int(1e5), - timeseries_errors=true, + timeseries = [], + ts = [], + ks = []; + verbose = true, + dt = nothing, + dtmax = 0.0, + save_on = true, + save_start = true, + callback = nothing, + abstol = 1 / 10^6, + reltol = 1 / 10^3, + saveat = Float64[], + tstops = Float64[], + maxiters = Int(1e5), + timeseries_errors = true, dense_errors = false, - save_everystep=isempty(saveat), dense=save_everystep, - save_timeseries=nothing, save_end = true, - progress=false,progress_name="ODE", + save_everystep = isempty(saveat), + dense = save_everystep, + save_timeseries = nothing, + save_end = true, + progress = false, + progress_name = "ODE", progress_message = DiffEqBase.ODE_DEFAULT_PROG_MESSAGE, - advance_to_tstop = false, stop_at_next_tstop = false, - userdata=nothing, - kwargs...) where {uType, duType, tupType, isinplace, LinearSolver} + advance_to_tstop = false, + stop_at_next_tstop = false, + userdata = nothing, + kwargs..., +) where {uType, duType, tupType, isinplace, LinearSolver} tType = eltype(tupType) @@ -808,24 +994,24 @@ function DiffEqBase.__init( error("Sundials only allows scalar reltol.") end - progress && Logging.@logmsg(-1,progress_name,_id=_id = :Sundials,progress=0) + progress && Logging.@logmsg(-1, progress_name, _id = _id = :Sundials, progress = 0) callbacks_internal = DiffEqBase.CallbackSet(callback) max_len_cb = DiffEqBase.max_vector_callback_length(callbacks_internal) if max_len_cb isa VectorContinuousCallback - callback_cache = DiffEqBase.CallbackCache(max_len_cb.len,Float64,Float64) + callback_cache = DiffEqBase.CallbackCache(max_len_cb.len, Float64, Float64) else - callback_cache = nothing + callback_cache = nothing end tspan = prob.tspan t0 = tspan[1] - tdir = sign(tspan[2]-tspan[1]) + tdir = sign(tspan[2] - tspan[1]) tstops_internal, saveat_internal = - tstop_saveat_disc_handling(tstops,saveat,tdir,tspan,tType) + tstop_saveat_disc_handling(tstops, saveat, tdir, tspan, tType) if typeof(prob.u0) <: Number u0 = [prob.u0] @@ -843,32 +1029,37 @@ function DiffEqBase.__init( sizedu = size(prob.du0) ### Fix the more general function to Sundials allowed style - if !isinplace && typeof(prob.u0)<:Number - f! = (out, du, u, p, t) -> (out .= prob.f(first(du),first(u), p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:Vector{Float64} + if !isinplace && typeof(prob.u0) <: Number + f! = (out, du, u, p, t) -> (out .= prob.f(first(du), first(u), p, t); Cint(0)) + elseif !isinplace && typeof(prob.u0) <: Vector{Float64} f! = (out, du, u, p, t) -> (out .= prob.f(du, u, p, t); Cint(0)) - elseif !isinplace && typeof(prob.u0)<:AbstractArray - f! = (out, du, u, p, t) -> (out .= vec( - prob.f(reshape(du, sizedu), reshape(u, sizeu), p, t) - );Cint(0)) - elseif typeof(prob.u0)<:Vector{Float64} + elseif !isinplace && typeof(prob.u0) <: AbstractArray + f! = + (out, du, u, p, t) -> + (out .= vec(prob.f(reshape(du, sizedu), reshape(u, sizeu), p, t)); + Cint(0)) + elseif typeof(prob.u0) <: Vector{Float64} f! = prob.f else # Then it's an in-place function on an abstract array - f! = (out, du, u, p, t) -> (prob.f(reshape(out, sizeu), reshape(du, sizedu), - reshape(u, sizeu), p, t); Cint(0)) + f! = + (out, du, u, p, t) -> + (prob.f(reshape(out, sizeu), reshape(du, sizedu), reshape(u, sizeu), p, t); + Cint(0)) end mem_ptr = IDACreate() (mem_ptr == C_NULL) && error("Failed to allocate IDA solver object") mem = Handle(mem_ptr) - !verbose && IDASetErrHandlerFn(mem,@cfunction(null_error_handler, Nothing, - (Cint, Char, - Char, Ptr{Cvoid})),C_NULL) + !verbose && IDASetErrHandlerFn( + mem, + @cfunction(null_error_handler, Nothing, (Cint, Char, Char, Ptr{Cvoid})), + C_NULL, + ) ures = Vector{uType}() dures = Vector{uType}() - ts = [t0] + ts = [t0] _u0 = copy(u0) utmp = NVector(_u0) @@ -876,19 +1067,26 @@ function DiffEqBase.__init( dutmp = NVector(_du0) rtest = zeros(length(u0)) - userfun = FunJac(f!,prob.f.jac,prob.p,nothing,prob.f.jac_prototype,alg.prec,alg.psetup,_u0,_du0,rtest) + userfun = FunJac( + f!, + prob.f.jac, + prob.p, + nothing, + prob.f.jac_prototype, + alg.prec, + alg.psetup, + _u0, + _du0, + rtest, + ) u0nv = NVector(u0) - function getcfun(::T) where T - @cfunction(idasolfun, - Cint, (realtype, N_Vector, N_Vector, - N_Vector, Ref{T})) + function getcfun(::T) where {T} + @cfunction(idasolfun, Cint, (realtype, N_Vector, N_Vector, N_Vector, Ref{T})) end cfun = getcfun(userfun) - flag = IDAInit(mem, cfun, - t0, convert(N_Vector, utmp), - convert(N_Vector, dutmp)) + flag = IDAInit(mem, cfun, t0, convert(N_Vector, utmp), convert(N_Vector, dutmp)) dt != nothing && (flag = IDASetInitStep(mem, dt)) flag = IDASetUserData(mem, userfun) flag = IDASetMaxStep(mem, dtmax) @@ -898,104 +1096,119 @@ function DiffEqBase.__init( flag = IDASStolerances(mem, reltol, abstol) end flag = IDASetMaxNumSteps(mem, maxiters) - flag = IDASetMaxOrd(mem,alg.max_order) - flag = IDASetMaxErrTestFails(mem,alg.max_error_test_failures) - flag = IDASetNonlinConvCoef(mem,alg.nonlinear_convergence_coefficient) - flag = IDASetMaxNonlinIters(mem,alg.max_nonlinear_iters) - flag = IDASetMaxConvFails(mem,alg.max_convergence_failures) - flag = IDASetNonlinConvCoefIC(mem,alg.nonlinear_convergence_coefficient_ic) - flag = IDASetMaxNumStepsIC(mem,alg.max_num_steps_ic) - flag = IDASetMaxNumJacsIC(mem,alg.max_num_jacs_ic) - flag = IDASetMaxNumItersIC(mem,alg.max_num_iters_ic) + flag = IDASetMaxOrd(mem, alg.max_order) + flag = IDASetMaxErrTestFails(mem, alg.max_error_test_failures) + flag = IDASetNonlinConvCoef(mem, alg.nonlinear_convergence_coefficient) + flag = IDASetMaxNonlinIters(mem, alg.max_nonlinear_iters) + flag = IDASetMaxConvFails(mem, alg.max_convergence_failures) + flag = IDASetNonlinConvCoefIC(mem, alg.nonlinear_convergence_coefficient_ic) + flag = IDASetMaxNumStepsIC(mem, alg.max_num_steps_ic) + flag = IDASetMaxNumJacsIC(mem, alg.max_num_jacs_ic) + flag = IDASetMaxNumItersIC(mem, alg.max_num_iters_ic) #flag = IDASetMaxBacksIC(mem,alg.max_num_backs_ic) # Needs newer version? - flag = IDASetLineSearchOffIC(mem,alg.use_linesearch_ic) + flag = IDASetLineSearchOffIC(mem, alg.use_linesearch_ic) if LinearSolver in (:Dense, :LapackDense) nojacobian = false - A = SUNDenseMatrix(length(u0),length(u0)) - _A = MatrixHandle(A,DenseMatrix()) + A = SUNDenseMatrix(length(u0), length(u0)) + _A = MatrixHandle(A, DenseMatrix()) if LinearSolver === :Dense - LS = SUNLinSol_Dense(u0,A) - _LS = LinSolHandle(LS,Dense()) + LS = SUNLinSol_Dense(u0, A) + _LS = LinSolHandle(LS, Dense()) else - LS = SUNLinSol_LapackDense(u0,A) - _LS = LinSolHandle(LS,LapackDense()) + LS = SUNLinSol_LapackDense(u0, A) + _LS = LinSolHandle(LS, LapackDense()) end elseif LinearSolver in (:Band, :LapackBand) nojacobian = false A = SUNBandMatrix(length(u0), alg.jac_upper, alg.jac_lower) - _A = MatrixHandle(A,BandMatrix()) + _A = MatrixHandle(A, BandMatrix()) if LinearSolver === :Band - LS = SUNLinSol_Band(u0,A) - _LS = LinSolHandle(LS,Band()) + LS = SUNLinSol_Band(u0, A) + _LS = LinSolHandle(LS, Band()) else - LS = SUNLinSol_LapackBand(u0,A) - _LS = LinSolHandle(LS,LapackBand()) + LS = SUNLinSol_LapackBand(u0, A) + _LS = LinSolHandle(LS, LapackBand()) end elseif LinearSolver == :GMRES LS = SUNLinSol_SPGMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,SPGMR()) + _LS = LinSolHandle(LS, SPGMR()) elseif LinearSolver == :FGMRES LS = SUNLinSol_SPFGMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,SPFGMR()) + _LS = LinSolHandle(LS, SPFGMR()) elseif LinearSolver == :BCG LS = SUNLinSol_SPBCGS(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,SPBCGS()) + _LS = LinSolHandle(LS, SPBCGS()) elseif LinearSolver == :PCG LS = SUNLinSol_PCG(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,PCG()) + _LS = LinSolHandle(LS, PCG()) elseif LinearSolver == :TFQMR LS = SUNLinSol_SPTFQMR(u0, alg.prec_side, alg.krylov_dim) _A = nothing - _LS = LinSolHandle(LS,PTFQMR()) + _LS = LinSolHandle(LS, PTFQMR()) elseif LinearSolver == :KLU nnz = length(SparseArrays.nonzeros(prob.f.jac_prototype)) - A = SUNSparseMatrix(length(u0),length(u0), nnz, Sundials.CSC_MAT) + A = SUNSparseMatrix(length(u0), length(u0), nnz, Sundials.CSC_MAT) LS = SUNLinSol_KLU(u0, A) - _A = MatrixHandle(A,SparseMatrix()) - _LS = LinSolHandle(LS,KLU()) + _A = MatrixHandle(A, SparseMatrix()) + _LS = LinSolHandle(LS, KLU()) end flag = IDASetLinearSolver(mem, LS, _A === nothing ? C_NULL : A) if typeof(prob.f.jac_prototype) <: DiffEqBase.AbstractDiffEqLinearOperator - function getcfunjtimes(::T) where T - @cfunction(idajactimes, - Cint, - (realtype, - N_Vector,N_Vector,N_Vector,N_Vector,N_Vector, - realtype, - Ref{T}, - N_Vector,N_Vector)) + function getcfunjtimes(::T) where {T} + @cfunction( + idajactimes, + Cint, + ( + realtype, + N_Vector, + N_Vector, + N_Vector, + N_Vector, + N_Vector, + realtype, + Ref{T}, + N_Vector, + N_Vector, + ) + ) end jtimes = getcfunjtimes(userfun) IDASetJacTimes(mem, C_NULL, jtimes) end if alg.prec !== nothing - function getpercfun(::T) where T - @cfunction(idaprecsolve, - Cint, - (Float64, - N_Vector, - N_Vector, - N_Vector, - N_Vector,N_Vector,Float64,Float64,Int, - Ref{T})) + function getpercfun(::T) where {T} + @cfunction( + idaprecsolve, + Cint, + ( + Float64, + N_Vector, + N_Vector, + N_Vector, + N_Vector, + N_Vector, + Float64, + Float64, + Int, + Ref{T}, + ) + ) end precfun = getpercfun(userfun) - function getpsetupfun(::T) where T - @cfunction(idaprecsetup, - Cint, - (Float64, - N_Vector, - N_Vector, - N_Vector, - Float64,Ref{T})) + function getpsetupfun(::T) where {T} + @cfunction( + idaprecsetup, + Cint, + (Float64, N_Vector, N_Vector, N_Vector, Float64, Ref{T}) + ) end psetupfun = alg.psetup === nothing ? C_NULL : getpsetupfun(userfun) @@ -1003,25 +1216,29 @@ function DiffEqBase.__init( end if DiffEqBase.has_jac(prob.f) - function getcfunjacc(::T) where T - @cfunction(idajac, - Cint, - (realtype, - realtype, - N_Vector, - N_Vector, - N_Vector, - SUNMatrix, - Ref{T}, - N_Vector, - N_Vector, - N_Vector)) - end - jac = getcfunjacc(userfun) - flag = IDASetUserData(mem, userfun) - flag = IDASetJacFn(mem, jac) + function getcfunjacc(::T) where {T} + @cfunction( + idajac, + Cint, + ( + realtype, + realtype, + N_Vector, + N_Vector, + N_Vector, + SUNMatrix, + Ref{T}, + N_Vector, + N_Vector, + N_Vector, + ) + ) + end + jac = getcfunjacc(userfun) + flag = IDASetUserData(mem, userfun) + flag = IDASetJacFn(mem, jac) else - jac = nothing + jac = nothing end tout = [tspan[1]] @@ -1031,8 +1248,8 @@ function DiffEqBase.__init( if prob.differential_vars === nothing && !alg.init_all error("Must supply differential_vars argument to DAEProblem constructor to use IDA initial value solver.") end - prob.differential_vars != nothing && (flag = IDASetId(mem, collect(Float64, prob.differential_vars))) - + prob.differential_vars != nothing && + (flag = IDASetId(mem, collect(Float64, prob.differential_vars))) if dt != nothing _t = float(dt) @@ -1048,10 +1265,10 @@ function DiffEqBase.__init( end if save_start - save_value!(ures,u0,uType,sizeu) - if dense - save_value!(dures,du0,uType,sizedu) # Does this need to update for IDACalcIC? - end + save_value!(ures, u0, uType, sizeu) + if dense + save_value!(dures, du0, uType, sizedu) # Does this need to update for IDACalcIC? + end end callbacks_internal == nothing ? tmp = nothing : tmp = similar(u0) @@ -1063,23 +1280,71 @@ function DiffEqBase.__init( retcode = :InitialFailure end - sol = DiffEqBase.build_solution(prob, alg, ts, ures, - dense = dense, - interp = dense ? DiffEqBase.HermiteInterpolation(ts,ures,dures) : - DiffEqBase.LinearInterpolation(ts,ures), - calculate_error = false, - timeseries_errors = timeseries_errors, - retcode = retcode, - destats = DiffEqBase.DEStats(0), - dense_errors = dense_errors) - - opts = DEOptions(saveat_internal,tstops_internal,save_everystep,dense, - timeseries_errors,dense_errors,save_on,save_end, - callbacks_internal,abstol,reltol,verbose,advance_to_tstop,stop_at_next_tstop, - progress,progress_name,progress_message,maxiters) - - integrator = IDAIntegrator(utmp,dutmp,prob.p,t0,t0,mem,_LS,_A,sol,alg,f!,userfun,jac,opts, - tout,tdir,sizeu,sizedu,false,tmp,uprev,Cint(flag),false,0,1,callback_cache,0.) + sol = DiffEqBase.build_solution( + prob, + alg, + ts, + ures, + dense = dense, + interp = dense ? DiffEqBase.HermiteInterpolation(ts, ures, dures) : + DiffEqBase.LinearInterpolation(ts, ures), + calculate_error = false, + timeseries_errors = timeseries_errors, + retcode = retcode, + destats = DiffEqBase.DEStats(0), + dense_errors = dense_errors, + ) + + opts = DEOptions( + saveat_internal, + tstops_internal, + save_everystep, + dense, + timeseries_errors, + dense_errors, + save_on, + save_end, + callbacks_internal, + abstol, + reltol, + verbose, + advance_to_tstop, + stop_at_next_tstop, + progress, + progress_name, + progress_message, + maxiters, + ) + + integrator = IDAIntegrator( + utmp, + dutmp, + prob.p, + t0, + t0, + mem, + _LS, + _A, + sol, + alg, + f!, + userfun, + jac, + opts, + tout, + tdir, + sizeu, + sizedu, + false, + tmp, + uprev, + Cint(flag), + false, + 0, + 1, + callback_cache, + 0.0, + ) initialize_callbacks!(integrator) integrator @@ -1088,63 +1353,92 @@ end # function solve ## Common calls function interpret_sundials_retcode(flag) - flag >= 0 && return :Success - flag == -1 && return :MaxIters - (flag == -2 || flag == -3) && return :Unstable - flag == -4 && return :ConvergenceFailure - return :Failure + flag >= 0 && return :Success + flag == -1 && return :MaxIters + (flag == -2 || flag == -3) && return :Unstable + flag == -4 && return :ConvergenceFailure + return :Failure end -function solver_step(integrator::CVODEIntegrator,tstop) - integrator.flag = CVode(integrator.mem, tstop, integrator.u, integrator.tout, CV_ONE_STEP) +function solver_step(integrator::CVODEIntegrator, tstop) + integrator.flag = + CVode(integrator.mem, tstop, integrator.u, integrator.tout, CV_ONE_STEP) if integrator.opts.progress - Logging.@logmsg(-1, - integrator.opts.progress_name, - _id = :Sundials, - message=integrator.opts.progress_message(integrator.dt,integrator.u,integrator.p,integrator.t), - progress=integrator.t/integrator.sol.prob.tspan[2]) + Logging.@logmsg( + -1, + integrator.opts.progress_name, + _id = :Sundials, + message = integrator.opts.progress_message( + integrator.dt, + integrator.u, + integrator.p, + integrator.t, + ), + progress = integrator.t / integrator.sol.prob.tspan[2] + ) end end -function solver_step(integrator::ARKODEIntegrator,tstop) - integrator.flag = ARKStepEvolve(integrator.mem, tstop, integrator.u, integrator.tout, ARK_ONE_STEP) +function solver_step(integrator::ARKODEIntegrator, tstop) + integrator.flag = + ARKStepEvolve(integrator.mem, tstop, integrator.u, integrator.tout, ARK_ONE_STEP) if integrator.opts.progress - Logging.@logmsg(-1, - integrator.opts.progress_name, - _id = :Sundials, - message=integrator.opts.progress_message(integrator.dt,integrator.u,integrator.p,integrator.t), - progress=integrator.t/integrator.sol.prob.tspan[2]) + Logging.@logmsg( + -1, + integrator.opts.progress_name, + _id = :Sundials, + message = integrator.opts.progress_message( + integrator.dt, + integrator.u, + integrator.p, + integrator.t, + ), + progress = integrator.t / integrator.sol.prob.tspan[2] + ) end end -function solver_step(integrator::IDAIntegrator,tstop) - integrator.flag = IDASolve(integrator.mem, tstop, integrator.tout, - integrator.u, integrator.du, IDA_ONE_STEP) +function solver_step(integrator::IDAIntegrator, tstop) + integrator.flag = IDASolve( + integrator.mem, + tstop, + integrator.tout, + integrator.u, + integrator.du, + IDA_ONE_STEP, + ) if integrator.opts.progress - Logging.@logmsg(-1, - integrator.opts.progress_name, - _id = :Sundials, - message=integrator.opts.progress_message(integrator.dt,integrator.u,integrator.p,integrator.t), - progress=integrator.t/integrator.sol.prob.tspan[2]) + Logging.@logmsg( + -1, + integrator.opts.progress_name, + _id = :Sundials, + message = integrator.opts.progress_message( + integrator.dt, + integrator.u, + integrator.p, + integrator.t, + ), + progress = integrator.t / integrator.sol.prob.tspan[2] + ) end end -function set_stop_time(integrator::CVODEIntegrator,tstop) - CVodeSetStopTime(integrator.mem,tstop) +function set_stop_time(integrator::CVODEIntegrator, tstop) + CVodeSetStopTime(integrator.mem, tstop) end -function set_stop_time(integrator::ARKODEIntegrator,tstop) - ARKStepSetStopTime(integrator.mem,tstop) +function set_stop_time(integrator::ARKODEIntegrator, tstop) + ARKStepSetStopTime(integrator.mem, tstop) end -function set_stop_time(integrator::IDAIntegrator,tstop) - IDASetStopTime(integrator.mem,tstop) +function set_stop_time(integrator::IDAIntegrator, tstop) + IDASetStopTime(integrator.mem, tstop) end -function get_iters!(integrator::CVODEIntegrator,iters) - CVodeGetNumSteps(integrator.mem,iters) +function get_iters!(integrator::CVODEIntegrator, iters) + CVodeGetNumSteps(integrator.mem, iters) end -function get_iters!(integrator::ARKODEIntegrator,iters) - ARKStepGetNumSteps(integrator.mem,iters) +function get_iters!(integrator::ARKODEIntegrator, iters) + ARKStepGetNumSteps(integrator.mem, iters) end -function get_iters!(integrator::IDAIntegrator,iters) - IDAGetNumSteps(integrator.mem,iters) +function get_iters!(integrator::IDAIntegrator, iters) + IDAGetNumSteps(integrator.mem, iters) end function DiffEqBase.solve!(integrator::AbstractSundialsIntegrator) @@ -1154,21 +1448,21 @@ function DiffEqBase.solve!(integrator::AbstractSundialsIntegrator) # Sundials can have floating point issues approaching a tstop if # there is a modifying event each # The call to first is an overload of Base.first implemented in DataStructures - while integrator.tdir*(integrator.t-first(integrator.opts.tstops)) < -1e6eps() + while integrator.tdir * (integrator.t - first(integrator.opts.tstops)) < -1e6eps() tstop = first(integrator.opts.tstops) - set_stop_time(integrator,tstop) + set_stop_time(integrator, tstop) integrator.tprev = integrator.t - if !(typeof(integrator.opts.callback.continuous_callbacks)<:Tuple{}) + if !(typeof(integrator.opts.callback.continuous_callbacks) <: Tuple{}) integrator.uprev .= integrator.u end integrator.userfun.p = integrator.p - solver_step(integrator,tstop) + solver_step(integrator, tstop) integrator.t = first(integrator.tout) integrator.flag < 0 && break handle_callbacks!(integrator) integrator.flag < 0 && break if isempty(integrator.opts.tstops) - break + break end get_iters!(integrator, iters) if iters[] + 1 > integrator.opts.maxiters @@ -1180,21 +1474,29 @@ function DiffEqBase.solve!(integrator::AbstractSundialsIntegrator) handle_tstop!(integrator) end - if integrator.opts.save_end && (isempty(integrator.sol.t) || integrator.sol.t[end] != integrator.t) - save_value!(integrator.sol.u,integrator.u,uType,integrator.sizeu) + if integrator.opts.save_end && + (isempty(integrator.sol.t) || integrator.sol.t[end] != integrator.t) + save_value!(integrator.sol.u, integrator.u, uType, integrator.sizeu) push!(integrator.sol.t, integrator.t) if integrator.opts.dense - integrator(integrator.u,integrator.t,Val{1}) - save_value!(integrator.sol.interp.du,integrator.u,uType,integrator.sizeu) + integrator(integrator.u, integrator.t, Val{1}) + save_value!(integrator.sol.interp.du, integrator.u, uType, integrator.sizeu) end end if integrator.opts.progress - Logging.@logmsg(-1, - integrator.opts.progress_name, - _id = :Sundials, - message=integrator.opts.progress_message(integrator.dt,integrator.u,integrator.p,integrator.t), - progress="done") + Logging.@logmsg( + -1, + integrator.opts.progress_name, + _id = :Sundials, + message = integrator.opts.progress_message( + integrator.dt, + integrator.u, + integrator.p, + integrator.t, + ), + progress = "done" + ) end fill_destats!(integrator) @@ -1203,13 +1505,18 @@ function DiffEqBase.solve!(integrator::AbstractSundialsIntegrator) integrator.LS != nothing && empty!(integrator.LS) if DiffEqBase.has_analytic(integrator.sol.prob.f) - DiffEqBase.calculate_solution_errors!(integrator.sol; - timeseries_errors=integrator.opts.timeseries_errors, - dense_errors=integrator.opts.dense_errors) + DiffEqBase.calculate_solution_errors!( + integrator.sol; + timeseries_errors = integrator.opts.timeseries_errors, + dense_errors = integrator.opts.dense_errors, + ) end if integrator.sol.retcode === :Default - integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol,interpret_sundials_retcode(integrator.flag)) + integrator.sol = DiffEqBase.solution_new_retcode( + integrator.sol, + interpret_sundials_retcode(integrator.flag), + ) end return integrator.sol @@ -1218,35 +1525,34 @@ end function handle_tstop!(integrator::AbstractSundialsIntegrator) tstops = integrator.opts.tstops if !isempty(tstops) - if integrator.tdir*(integrator.t-first(integrator.opts.tstops)) > -1e6eps() - pop!(tstops) - t = integrator.t - integrator.just_hit_tstop = true - end + if integrator.tdir * (integrator.t - first(integrator.opts.tstops)) > -1e6eps() + pop!(tstops) + t = integrator.t + integrator.just_hit_tstop = true + end end end -function fill_destats!(integrator::AbstractSundialsIntegrator) -end +function fill_destats!(integrator::AbstractSundialsIntegrator) end function fill_destats!(integrator::CVODEIntegrator) destats = integrator.sol.destats mem = integrator.mem tmp = Ref(Clong(-1)) - CVodeGetNumRhsEvals(mem,tmp) + CVodeGetNumRhsEvals(mem, tmp) destats.nf = tmp[] - CVodeGetNumLinSolvSetups(mem,tmp) + CVodeGetNumLinSolvSetups(mem, tmp) destats.nw = tmp[] - CVodeGetNumErrTestFails(mem,tmp) + CVodeGetNumErrTestFails(mem, tmp) destats.nreject = tmp[] - CVodeGetNumSteps(mem,tmp) + CVodeGetNumSteps(mem, tmp) destats.naccept = tmp[] - destats.nreject - CVodeGetNumNonlinSolvIters(mem,tmp) + CVodeGetNumNonlinSolvIters(mem, tmp) destats.nnonliniter = tmp[] - CVodeGetNumNonlinSolvConvFails(mem,tmp) + CVodeGetNumNonlinSolvConvFails(mem, tmp) destats.nnonlinconvfail = tmp[] if method_choice(integrator.alg) == :Newton - CVodeGetNumJacEvals(mem,tmp) + CVodeGetNumJacEvals(mem, tmp) destats.njacs = tmp[] end end @@ -1256,21 +1562,21 @@ function fill_destats!(integrator::ARKODEIntegrator) mem = integrator.mem tmp = Ref(Clong(-1)) tmp2 = Ref(Clong(-1)) - ARKStepGetNumRhsEvals(mem,tmp,tmp2) + ARKStepGetNumRhsEvals(mem, tmp, tmp2) destats.nf = tmp[] destats.nf2 = tmp2[] - ARKStepGetNumLinSolvSetups(mem,tmp) + ARKStepGetNumLinSolvSetups(mem, tmp) destats.nw = tmp[] - ARKStepGetNumErrTestFails(mem,tmp) + ARKStepGetNumErrTestFails(mem, tmp) destats.nreject = tmp[] - ARKStepGetNumSteps(mem,tmp) + ARKStepGetNumSteps(mem, tmp) destats.naccept = tmp[] - destats.nreject - ARKStepGetNumNonlinSolvIters(mem,tmp) + ARKStepGetNumNonlinSolvIters(mem, tmp) destats.nnonliniter = tmp[] - ARKStepGetNumNonlinSolvConvFails(mem,tmp) + ARKStepGetNumNonlinSolvConvFails(mem, tmp) destats.nnonlinconvfail = tmp[] if method_choice(integrator.alg) == :Newton - ARKStepGetNumJacEvals(mem,tmp) + ARKStepGetNumJacEvals(mem, tmp) destats.njacs = tmp[] end end @@ -1279,44 +1585,45 @@ function fill_destats!(integrator::IDAIntegrator) destats = integrator.sol.destats mem = integrator.mem tmp = Ref(Clong(-1)) - IDAGetNumResEvals(mem,tmp) + IDAGetNumResEvals(mem, tmp) destats.nf = tmp[] - IDAGetNumLinSolvSetups(mem,tmp) + IDAGetNumLinSolvSetups(mem, tmp) destats.nw = tmp[] - IDAGetNumErrTestFails(mem,tmp) + IDAGetNumErrTestFails(mem, tmp) destats.nreject = tmp[] - IDAGetNumSteps(mem,tmp) + IDAGetNumSteps(mem, tmp) destats.naccept = tmp[] - destats.nreject - IDAGetNumNonlinSolvIters(mem,tmp) + IDAGetNumNonlinSolvIters(mem, tmp) destats.nnonliniter = tmp[] - IDAGetNumNonlinSolvConvFails(mem,tmp) + IDAGetNumNonlinSolvConvFails(mem, tmp) destats.nnonlinconvfail = tmp[] if method_choice(integrator.alg) == :Newton - IDAGetNumJacEvals(mem,tmp) + IDAGetNumJacEvals(mem, tmp) destats.njacs = tmp[] end end function initialize_callbacks!(integrator, initialize_save = true) - t = integrator.t - u = integrator.u - callbacks = integrator.opts.callback - integrator.u_modified = true + t = integrator.t + u = integrator.u + callbacks = integrator.opts.callback + integrator.u_modified = true - u_modified = initialize!(callbacks,u,t,integrator) + u_modified = initialize!(callbacks, u, t, integrator) - # if the user modifies u, we need to fix current values - if u_modified + # if the user modifies u, we need to fix current values + if u_modified - handle_callback_modifiers!(integrator) + handle_callback_modifiers!(integrator) - if initialize_save && - (any((c)->c.save_positions[2],callbacks.discrete_callbacks) || - any((c)->c.save_positions[2],callbacks.continuous_callbacks)) - savevalues!(integrator,true) + if initialize_save && ( + any((c) -> c.save_positions[2], callbacks.discrete_callbacks) || + any((c) -> c.save_positions[2], callbacks.continuous_callbacks) + ) + savevalues!(integrator, true) + end end - end - # reset this as it is now handled so the integrators should proceed as normal - integrator.u_modified = false + # reset this as it is now handled so the integrators should proceed as normal + integrator.u_modified = false end diff --git a/src/common_interface/verbosity.jl b/src/common_interface/verbosity.jl index b3a1d582..44aeda2e 100644 --- a/src/common_interface/verbosity.jl +++ b/src/common_interface/verbosity.jl @@ -1,6 +1,3 @@ -function null_error_handler(error_code::Cint, - mod::Char, - func::Char, - eh_data::Ptr{Cvoid}) - nothing +function null_error_handler(error_code::Cint, mod::Char, func::Char, eh_data::Ptr{Cvoid}) + nothing end diff --git a/src/handle.jl b/src/handle.jl index 26eb4ae3..e2347bf6 100644 --- a/src/handle.jl +++ b/src/handle.jl @@ -43,55 +43,66 @@ abstract type SundialsHandle end struct Handle{T <: AbstractSundialsObject} <: SundialsHandle ptr_ref::Ref{Ptr{T}} # pointer to a pointer - function Handle(ptr::Ptr{T}) where T <: AbstractSundialsObject + function Handle(ptr::Ptr{T}) where {T <: AbstractSundialsObject} h = new{T}(Ref{Ptr{T}}(ptr)) finalizer(release_handle, h.ptr_ref) return h end end -mutable struct MatrixHandle{T<:SundialsMatrix} <: SundialsHandle +mutable struct MatrixHandle{T <: SundialsMatrix} <: SundialsHandle ptr::SUNMatrix destroyed::Bool - function MatrixHandle(ptr::SUNMatrix,M::T) where T<:SundialsMatrix - h = new{T}(ptr,false) + function MatrixHandle(ptr::SUNMatrix, M::T) where {T <: SundialsMatrix} + h = new{T}(ptr, false) finalizer(release_handle, h) return h end end -mutable struct LinSolHandle{T<:SundialsLinearSolver} <: SundialsHandle +mutable struct LinSolHandle{T <: SundialsLinearSolver} <: SundialsHandle ptr::SUNLinearSolver destroyed::Bool - function LinSolHandle(ptr::SUNLinearSolver,M::T) where T<:SundialsLinearSolver - h = new{T}(ptr,false) + function LinSolHandle(ptr::SUNLinearSolver, M::T) where {T <: SundialsLinearSolver} + h = new{T}(ptr, false) finalizer(release_handle, h) return h end end -mutable struct NonLinSolHandle{T<:SundialsNonLinearSolver} <: SundialsHandle +mutable struct NonLinSolHandle{T <: SundialsNonLinearSolver} <: SundialsHandle ptr::SUNNonlinearSolver destroyed::Bool - function NonLinSolHandle(ptr::SUNNonlinearSolver,M::T) where T<:SundialsNonLinearSolver - h = new{T}(ptr,false) + function NonLinSolHandle( + ptr::SUNNonlinearSolver, + M::T, + ) where {T <: SundialsNonLinearSolver} + h = new{T}(ptr, false) finalizer(release_handle, h) return h end end -Base.unsafe_convert(::Type{Ptr{T}}, h::Handle{T}) where T = h.ptr_ref[] -Base.unsafe_convert(::Type{Ptr{Cvoid}}, h::Handle{T}) where T = Ptr{Cvoid}(h.ptr_ref[]) -Base.convert(::Type{Ptr{T}}, h::Handle{T}) where T = h.ptr_ref[] -Base.convert(::Type{Ptr{Ptr{T}}}, h::Handle{T}) where {T} = convert(Ptr{Ptr{T}}, h.ptr_ref[]) - -release_handle(ptr_ref::Ref{Ptr{T}}) where {T} = throw(MethodError("Freeing objects of type $T not supported")) -release_handle(ptr_ref::Ref{Ptr{KINMem}}) = ((ptr_ref[] != C_NULL) && KINFree(ptr_ref); nothing) -release_handle(ptr_ref::Ref{Ptr{CVODEMem}}) = ((ptr_ref[] != C_NULL) && CVodeFree(ptr_ref); nothing) -release_handle(ptr_ref::Ref{Ptr{ARKStepMem}}) = ((ptr_ref[] != C_NULL) && ARKStepFree(ptr_ref); nothing) -release_handle(ptr_ref::Ref{Ptr{ERKStepMem}}) = ((ptr_ref[] != C_NULL) && ERKStepFree(ptr_ref); nothing) -release_handle(ptr_ref::Ref{Ptr{MRIStepMem}}) = ((ptr_ref[] != C_NULL) && MRIStepFree(ptr_ref); nothing) -release_handle(ptr_ref::Ref{Ptr{IDAMem}}) = ((ptr_ref[] != C_NULL) && IDAFree(ptr_ref); nothing) +Base.unsafe_convert(::Type{Ptr{T}}, h::Handle{T}) where {T} = h.ptr_ref[] +Base.unsafe_convert(::Type{Ptr{Cvoid}}, h::Handle{T}) where {T} = Ptr{Cvoid}(h.ptr_ref[]) +Base.convert(::Type{Ptr{T}}, h::Handle{T}) where {T} = h.ptr_ref[] +Base.convert(::Type{Ptr{Ptr{T}}}, h::Handle{T}) where {T} = + convert(Ptr{Ptr{T}}, h.ptr_ref[]) + +release_handle(ptr_ref::Ref{Ptr{T}}) where {T} = + throw(MethodError("Freeing objects of type $T not supported")) +release_handle(ptr_ref::Ref{Ptr{KINMem}}) = + ((ptr_ref[] != C_NULL) && KINFree(ptr_ref); nothing) +release_handle(ptr_ref::Ref{Ptr{CVODEMem}}) = + ((ptr_ref[] != C_NULL) && CVodeFree(ptr_ref); nothing) +release_handle(ptr_ref::Ref{Ptr{ARKStepMem}}) = + ((ptr_ref[] != C_NULL) && ARKStepFree(ptr_ref); nothing) +release_handle(ptr_ref::Ref{Ptr{ERKStepMem}}) = + ((ptr_ref[] != C_NULL) && ERKStepFree(ptr_ref); nothing) +release_handle(ptr_ref::Ref{Ptr{MRIStepMem}}) = + ((ptr_ref[] != C_NULL) && MRIStepFree(ptr_ref); nothing) +release_handle(ptr_ref::Ref{Ptr{IDAMem}}) = + ((ptr_ref[] != C_NULL) && IDAFree(ptr_ref); nothing) function release_handle(h::MatrixHandle{DenseMatrix}) if !isempty(h) @@ -226,9 +237,9 @@ Base.isempty(h::NonLinSolHandle) = h.destroyed # ################################################################## -const CVODEh = Handle{CVODEMem} -const ARKSteph = Handle{ARKStepMem} -const ERKSteph = Handle{ERKStepMem} -const MRISteph = Handle{MRIStepMem} -const KINh = Handle{KINMem} -const IDAh = Handle{IDAMem} +const CVODEh = Handle{CVODEMem} +const ARKSteph = Handle{ARKStepMem} +const ERKSteph = Handle{ERKStepMem} +const MRISteph = Handle{MRIStepMem} +const KINh = Handle{KINMem} +const IDAh = Handle{IDAMem} diff --git a/src/nvector_wrapper.jl b/src/nvector_wrapper.jl index 4ea3c3c5..bdb06710 100644 --- a/src/nvector_wrapper.jl +++ b/src/nvector_wrapper.jl @@ -25,8 +25,8 @@ struct NVector <: DenseVector{realtype} end end -NVector(v::AbstractArray) = convert(Vector,v) -N_Vector(x::NVector) = convert(N_Vector,x) +NVector(v::AbstractArray) = convert(Vector, v) +N_Vector(x::NVector) = convert(N_Vector, x) release_handle(ref_nv::Ref{N_Vector}) = N_VDestroy_Serial(ref_nv[]) @@ -50,13 +50,14 @@ Base.pointer(nv::NVector) = Sundials.N_VGetArrayPointer_Serial(nv.ref_nv[]) ################################################################## Base.convert(::Type{NVector}, v::Vector{realtype}) = NVector(v) -Base.convert(::Type{NVector}, v::Vector{T}) where {T<:Real} = NVector(copy!(similar(v, realtype), v)) -Base.convert(::Type{NVector}, v::AbstractVector) = NVector(convert(Array,v)) +Base.convert(::Type{NVector}, v::Vector{T}) where {T <: Real} = + NVector(copy!(similar(v, realtype), v)) +Base.convert(::Type{NVector}, v::AbstractVector) = NVector(convert(Array, v)) Base.convert(::Type{NVector}, nv::NVector) = nv Base.convert(::Type{NVector}, nv::N_Vector) = NVector(nv) Base.convert(::Type{N_Vector}, nv::NVector) = nv.ref_nv[] -Base.convert(::Type{Vector{realtype}}, nv::NVector)= nv.v -Base.convert(::Type{Vector}, nv::NVector)= nv.v +Base.convert(::Type{Vector{realtype}}, nv::NVector) = nv.v +Base.convert(::Type{Vector}, nv::NVector) = nv.v """ `N_Vector(v::Vector{T})` @@ -66,16 +67,18 @@ Base.convert(::Type{Vector}, nv::NVector)= nv.v destruction of `N_Vector` object when no longer in use. """ Base.convert(::Type{N_Vector}, v::Vector{realtype}) = N_Vector(NVector(v)) -Base.convert(::Type{N_Vector}, v::Vector{T}) where {T<:Real} = N_Vector(NVector(v)) +Base.convert(::Type{N_Vector}, v::Vector{T}) where {T <: Real} = N_Vector(NVector(v)) Base.similar(nv::NVector) = NVector(similar(nv.v)) nvlength(x::N_Vector) = unsafe_load(unsafe_load(convert(Ptr{Ptr{Clong}}, x))) # asarray() creates an array pointing to N_Vector data, but does not take the ownership -@inline asarray(x::N_Vector) = unsafe_wrap(Array, N_VGetArrayPointer_Serial(x), (nvlength(x),), own=false) -@inline asarray(x::N_Vector, dims::Tuple) = unsafe_wrap(Array, N_VGetArrayPointer_Serial(x), dims, own=false) +@inline asarray(x::N_Vector) = + unsafe_wrap(Array, N_VGetArrayPointer_Serial(x), (nvlength(x),), own = false) +@inline asarray(x::N_Vector, dims::Tuple) = + unsafe_wrap(Array, N_VGetArrayPointer_Serial(x), dims, own = false) asarray(x::Vector{realtype}) = x -asarray(x::Ptr{realtype}, dims::Tuple) = unsafe_wrap(Array, x, dims, own=false) +asarray(x::Ptr{realtype}, dims::Tuple) = unsafe_wrap(Array, x, dims, own = false) @inline Base.convert(::Type{Vector{realtype}}, x::N_Vector) = asarray(x) @inline Base.convert(::Type{Vector}, x::N_Vector) = asarray(x) diff --git a/src/simple.jl b/src/simple.jl index ef205793..75aec404 100644 --- a/src/simple.jl +++ b/src/simple.jl @@ -8,7 +8,7 @@ Insert a check that the given function call returns 0, throw an error otherwise. Only apply directly to function calls. """ -macro checkflag(ex,throw_error=false) +macro checkflag(ex, throw_error = false) @assert Base.Meta.isexpr(ex, :call) fname = ex.args[1] quote @@ -44,9 +44,14 @@ function kinsolfun(y::N_Vector, fy::N_Vector, userfun) return KIN_SUCCESS end -function kinsol(f, y0::Vector{Float64}; - userdata::Any = nothing, - linear_solver=:Dense, jac_upper=0, jac_lower=0) +function kinsol( + f, + y0::Vector{Float64}; + userdata::Any = nothing, + linear_solver = :Dense, + jac_upper = 0, + jac_lower = 0, +) # f, Function to be optimized of the form f(y::Vector{Float64}, fy::Vector{Float64}) # where `y` is the input vector, and `fy` is the result of the function # y0, Vector of initial values @@ -65,11 +70,11 @@ function kinsol(f, y0::Vector{Float64}; end flag = @checkflag KINInit(kmem, getcfun(userfun), NVector(y0)) true if linear_solver == :Dense - A = Sundials.SUNDenseMatrix(length(y0),length(y0)) - LS = Sundials.SUNLinSol_Dense(y0,A) + A = Sundials.SUNDenseMatrix(length(y0), length(y0)) + LS = Sundials.SUNLinSol_Dense(y0, A) elseif linear_solver == :Band A = Sundials.SUNBandMatrix(length(y0), jac_upper, jac_lower) - LS = Sundials.SUNLinSol_Band(y0,A) + LS = Sundials.SUNLinSol_Band(y0, A) end flag = @checkflag Sundials.KINDlsSetLinearSolver(kmem, LS, A) true flag = @checkflag KINSetUserData(kmem, userfun) true @@ -116,17 +121,32 @@ end return: a solution matrix with time steps in `t` along rows and state variable `y` along columns """ -function cvode(f::Function, y0::Vector{Float64}, t::AbstractVector, userdata::Any=nothing; kwargs...) +function cvode( + f::Function, + y0::Vector{Float64}, + t::AbstractVector, + userdata::Any = nothing; + kwargs..., +) y = zeros(length(t), length(y0)) n = cvode!(f, y, y0, t, userdata; kwargs...) - return y[1:n,:] + return y[1:n, :] end -function cvode!(f::Function, y::Matrix{Float64}, y0::Vector{Float64}, t::AbstractVector, userdata::Any=nothing; - integrator=:BDF, reltol::Float64=1e-3, abstol::Float64=1e-6, callback=(x,y,z)->true) - if integrator==:BDF +function cvode!( + f::Function, + y::Matrix{Float64}, + y0::Vector{Float64}, + t::AbstractVector, + userdata::Any = nothing; + integrator = :BDF, + reltol::Float64 = 1e-3, + abstol::Float64 = 1e-6, + callback = (x, y, z) -> true, +) + if integrator == :BDF mem_ptr = CVodeCreate(CV_BDF) - elseif integrator==:Adams + elseif integrator == :Adams mem_ptr = CVodeCreate(CV_ADAMS) end @@ -145,11 +165,11 @@ function cvode!(f::Function, y::Matrix{Float64}, y0::Vector{Float64}, t::Abstrac flag = @checkflag CVodeSetUserData(mem, userfun) true flag = @checkflag CVodeSStolerances(mem, reltol, abstol) true - A = Sundials.SUNDenseMatrix(length(y0),length(y0)) - LS = Sundials.SUNLinSol_Dense(y0nv,A) + A = Sundials.SUNDenseMatrix(length(y0), length(y0)) + LS = Sundials.SUNLinSol_Dense(y0nv, A) flag = Sundials.@checkflag Sundials.CVDlsSetLinearSolver(mem, LS, A) true - y[1,:] = y0 + y[1, :] = y0 ynv = NVector(copy(y0)) tout = [0.0] for k in 2:length(t) @@ -157,7 +177,7 @@ function cvode!(f::Function, y::Matrix{Float64}, y0::Vector{Float64}, t::Abstrac if !callback(mem, t[k], ynv) break end - y[k,:] = convert(Vector, ynv) + y[k, :] = convert(Vector, ynv) c = c + 1 end @@ -168,8 +188,20 @@ function cvode!(f::Function, y::Matrix{Float64}, y0::Vector{Float64}, t::Abstrac return c end -function idasolfun(t::Float64, y::N_Vector, yp::N_Vector, r::N_Vector, userfun::UserFunctionAndData) - userfun.func(t, convert(Vector, y), convert(Vector, yp), convert(Vector, r), userfun.data) +function idasolfun( + t::Float64, + y::N_Vector, + yp::N_Vector, + r::N_Vector, + userfun::UserFunctionAndData, +) + userfun.func( + t, + convert(Vector, y), + convert(Vector, yp), + convert(Vector, r), + userfun.data, + ) return IDA_SUCCESS end @@ -195,8 +227,16 @@ end return: (y,yp) two solution matrices representing the states and state derivatives with time steps in `t` along rows and state variable `y` or `yp` along columns """ -function idasol(f, y0::Vector{Float64}, yp0::Vector{Float64}, t::Vector{Float64}, userdata::Any=nothing; - reltol::Float64=1e-3, abstol::Float64=1e-6, diffstates::Union{Vector{Bool},Nothing}=nothing) +function idasol( + f, + y0::Vector{Float64}, + yp0::Vector{Float64}, + t::Vector{Float64}, + userdata::Any = nothing; + reltol::Float64 = 1e-3, + abstol::Float64 = 1e-6, + diffstates::Union{Vector{Bool}, Nothing} = nothing, +) mem_ptr = IDACreate() (mem_ptr == C_NULL) && error("Failed to allocate IDA solver object") mem = Handle(mem_ptr) @@ -209,13 +249,12 @@ function idasol(f, y0::Vector{Float64}, yp0::Vector{Float64}, t::Vector{Float64} function getcfun(userfun::T) where {T} @cfunction(idasolfun, Cint, (realtype, N_Vector, N_Vector, N_Vector, Ref{T})) end - flag = @checkflag IDAInit(mem, getcfun(userfun), - t[1], y0, yp0) true + flag = @checkflag IDAInit(mem, getcfun(userfun), t[1], y0, yp0) true flag = @checkflag IDASetUserData(mem, userfun) true flag = @checkflag IDASStolerances(mem, reltol, abstol) true - A = Sundials.SUNDenseMatrix(length(y0),length(y0)) - LS = Sundials.SUNLinSol_Dense(y0,A) + A = Sundials.SUNDenseMatrix(length(y0), length(y0)) + LS = Sundials.SUNLinSol_Dense(y0, A) flag = Sundials.@checkflag Sundials.IDADlsSetLinearSolver(mem, LS, A) true rtest = zeros(length(y0)) @@ -227,15 +266,15 @@ function idasol(f, y0::Vector{Float64}, yp0::Vector{Float64}, t::Vector{Float64} flag = @checkflag IDASetId(mem, collect(Float64, diffstates)) true flag = @checkflag IDACalcIC(mem, IDA_YA_YDP_INIT, t[2]) true end - yres[1,:] = y0 - ypres[1,:] = yp0 + yres[1, :] = y0 + ypres[1, :] = yp0 y = copy(y0) yp = copy(yp0) tout = [0.0] for k in 2:length(t) retval = @checkflag IDASolve(mem, t[k], tout, y, yp, IDA_NORMAL) true - yres[k,:] = y - ypres[k,:] = yp + yres[k, :] = y + ypres[k, :] = yp end empty!(mem) diff --git a/src/types_and_consts_additions.jl b/src/types_and_consts_additions.jl index 4cf4b067..48dc4888 100644 --- a/src/types_and_consts_additions.jl +++ b/src/types_and_consts_additions.jl @@ -3,36 +3,40 @@ function Base.convert(::Type{Matrix}, J::DlsMat) _dlsmat = unsafe_load(J) # own is false as memory is allocated by sundials - unsafe_wrap(Array, _dlsmat.data, (_dlsmat.M, _dlsmat.N), own=false) + unsafe_wrap(Array, _dlsmat.data, (_dlsmat.M, _dlsmat.N), own = false) end CVRhsFn_wrapper(fp::CVRhsFn) = fp -CVRhsFn_wrapper(f) = @cfunction($f,Cint,(realtype,N_Vector,N_Vector,Ptr{Cvoid})).ptr +CVRhsFn_wrapper(f) = @cfunction($f, Cint, (realtype, N_Vector, N_Vector, Ptr{Cvoid})).ptr ARKRhsFn_wrapper(fp::ARKRhsFn) = fp -ARKRhsFn_wrapper(f) = @cfunction($f,Cint,(realtype,N_Vector,N_Vector,Ptr{Cvoid})).ptr +ARKRhsFn_wrapper(f) = @cfunction($f, Cint, (realtype, N_Vector, N_Vector, Ptr{Cvoid})).ptr CVRootFn_wrapper(fp::CVRootFn) = fp -CVRootFn_wrapper(f) = @cfunction($f,Cint,(realtype,N_Vector,Ptr{realtype},Ptr{Cvoid})).ptr +CVRootFn_wrapper(f) = + @cfunction($f, Cint, (realtype, N_Vector, Ptr{realtype}, Ptr{Cvoid})).ptr CVQuadRhsFn_wrapper(fp::CVQuadRhsFn) = fp -CVQuadRhsFn_wrapper(f) = @cfunction($f,Cint,(realtype,N_Vector,N_Vector,Ptr{Cvoid})).ptr +CVQuadRhsFn_wrapper(f) = + @cfunction($f, Cint, (realtype, N_Vector, N_Vector, Ptr{Cvoid})).ptr IDAResFn_wrapper(fp::IDAResFn) = fp -IDAResFn_wrapper(f) = @cfunction($f,Cint,(realtype,N_Vector,N_Vector,N_Vector,Ptr{Cvoid})).ptr +IDAResFn_wrapper(f) = + @cfunction($f, Cint, (realtype, N_Vector, N_Vector, N_Vector, Ptr{Cvoid})).ptr IDARootFn_wrapper(fp::IDARootFn) = fp -IDARootFn_wrapper(f) = @cfunction($f,Cint,(realtype,N_Vector,N_Vector,Ptr{realtype},Ptr{Cvoid})).ptr +IDARootFn_wrapper(f) = + @cfunction($f, Cint, (realtype, N_Vector, N_Vector, Ptr{realtype}, Ptr{Cvoid})).ptr KINSysFn_wrapper(fp::KINSysFn) = fp -KINSysFn_wrapper(f) = @cfunction($f,Cint,(N_Vector,N_Vector,Ptr{Cvoid})).ptr +KINSysFn_wrapper(f) = @cfunction($f, Cint, (N_Vector, N_Vector, Ptr{Cvoid})).ptr function Base.convert(::Type{Matrix}, J::SUNMatrix) _sunmat = unsafe_load(J) _mat = convert(SUNMatrixContent_Dense, _sunmat.content) mat = unsafe_load(_mat) # own is false as memory is allocated by sundials - unsafe_wrap(Array, mat.data, (mat.M, mat.N), own=false) + unsafe_wrap(Array, mat.data, (mat.M, mat.N), own = false) end function Base.convert(::Type{SparseArrays.SparseMatrixCSC}, J::SUNMatrix) @@ -41,13 +45,13 @@ function Base.convert(::Type{SparseArrays.SparseMatrixCSC}, J::SUNMatrix) mat = unsafe_load(_mat) # own is false as memory is allocated by sundials # TODO: Get rid of allocation for 1-based index change - rowval = unsafe_wrap(Array, mat.indexvals, (mat.NNZ), own=false) - colptr = unsafe_wrap(Array, mat.indexptrs, (mat.NP+1), own=false) + rowval = unsafe_wrap(Array, mat.indexvals, (mat.NNZ), own = false) + colptr = unsafe_wrap(Array, mat.indexptrs, (mat.NP + 1), own = false) colptr .+= 1 m = mat.M n = mat.N - nzval = unsafe_wrap(Array,mat.data, (mat.NNZ), own=false) - SparseArrays.SparseMatrixCSC(m,n,colptr,rowval,nzval) + nzval = unsafe_wrap(Array, mat.data, (mat.NNZ), own = false) + SparseArrays.SparseMatrixCSC(m, n, colptr, rowval, nzval) end abstract type SundialsMatrix end diff --git a/test/arkstep_Roberts_dns.jl b/test/arkstep_Roberts_dns.jl index 6779b30f..923c0cf1 100644 --- a/test/arkstep_Roberts_dns.jl +++ b/test/arkstep_Roberts_dns.jl @@ -5,8 +5,8 @@ using Sundials, Test function f(t, y_nv, ydot_nv, user_data) y = convert(Vector, y_nv) ydot = convert(Vector, ydot_nv) - ydot[1] = -0.04*y[1] + 1.0e4*y[2]*y[3] - ydot[3] = 3.0e7*y[2]*y[2] + ydot[1] = -0.04 * y[1] + 1.0e4 * y[2] * y[3] + ydot[3] = 3.0e7 * y[2] * y[2] ydot[2] = -ydot[1] - ydot[3] return Sundials.ARK_SUCCESS end @@ -33,8 +33,8 @@ Sundials.@checkflag Sundials.ARKStepSetMaxNumSteps(arkStep_mem, 100000) Sundials.@checkflag Sundials.ARKStepSetPredictorMethod(arkStep_mem, 1) Sundials.@checkflag Sundials.ARKStepSStolerances(arkStep_mem, reltol, abstol) -A = Sundials.SUNDenseMatrix(neq,neq) -LS = Sundials.SUNLinSol_Dense(y0,A) +A = Sundials.SUNDenseMatrix(neq, neq) +LS = Sundials.SUNLinSol_Dense(y0, A) Sundials.@checkflag Sundials.ARKStepSetLinearSolver(arkStep_mem, LS, A) iout = 0 diff --git a/test/common_interface/arkode.jl b/test/common_interface/arkode.jl index 902a8b45..626c64fc 100644 --- a/test/common_interface/arkode.jl +++ b/test/common_interface/arkode.jl @@ -1,28 +1,37 @@ using Sundials, Test using DiffEqProblemLibrary -using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; importodeproblems() +using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; +importodeproblems(); import DiffEqProblemLibrary.ODEProblemLibrary: prob_ode_linear, prob_ode_2Dlinear prob = prob_ode_linear -dt = 1//2^(4) -sol = solve(prob,ARKODE()) +dt = 1 // 2^(4) +sol = solve(prob, ARKODE()) @test sol.errors[:l2] < 5e-2 -sol = solve(prob,ARKODE(),abstol=[1e-7]) +sol = solve(prob, ARKODE(), abstol = [1e-7]) -f1 = (du,u,p,t) -> du .= u -f2 = (du,u,p,t) -> du .= u +f1 = (du, u, p, t) -> du .= u +f2 = (du, u, p, t) -> du .= u prob = prob_ode_2Dlinear -dt = 1//2^(4) -sol = solve(prob,ARKODE(linear_solver=:LapackDense)) +dt = 1 // 2^(4) +sol = solve(prob, ARKODE(linear_solver = :LapackDense)) -prob = SplitODEProblem(SplitFunction(f1,f2,analytic=(u0,p,t)->exp(2t)*u0), - rand(4,2),(0.0,1.0)) +prob = SplitODEProblem( + SplitFunction(f1, f2, analytic = (u0, p, t) -> exp(2t) * u0), + rand(4, 2), + (0.0, 1.0), +) -sol = solve(prob,ARKODE(linear_solver=:Dense)) +sol = solve(prob, ARKODE(linear_solver = :Dense)) @test sol.errors[:l2] < 1e-2 -sol = solve(prob,ARKODE(linear_solver=:LapackBand,jac_upper=3,jac_lower=3),reltol=1e-12,abstol=1e-12) +sol = solve( + prob, + ARKODE(linear_solver = :LapackBand, jac_upper = 3, jac_lower = 3), + reltol = 1e-12, + abstol = 1e-12, +) @test sol.errors[:l2] < 1e-6 # @@ -31,26 +40,28 @@ sol = solve(prob,ARKODE(linear_solver=:LapackBand,jac_upper=3,jac_lower=3),relto # ARKStepSetERKTableNum not defined # # Function -function Eq_Dif(dq,q,t) - dq .= 10*q +function Eq_Dif(dq, q, t) + dq .= 10 * q end # Alias -fn(dq,q,p,t) = Eq_Dif(dq,q,t) +fn(dq, q, p, t) = Eq_Dif(dq, q, t) # Time span tspan = (0.0, 1.0) # Initial values q = zeros(10) # Define problem -prob = ODEProblem(fn,q,tspan) +prob = ODEProblem(fn, q, tspan) # Define solution method -method = ARKODE(Sundials.Explicit(), - etable = Sundials.VERNER_8_5_6, - order = 8, - set_optimal_params = false, - max_hnil_warns = 10, - max_error_test_failures = 7, - max_nonlinear_iters = 4, - max_convergence_failures = 10) +method = ARKODE( + Sundials.Explicit(), + etable = Sundials.VERNER_8_5_6, + order = 8, + set_optimal_params = false, + max_hnil_warns = 10, + max_error_test_failures = 7, + max_nonlinear_iters = 4, + max_convergence_failures = 10, +) # Solve -sol = solve(prob,method) +sol = solve(prob, method) @test sol.retcode == :Success diff --git a/test/common_interface/callbacks.jl b/test/common_interface/callbacks.jl index bc95c1b2..d56664d7 100644 --- a/test/common_interface/callbacks.jl +++ b/test/common_interface/callbacks.jl @@ -1,65 +1,65 @@ using Sundials, Test callback_f = function (du, u, p, t) - du[1] = u[2] - du[2] = -9.81 + du[1] = u[2] + du[2] = -9.81 end -condtion= function (u,t,integrator) # Event when event_f(u,t,k) == 0 - u[1] +condtion = function (u, t, integrator) # Event when event_f(u,t,k) == 0 + u[1] end affect! = nothing affect_neg! = function (integrator) - integrator.u[2] = -integrator.u[2] + integrator.u[2] = -integrator.u[2] end -callback = ContinuousCallback(condtion,affect!,affect_neg!) +callback = ContinuousCallback(condtion, affect!, affect_neg!) -u0 = [50.0,0.0] -tspan = (0.0,15.0) -prob = ODEProblem(callback_f,u0,tspan) +u0 = [50.0, 0.0] +tspan = (0.0, 15.0) +prob = ODEProblem(callback_f, u0, tspan) -sol = solve(prob,CVODE_Adams(),callback=callback) +sol = solve(prob, CVODE_Adams(), callback = callback) @test sol(4.0)[1] > 0 -sol = solve(prob,CVODE_BDF(),callback=callback) +sol = solve(prob, CVODE_BDF(), callback = callback) @test sol(4.0)[1] > 0 -condition = function (out,u,t,integrator) - out[1] = u[1] +condition = function (out, u, t, integrator) + out[1] = u[1] end affect! = nothing affect_neg! = function (integrator, idx) - if idx == 1 - integrator.u[2] = -integrator.u[2] - end + if idx == 1 + integrator.u[2] = -integrator.u[2] + end end callback = VectorContinuousCallback(condition, affect!, affect_neg!, 1) -sol = solve(prob,CVODE_Adams(),callback=callback) +sol = solve(prob, CVODE_Adams(), callback = callback) @test sol(4.0)[1] > 0 -sol = solve(prob,CVODE_BDF(),callback=callback) +sol = solve(prob, CVODE_BDF(), callback = callback) @test sol(4.0)[1] > 0 -u0 = [1.,0.] +u0 = [1.0, 0.0] function fun2(du, u, p, t) - du[2] = -u[1] - du[1] = u[2] + du[2] = -u[1] + du[1] = u[2] end -tspan = (0.0,10.0) -prob = ODEProblem(fun2,u0,tspan) +tspan = (0.0, 10.0) +prob = ODEProblem(fun2, u0, tspan) -function condition2(u,t,integrator) - get_du(integrator)[1]>0 +function condition2(u, t, integrator) + get_du(integrator)[1] > 0 end affect2!(integrator) = terminate!(integrator) -cb = DiscreteCallback(condition2,affect2!) -sol = solve(prob,CVODE_BDF(),callback=cb) +cb = DiscreteCallback(condition2, affect2!) +sol = solve(prob, CVODE_BDF(), callback = cb) @test sol.t[end] < 3.5 -condition3(u,t,integrator) = u[2] +condition3(u, t, integrator) = u[2] affect3!(integrator) = terminate!(integrator) -cb = ContinuousCallback(condition3,affect3!) -sol = solve(prob,CVODE_Adams(),callback=cb,abstol=1e-12,reltol=1e-12) +cb = ContinuousCallback(condition3, affect3!) +sol = solve(prob, CVODE_Adams(), callback = cb, abstol = 1e-12, reltol = 1e-12) @test sol.t[end] ≈ pi diff --git a/test/common_interface/cvode.jl b/test/common_interface/cvode.jl index 029658fe..31c7e2cd 100644 --- a/test/common_interface/cvode.jl +++ b/test/common_interface/cvode.jl @@ -1,112 +1,119 @@ using Sundials, Test using DiffEqProblemLibrary -using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; importodeproblems() +using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; +importodeproblems(); import DiffEqProblemLibrary.ODEProblemLibrary: prob_ode_linear, prob_ode_2Dlinear prob = prob_ode_linear -dt = 1//2^(4) +dt = 1 // 2^(4) saveat = float(collect(0:dt:1)) -sol = solve(prob,CVODE_BDF()) -sol = solve(prob,CVODE_Adams()) +sol = solve(prob, CVODE_BDF()) +sol = solve(prob, CVODE_Adams()) @test sol.errors[:l2] < 1e-3 -sol = solve(prob,CVODE_Adams(),reltol=1e-5) +sol = solve(prob, CVODE_Adams(), reltol = 1e-5) @test sol.errors[:l2] < 1e-5 -sol = solve(prob,CVODE_Adams(),reltol=1e-5,abstol=[1e-7]) -sol = solve(prob,CVODE_Adams(),saveat=saveat) +sol = solve(prob, CVODE_Adams(), reltol = 1e-5, abstol = [1e-7]) +sol = solve(prob, CVODE_Adams(), saveat = saveat) @test sol.t == saveat -sol = solve(prob,CVODE_Adams(),saveat=dt) +sol = solve(prob, CVODE_Adams(), saveat = dt) @test sol.t == saveat -sol = solve(prob,CVODE_Adams(),saveat=saveat,save_everystep=true) +sol = solve(prob, CVODE_Adams(), saveat = saveat, save_everystep = true) @test sol.t != saveat -@test intersect(sol.t,saveat) == saveat +@test intersect(sol.t, saveat) == saveat -sol = solve(prob,CVODE_Adams(),saveat=saveat,save_everystep=true,save_start=false) +sol = solve(prob, CVODE_Adams(), saveat = saveat, save_everystep = true, save_start = false) @test sol.t[1] != 0 -sol = solve(prob,CVODE_Adams(),tstops=[0.2,0.5,0.7]) -@test all(t ∈ sol.t for t in [0.2,0.5,0.7]) +sol = solve(prob, CVODE_Adams(), tstops = [0.2, 0.5, 0.7]) +@test all(t ∈ sol.t for t in [0.2, 0.5, 0.7]) prob = prob_ode_2Dlinear -sol = solve(prob,CVODE_BDF()) -sol = solve(prob,CVODE_Adams()) -sol = solve(prob,CVODE_Adams(),saveat=saveat) +sol = solve(prob, CVODE_BDF()) +sol = solve(prob, CVODE_Adams()) +sol = solve(prob, CVODE_Adams(), saveat = saveat) @test sol.t == saveat -sol = solve(prob,CVODE_Adams(),saveat=[prob.tspan[2]]) +sol = solve(prob, CVODE_Adams(), saveat = [prob.tspan[2]]) @test sol.t == [prob.tspan[2]] -sol = solve(prob,CVODE_Adams(),saveat=saveat,save_everystep=false) +sol = solve(prob, CVODE_Adams(), saveat = saveat, save_everystep = false) @test sol.t == saveat -sol = solve(prob,CVODE_Adams(),tstops=[0.9]) +sol = solve(prob, CVODE_Adams(), tstops = [0.9]) @test 0.9 ∈ sol.t # Test the other function conversions k = (du, u, p, t) -> du[1] = u[1] -prob = ODEProblem(k,[1.0],(0.0,1.0)) -sol = solve(prob,CVODE_BDF()) +prob = ODEProblem(k, [1.0], (0.0, 1.0)) +sol = solve(prob, CVODE_BDF()) h = (u, p, t) -> u -u0 = [1.0 2.0 - 3.0 2.0] -prob = ODEProblem(h,u0,(0.0,1.0)) -sol = solve(prob,CVODE_BDF()) +u0 = [ + 1.0 2.0 + 3.0 2.0 +] +prob = ODEProblem(h, u0, (0.0, 1.0)) +sol = solve(prob, CVODE_BDF()) # Test Algorithm Choices -sol1 = solve(prob,CVODE_BDF(method=:Functional)) -sol2 = solve(prob,CVODE_BDF(linear_solver=:Band,jac_upper=3,jac_lower=3)) -sol3 = solve(prob,CVODE_BDF(linear_solver=:Diagonal)) -sol4 = solve(prob,CVODE_BDF(linear_solver=:GMRES)) -sol5 = solve(prob,CVODE_BDF(linear_solver=:FGMRES)) -sol6 = solve(prob,CVODE_BDF(linear_solver=:PCG)) -sol7 = solve(prob,CVODE_BDF(linear_solver=:BCG)) -sol8 = solve(prob,CVODE_BDF(linear_solver=:TFQMR)) -sol9 = solve(prob,CVODE_BDF(linear_solver=:Dense)) +sol1 = solve(prob, CVODE_BDF(method = :Functional)) +sol2 = solve(prob, CVODE_BDF(linear_solver = :Band, jac_upper = 3, jac_lower = 3)) +sol3 = solve(prob, CVODE_BDF(linear_solver = :Diagonal)) +sol4 = solve(prob, CVODE_BDF(linear_solver = :GMRES)) +sol5 = solve(prob, CVODE_BDF(linear_solver = :FGMRES)) +sol6 = solve(prob, CVODE_BDF(linear_solver = :PCG)) +sol7 = solve(prob, CVODE_BDF(linear_solver = :BCG)) +sol8 = solve(prob, CVODE_BDF(linear_solver = :TFQMR)) +sol9 = solve(prob, CVODE_BDF(linear_solver = :Dense)) #sol9 = solve(prob,CVODE_BDF(linear_solver=:KLU)) # Requires Jacobian -sol10 = solve(prob,CVODE_BDF(linear_solver=:LapackDense)) -sol11 = solve(prob,CVODE_BDF(linear_solver=:LapackBand,jac_upper=3,jac_lower=3)) - -@test isapprox(sol1[end],sol2[end],rtol=1e-3) -@test isapprox(sol1[end],sol3[end],rtol=1e-3) -@test isapprox(sol1[end],sol4[end],rtol=1e-3) -@test isapprox(sol1[end],sol5[end],rtol=1e-3) -@test isapprox(sol1[end],sol6[end],rtol=1e-3) -@test isapprox(sol1[end],sol7[end],rtol=1e-3) -@test isapprox(sol1[end],sol8[end],rtol=1e-3) +sol10 = solve(prob, CVODE_BDF(linear_solver = :LapackDense)) +sol11 = solve(prob, CVODE_BDF(linear_solver = :LapackBand, jac_upper = 3, jac_lower = 3)) + +@test isapprox(sol1[end], sol2[end], rtol = 1e-3) +@test isapprox(sol1[end], sol3[end], rtol = 1e-3) +@test isapprox(sol1[end], sol4[end], rtol = 1e-3) +@test isapprox(sol1[end], sol5[end], rtol = 1e-3) +@test isapprox(sol1[end], sol6[end], rtol = 1e-3) +@test isapprox(sol1[end], sol7[end], rtol = 1e-3) +@test isapprox(sol1[end], sol8[end], rtol = 1e-3) #@test isapprox(sol1[end],sol9[end],rtol=1e-3) # Test identity preconditioner global prec_used = false global psetup_used = false -prec = (z,r,p,t,y,fy,gamma,delta,lr)->(global prec_used=true;z.=r) -psetup = (p,t,u,du,jok,jcurPtr,gamma) -> (global psetup_used = true; jcurPtr[]=false) -sol4 = solve(prob,CVODE_BDF(linear_solver=:GMRES, prec_side = 3, prec=prec)) -@test isapprox(sol1[end],sol4[end],rtol=1e-3) +prec = (z, r, p, t, y, fy, gamma, delta, lr) -> (global prec_used = true; z .= r) +psetup = + (p, t, u, du, jok, jcurPtr, gamma) -> (global psetup_used = true; jcurPtr[] = false) +sol4 = solve(prob, CVODE_BDF(linear_solver = :GMRES, prec_side = 3, prec = prec)) +@test isapprox(sol1[end], sol4[end], rtol = 1e-3) @test prec_used -sol4 = solve(prob,CVODE_BDF(linear_solver=:GMRES, prec_side = 3, prec=prec, psetup=psetup)) -@test isapprox(sol1[end],sol4[end],rtol=1e-3) +sol4 = solve( + prob, + CVODE_BDF(linear_solver = :GMRES, prec_side = 3, prec = prec, psetup = psetup), +) +@test isapprox(sol1[end], sol4[end], rtol = 1e-3) @test psetup_used # Backwards prob = deepcopy(prob_ode_2Dlinear) -prob2 = ODEProblem(prob.f,prob.u0,(1.0,0.0),1.01) -sol = solve(prob2,CVODE_BDF()) +prob2 = ODEProblem(prob.f, prob.u0, (1.0, 0.0), 1.01) +sol = solve(prob2, CVODE_BDF()) @test maximum(diff(sol.t)) < 0 # Make sure all go negative -number_test(u,p,t) = -u^2 + (p[1] + t + p[2])*u + p[2] +number_test(u, p, t) = -u^2 + (p[1] + t + p[2]) * u + p[2] u0 = 0.0; tspan = (0.0, 10) -prob = ODEProblem(number_test,u0,tspan,(2.0,0.01)) -sol = solve(prob,CVODE_BDF()) +prob = ODEProblem(number_test, u0, tspan, (2.0, 0.01)) +sol = solve(prob, CVODE_BDF()) -sol = solve(prob2,CVODE_BDF(), maxiters=1) +sol = solve(prob2, CVODE_BDF(), maxiters = 1) @test length(sol.t) == 2 diff --git a/test/common_interface/errors.jl b/test/common_interface/errors.jl index 0a775e92..abedabd8 100644 --- a/test/common_interface/errors.jl +++ b/test/common_interface/errors.jl @@ -2,16 +2,17 @@ using Sundials, Test println("Test error handling") -f_error(u,p,t) = u/t +f_error(u, p, t) = u / t u0 = 1.0 -prob = ODEProblem(f_error,u0,(0.0,1.0)) -sol = solve(prob,CVODE_BDF()) -sol = solve(prob,CVODE_BDF(),verbose=false) +prob = ODEProblem(f_error, u0, (0.0, 1.0)) +sol = solve(prob, CVODE_BDF()) +sol = solve(prob, CVODE_BDF(), verbose = false) -f_error2(du,u,p,t) = u/t-1 -u0 = 1.0; du0 = 1.0 -prob = DAEProblem(f_error2,u0,du0,(0.0,1.0),differential_vars=[1]) -sol = solve(prob,IDA()) -sol = solve(prob,IDA(),verbose=false) +f_error2(du, u, p, t) = u / t - 1 +u0 = 1.0; +du0 = 1.0; +prob = DAEProblem(f_error2, u0, du0, (0.0, 1.0), differential_vars = [1]) +sol = solve(prob, IDA()) +sol = solve(prob, IDA(), verbose = false) @test sol.retcode == :InitialFailure diff --git a/test/common_interface/ida.jl b/test/common_interface/ida.jl index 0a38acdc..69d25641 100644 --- a/test/common_interface/ida.jl +++ b/test/common_interface/ida.jl @@ -1,85 +1,81 @@ using DiffEqProblemLibrary, Sundials, Test -using DiffEqProblemLibrary.DAEProblemLibrary: importdaeproblems; importdaeproblems() +using DiffEqProblemLibrary.DAEProblemLibrary: importdaeproblems; +importdaeproblems(); using DiffEqProblemLibrary.DAEProblemLibrary: prob_dae_resrob # Test DAE prob = prob_dae_resrob dt = 1000 saveat = float(collect(0:dt:100000)) -sol = solve(prob,IDA()) +sol = solve(prob, IDA()) @info "Multiple abstol" -sol = solve(prob,IDA(),abstol=[1e-9,1e-8,1e-7]) +sol = solve(prob, IDA(), abstol = [1e-9, 1e-8, 1e-7]) @info "Band solver" -sol2 = solve(prob,IDA(linear_solver=:Band,jac_upper=2,jac_lower=2)) +sol2 = solve(prob, IDA(linear_solver = :Band, jac_upper = 2, jac_lower = 2)) @info "GMRES solver" -sol3 = solve(prob,IDA(linear_solver=:GMRES)) +sol3 = solve(prob, IDA(linear_solver = :GMRES)) #sol4 = solve(prob,IDA(linear_solver=:BCG)) # Fails but doesn't throw an error? @info "TFQMR solver" -sol5 = solve(prob,IDA(linear_solver=:TFQMR)) +sol5 = solve(prob, IDA(linear_solver = :TFQMR)) @info "FGMRES solver" -sol6 = solve(prob,IDA(linear_solver=:FGMRES)) +sol6 = solve(prob, IDA(linear_solver = :FGMRES)) @info "PCG solver" -sol7 = solve(prob,IDA(linear_solver=:PCG)) # Requires symmetric linear +sol7 = solve(prob, IDA(linear_solver = :PCG)) # Requires symmetric linear #@info "KLU solver" #sol8 = solve(prob,IDA(linear_solver=:KLU)) # Requires Jacobian -sol9 = solve(prob,IDA(linear_solver=:LapackBand,jac_upper=2,jac_lower=2)) -sol10 = solve(prob,IDA(linear_solver=:LapackDense)) -sol11 = solve(prob,IDA(linear_solver=:Dense)) +sol9 = solve(prob, IDA(linear_solver = :LapackBand, jac_upper = 2, jac_lower = 2)) +sol10 = solve(prob, IDA(linear_solver = :LapackDense)) +sol11 = solve(prob, IDA(linear_solver = :Dense)) # Test identity preconditioner global prec_used = false global psetup_used = false -prec = (z,r,p,t,y,fy,resid,gamma,delta,lr)->(global prec_used=true;z.=r) -psetup = (p,t,resid,u,du,gamma) -> (global psetup_used = true) +prec = (z, r, p, t, y, fy, resid, gamma, delta, lr) -> (global prec_used = true; z .= r) +psetup = (p, t, resid, u, du, gamma) -> (global psetup_used = true) @info "GMRES for identity preconditioner" -sol4 = solve(prob,IDA(linear_solver=:GMRES, - prec_side = 3, - prec=prec)) +sol4 = solve(prob, IDA(linear_solver = :GMRES, prec_side = 3, prec = prec)) @test prec_used @info "GMRES with pset" -sol4 = solve(prob,IDA(linear_solver=:GMRES, - prec_side = 3, - prec=prec, - psetup=psetup)) +sol4 = solve(prob, IDA(linear_solver = :GMRES, prec_side = 3, prec = prec, psetup = psetup)) @test psetup_used @info "IDA with saveat" -sol = solve(prob,IDA(),saveat=saveat) +sol = solve(prob, IDA(), saveat = saveat) @test sol.t == saveat @info "IDA with saveat everystep" -sol = solve(prob,IDA(),saveat=saveat,save_everystep=true) +sol = solve(prob, IDA(), saveat = saveat, save_everystep = true) @test sol.t != saveat -@test intersect(sol.t,saveat) == saveat +@test intersect(sol.t, saveat) == saveat @info "IDA with tstops" -sol = solve(prob,IDA(),tstops=[0.9]) +sol = solve(prob, IDA(), tstops = [0.9]) @test 0.9 ∈ sol.t prob = deepcopy(prob_dae_resrob) -prob2 = DAEProblem(prob.f,prob.du0,prob.u0,(1.0,0.0)) -sol = solve(prob2,IDA()) +prob2 = DAEProblem(prob.f, prob.du0, prob.u0, (1.0, 0.0)) +sol = solve(prob2, IDA()) @test maximum(diff(sol.t)) < 0 # Make sure all go negative -function f!(res, du, u, p ,t) - res[1] = du[1]-1.01 +function f!(res, du, u, p, t) + res[1] = du[1] - 1.01 return end -u0 = [0.] +u0 = [0.0] du0 = [1.01] -tspan = (0.0, 10.) +tspan = (0.0, 10.0) println("With consistent initial conditions:") -dae_prob = DAEProblem(f!,du0,u0,tspan, differential_vars=[true]) -sol = solve(dae_prob,IDA()) +dae_prob = DAEProblem(f!, du0, u0, tspan, differential_vars = [true]) +sol = solve(dae_prob, IDA()) println("With inconsistent initial conditions:") -du0 = [0.] +du0 = [0.0] -dae_prob = DAEProblem(f!,du0, u0,tspan, differential_vars=[true]) -sol = solve(dae_prob,IDA()) +dae_prob = DAEProblem(f!, du0, u0, tspan, differential_vars = [true]) +sol = solve(dae_prob, IDA()) diff --git a/test/common_interface/iterators.jl b/test/common_interface/iterators.jl index 31d6c58b..5cf6077a 100644 --- a/test/common_interface/iterators.jl +++ b/test/common_interface/iterators.jl @@ -1,11 +1,12 @@ using DiffEqProblemLibrary, Sundials, Test -using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; importodeproblems() +using DiffEqProblemLibrary.ODEProblemLibrary: importodeproblems; +importodeproblems(); import DiffEqProblemLibrary.ODEProblemLibrary: prob_ode_linear, prob_ode_2Dlinear prob = prob_ode_2Dlinear -integrator = init(prob,CVODE_BDF()) +integrator = init(prob, CVODE_BDF()) step!(integrator) -integrator(integrator.t,Val{1}) +integrator(integrator.t, Val{1}) for i in integrator @info i.t diff --git a/test/common_interface/jacobians.jl b/test/common_interface/jacobians.jl index c7f86738..fe7b0854 100644 --- a/test/common_interface/jacobians.jl +++ b/test/common_interface/jacobians.jl @@ -2,41 +2,43 @@ using Sundials, Test, SparseArrays, DiffEqOperators # Test for Jacobian usage function Lotka(du, u, p, t) - du[1] = u[1] - u[1] * u[2] # REPL[7], line 3: - du[2] = -3 * u[2] + 1 * u[1] * u[2] - nothing + du[1] = u[1] - u[1] * u[2] # REPL[7], line 3: + du[2] = -3 * u[2] + 1 * u[1] * u[2] + nothing end jac_called = false -function Lotka_jac(J,u,p,t) - global jac_called - jac_called = true - J[1,1] = 1.0 - u[2] - J[1,2] = -u[1] - J[2,1] = 1 * u[2] - J[2,2] = -3 + u[1] - nothing +function Lotka_jac(J, u, p, t) + global jac_called + jac_called = true + J[1, 1] = 1.0 - u[2] + J[1, 2] = -u[1] + J[2, 1] = 1 * u[2] + J[2, 2] = -3 + u[1] + nothing end -Lotka_f = ODEFunction(Lotka,jac=Lotka_jac) -prob = ODEProblem(Lotka_f,ones(2),(0.0,10.0)) -good_sol = solve(prob,CVODE_BDF()) +Lotka_f = ODEFunction(Lotka, jac = Lotka_jac) +prob = ODEProblem(Lotka_f, ones(2), (0.0, 10.0)) +good_sol = solve(prob, CVODE_BDF()) @test jac_called == true -Lotka_f = ODEFunction(Lotka,jac=Lotka_jac, - jac_prototype = sparse([1,2,1,2],[1,1,2,2],zeros(4))) +Lotka_f = ODEFunction( + Lotka, + jac = Lotka_jac, + jac_prototype = sparse([1, 2, 1, 2], [1, 1, 2, 2], zeros(4)), +) -prob = ODEProblem(Lotka_f,ones(2),(0.0,10.0)) +prob = ODEProblem(Lotka_f, ones(2), (0.0, 10.0)) jac_called = false -sol9 = solve(prob,CVODE_BDF(linear_solver=:KLU)) +sol9 = solve(prob, CVODE_BDF(linear_solver = :KLU)) @test jac_called == true @test Array(sol9) ≈ Array(good_sol) -Lotka_fj = ODEFunction(Lotka, - jac_prototype = JacVecOperator{Float64}(Lotka,ones(2))) +Lotka_fj = ODEFunction(Lotka, jac_prototype = JacVecOperator{Float64}(Lotka, ones(2))) -prob = ODEProblem(Lotka_fj,ones(2),(0.0,10.0)) -sol9 = solve(prob,CVODE_BDF(linear_solver=:GMRES)) +prob = ODEProblem(Lotka_fj, ones(2), (0.0, 10.0)) +sol9 = solve(prob, CVODE_BDF(linear_solver = :GMRES)) function f2!(res, du, u, p, t) res[1] = 1.01du[1] @@ -50,43 +52,49 @@ function f2_jac!(out, du, u, p, gamma, t) out[1] = 1.01 end -f2_f = DAEFunction(f2!,jac=f2_jac!) +f2_f = DAEFunction(f2!, jac = f2_jac!) -u0 = [0.] -tspan = (0.0, 10.) -du0 = [0.] -dae_prob = DAEProblem(f2_f,du0, u0,tspan, differential_vars=[true]) -good_sol = solve(dae_prob,IDA()) +u0 = [0.0] +tspan = (0.0, 10.0) +du0 = [0.0] +dae_prob = DAEProblem(f2_f, du0, u0, tspan, differential_vars = [true]) +good_sol = solve(dae_prob, IDA()) @test jac_called == true function testjac(res, du, u, p, t) - res[1] = du[1] - 1.5 * u[1] + 1.0 * u[1]*u[2] - res[2] = du[2] +3 * u[2] - u[1]*u[2] + res[1] = du[1] - 1.5 * u[1] + 1.0 * u[1] * u[2] + res[2] = du[2] + 3 * u[2] - u[1] * u[2] end jac_called = false function testjac_jac(J, du, u, p, gamma, t) - global jac_called - jac_called = true - J[1,1] = gamma - 1.5 + 1.0 * u[2] - J[1,2] = 1.0 * u[1] - J[2,1] = - 1 * u[2] - J[2,2] = gamma + 3 - u[1] - nothing + global jac_called + jac_called = true + J[1, 1] = gamma - 1.5 + 1.0 * u[2] + J[1, 2] = 1.0 * u[1] + J[2, 1] = -1 * u[2] + J[2, 2] = gamma + 3 - u[1] + nothing end -testjac_f = DAEFunction(testjac,jac=testjac_jac) +testjac_f = DAEFunction(testjac, jac = testjac_jac) -prob3 = DAEProblem(testjac_f,[0.5,-2.0],ones(2),(0.0,10.0),differential_vars=[true,true]) +prob3 = DAEProblem( + testjac_f, + [0.5, -2.0], + ones(2), + (0.0, 10.0), + differential_vars = [true, true], +) sol3 = solve(prob3, IDA()) @test jac_called == true jac_called = false -prob4 = DAEProblem(testjac,[0.5,-2.0],ones(2),(0.0,10.0)) +prob4 = DAEProblem(testjac, [0.5, -2.0], ones(2), (0.0, 10.0)) sol4 = solve(prob4, IDA()) @test jac_called == false println("Jacobian vs no Jacobian difference:") -println(maximum(sol3-sol4)) -@test maximum(sol3-sol4) < 1e-6 +println(maximum(sol3 - sol4)) +@test maximum(sol3 - sol4) < 1e-6 diff --git a/test/common_interface/mass_matrix.jl b/test/common_interface/mass_matrix.jl index d47d44a9..8132d92e 100644 --- a/test/common_interface/mass_matrix.jl +++ b/test/common_interface/mass_matrix.jl @@ -1,35 +1,39 @@ -using Sundials, Test, LinearAlgebra - -# create mass matrix problems -function make_mm_probs(mm_A, ::Type{Val{iip}}) where iip - # iip - mm_b = vec(sum(mm_A; dims=2)) - function mm_f(du,u,p,t) - LinearAlgebra.mul!(du,mm_A,u) - du .+= t * mm_b - nothing - end - mm_g(du,u,p,t) = (@. du = u + t; nothing) - - # oop - mm_f(u,p,t) = mm_A * (u .+ t) - mm_g(u,p,t) = u .+ t - - mm_analytic(u0, p, t) = @. 2 * u0 * exp(t) - t - 1 - - u0 = ones(3) - tspan = (0.0, 1.0) - - prob = ODEProblem(ODEFunction{iip,true}(mm_f, analytic=mm_analytic, mass_matrix=mm_A), u0, tspan) - prob2 = ODEProblem(ODEFunction{iip,true}(mm_g, analytic=mm_analytic), u0, tspan) - - prob, prob2 -end - -mm_A = Float64[-2 1 4; 4 -2 1; 2 1 3] -prob, prob2 = make_mm_probs(mm_A, Val{true}) - -sol = solve(prob, ARKODE(), abstol=1e-8,reltol=1e-8) -sol2 = solve(prob2, ARKODE(), abstol=1e-8,reltol=1e-8) - -@test norm(sol .- sol2) ≈ 0 atol=1e-7 +using Sundials, Test, LinearAlgebra + +# create mass matrix problems +function make_mm_probs(mm_A, ::Type{Val{iip}}) where {iip} + # iip + mm_b = vec(sum(mm_A; dims = 2)) + function mm_f(du, u, p, t) + LinearAlgebra.mul!(du, mm_A, u) + du .+= t * mm_b + nothing + end + mm_g(du, u, p, t) = (@. du = u + t; nothing) + + # oop + mm_f(u, p, t) = mm_A * (u .+ t) + mm_g(u, p, t) = u .+ t + + mm_analytic(u0, p, t) = @. 2 * u0 * exp(t) - t - 1 + + u0 = ones(3) + tspan = (0.0, 1.0) + + prob = ODEProblem( + ODEFunction{iip, true}(mm_f, analytic = mm_analytic, mass_matrix = mm_A), + u0, + tspan, + ) + prob2 = ODEProblem(ODEFunction{iip, true}(mm_g, analytic = mm_analytic), u0, tspan) + + prob, prob2 +end + +mm_A = Float64[-2 1 4; 4 -2 1; 2 1 3] +prob, prob2 = make_mm_probs(mm_A, Val{true}) + +sol = solve(prob, ARKODE(), abstol = 1e-8, reltol = 1e-8) +sol2 = solve(prob2, ARKODE(), abstol = 1e-8, reltol = 1e-8) + +@test norm(sol .- sol2) ≈ 0 atol = 1e-7 diff --git a/test/cvode_Roberts_dns.jl b/test/cvode_Roberts_dns.jl index 954009e4..de1c70ae 100644 --- a/test/cvode_Roberts_dns.jl +++ b/test/cvode_Roberts_dns.jl @@ -5,13 +5,12 @@ using Sundials function f(t, y_nv, ydot_nv, user_data) y = convert(Vector, y_nv) ydot = convert(Vector, ydot_nv) - ydot[1] = -0.04*y[1] + 1.0e4*y[2]*y[3] - ydot[3] = 3.0e7*y[2]*y[2] + ydot[1] = -0.04 * y[1] + 1.0e4 * y[2] * y[3] + ydot[3] = 3.0e7 * y[2] * y[2] ydot[2] = -ydot[1] - ydot[3] return Sundials.CV_SUCCESS end - ## g routine. Compute functions g_i(t,y) for i = 0,1. function g(t, y_nv, gout_ptr, user_data) @@ -26,17 +25,22 @@ end # broken -- needs a wrapper from Sundials._DlsMat to Matrix and Jac user function wrapper function Jac(N, t, ny, fy, Jptr, user_data, tmp1, tmp2, tmp3) y = convert(Vector, ny) - dlsmat = unpack(IOString(unsafe_wrap(convert(Ptr{UInt8}, Jptr), - (sum(map(sizeof, Sundials._DlsMat))+10,), false)), - Sundials._DlsMat) + dlsmat = unpack( + IOString(unsafe_wrap( + convert(Ptr{UInt8}, Jptr), + (sum(map(sizeof, Sundials._DlsMat)) + 10,), + false, + )), + Sundials._DlsMat, + ) J = unsafe_wrap(unsafe_ref(dlsmat.cols), (Int(neq), Int(neq)), false) - J[1,1] = -0.04 - J[1,2] = 1.0e4*y[3] - J[1,3] = 1.0e4*y[2] - J[2,1] = 0.04 - J[2,2] = -1.0e4*y[3] - 6.0e7*y[2] - J[2,3] = -1.0e4*y[2] - J[3,2] = 6.0e7*y[2] + J[1, 1] = -0.04 + J[1, 2] = 1.0e4 * y[3] + J[1, 3] = 1.0e4 * y[2] + J[2, 1] = 0.04 + J[2, 2] = -1.0e4 * y[3] - 6.0e7 * y[2] + J[2, 3] = -1.0e4 * y[2] + J[3, 2] = 6.0e7 * y[2] return Sundials.CV_SUCCESS end @@ -55,21 +59,22 @@ cvode_mem = Sundials.Handle(mem_ptr) userfun = Sundials.UserFunctionAndData(f, userdata) Sundials.CVodeSetUserData(cvode_mem, userfun) -function getcfunrob(userfun::T) where T - @cfunction(Sundials.cvodefun, - Cint, (Sundials.realtype, Sundials.N_Vector, - Sundials.N_Vector, Ref{T})) +function getcfunrob(userfun::T) where {T} + @cfunction( + Sundials.cvodefun, + Cint, + (Sundials.realtype, Sundials.N_Vector, Sundials.N_Vector, Ref{T}) + ) end -Sundials.CVodeInit(cvode_mem, getcfunrob(userfun), t1, - convert(Sundials.N_Vector, y0)) +Sundials.CVodeInit(cvode_mem, getcfunrob(userfun), t1, convert(Sundials.N_Vector, y0)) Sundials.@checkflag Sundials.CVodeInit(cvode_mem, f, t0, y0) Sundials.@checkflag Sundials.CVodeSVtolerances(cvode_mem, reltol, abstol) Sundials.@checkflag Sundials.CVodeRootInit(cvode_mem, 2, g) -A = Sundials.SUNDenseMatrix(neq,neq) -mat_handle = Sundials.MatrixHandle(A,Sundials.DenseMatrix()) -LS = Sundials.SUNLinSol_Dense(convert(Sundials.N_Vector,y0),A) -LS_handle = Sundials.LinSolHandle(LS,Sundials.Dense()) +A = Sundials.SUNDenseMatrix(neq, neq) +mat_handle = Sundials.MatrixHandle(A, Sundials.DenseMatrix()) +LS = Sundials.SUNLinSol_Dense(convert(Sundials.N_Vector, y0), A) +LS_handle = Sundials.LinSolHandle(LS, Sundials.Dense()) Sundials.@checkflag Sundials.CVDlsSetLinearSolver(cvode_mem, LS, A) #Sundials.@checkflag Sundials.CVDlsSetDenseJacFn(cvode_mem, Jac) @@ -86,8 +91,8 @@ while iout < nout Sundials.@checkflag Sundials.CVodeGetRootInfo(cvode_mem, rootsfound) println("roots=", rootsfound) elseif flag == Sundials.CV_SUCCESS - global iout += 1 - global tout *= tmult + global iout += 1 + global tout *= tmult end end diff --git a/test/cvode_Roberts_simplified.jl b/test/cvode_Roberts_simplified.jl index a1feee97..5581100a 100644 --- a/test/cvode_Roberts_simplified.jl +++ b/test/cvode_Roberts_simplified.jl @@ -3,12 +3,12 @@ using Sundials ## f routine. Compute function f(t,y). function f(t, y, ydot) - ydot[1] = -0.04*y[1] + 1.0e4*y[2]*y[3] - ydot[3] = 3.0e7*y[2]*y[2] + ydot[1] = -0.04 * y[1] + 1.0e4 * y[2] * y[3] + ydot[3] = 3.0e7 * y[2] * y[2] ydot[2] = -ydot[1] - ydot[3] return Sundials.CV_SUCCESS end -t = [0.0; 4 * exp10.(range(-1., stop=7., length=9))] +t = [0.0; 4 * exp10.(range(-1.0, stop = 7.0, length = 9))] y0 = [1.0, 0.0, 0.0] res = Sundials.cvode(f, y0, t) diff --git a/test/cvodes_dns.jl b/test/cvodes_dns.jl index b734bc1f..962964a9 100644 --- a/test/cvodes_dns.jl +++ b/test/cvodes_dns.jl @@ -3,38 +3,38 @@ using Sundials: N_Vector, N_Vector_S using LinearAlgebra function mycopy!(pp, arr::Matrix) - nj = size(arr,2) - ps = unsafe_wrap(Array, pp, nj) - for j = 1:nj - arr[:,j] = Sundials.asarray(ps[j]) - end - arr + nj = size(arr, 2) + ps = unsafe_wrap(Array, pp, nj) + for j in 1:nj + arr[:, j] = Sundials.asarray(ps[j]) + end + arr end function mycopy!(arr::Matrix, pp) - nj = size(arr,2) - ps = unsafe_wrap(Array, pp, nj) - for j = 1:nj - Sundials.asarray(ps[j])[:] = arr[:,j] - end + nj = size(arr, 2) + ps = unsafe_wrap(Array, pp, nj) + for j in 1:nj + Sundials.asarray(ps[j])[:] = arr[:, j] + end end -f!(dy,t,y,p) = (dy[:]=y.*p) - -function srhs(t,y,ydot,ys,ysdot) - n = length(y) - np = 2 - dyt = similar(y) - chunk = min(n, 8) - c1 = ForwardDiff.JacobianConfig(nothing, dyt, dyt, ForwardDiff.Chunk{chunk}()) - c2 = ForwardDiff.JacobianConfig(nothing, dyt, p, ForwardDiff.Chunk{chunk}()) - jac = ForwardDiff.jacobian((dy,y)->f!(dy,t,y,p), dyt, y, c1, Val{false}()) - #jac = ReverseDiff.jacobian!(t1, y) - ysdot[:] = jac * ys - - jac = ForwardDiff.jacobian((dy,p)->f!(dy,t,y,p), dyt, p, c2, Val{false}()) - #jac = ReverseDiff.jacobian!(t2, p) - ysdot[:, 1:np] += jac +f!(dy, t, y, p) = (dy[:] = y .* p) + +function srhs(t, y, ydot, ys, ysdot) + n = length(y) + np = 2 + dyt = similar(y) + chunk = min(n, 8) + c1 = ForwardDiff.JacobianConfig(nothing, dyt, dyt, ForwardDiff.Chunk{chunk}()) + c2 = ForwardDiff.JacobianConfig(nothing, dyt, p, ForwardDiff.Chunk{chunk}()) + jac = ForwardDiff.jacobian((dy, y) -> f!(dy, t, y, p), dyt, y, c1, Val{false}()) + #jac = ReverseDiff.jacobian!(t1, y) + ysdot[:] = jac * ys + + jac = ForwardDiff.jacobian((dy, p) -> f!(dy, t, y, p), dyt, p, c2, Val{false}()) + #jac = ReverseDiff.jacobian!(t2, p) + ysdot[:, 1:np] += jac end """ @@ -45,100 +45,134 @@ y[i, t] is the solutions component i at timestep t. ys[i, j, t] is the i-th component sensivity wrt the j-th parameter at timestep t. ys[i, np+j, t] the i-th component sensivity wrt the j-th initial condition value. """ -function sens(f!::Function, t0::Float64, y0::Vector{Float64}, p::Vector{Float64}, tout::Vector{Float64}; reltol::Float64 = 1e-5, abstol::Float64 = 1e-5) - n = length(y0) - np = length(p) - ys0 = zeros(n,np.+n) - ys0[:, np.+(1:n)] = Matrix(1.0I,n,n) - - #t1 = ReverseDiff.JacobianTape((dy,y)->f!(dy,0,y,p), dyt, y0) - #t2 = ReverseDiff.JacobianTape((dy,p)->f!(dy,0,y0,p), dyt, p) - - pbar = abs.(vcat(p, y0)) - y, ys = cvodes(f!, srhs, t0, y0, ys0, p, reltol, abstol, pbar, tout) +function sens( + f!::Function, + t0::Float64, + y0::Vector{Float64}, + p::Vector{Float64}, + tout::Vector{Float64}; + reltol::Float64 = 1e-5, + abstol::Float64 = 1e-5, +) + n = length(y0) + np = length(p) + ys0 = zeros(n, np .+ n) + ys0[:, np .+ (1:n)] = Matrix(1.0I, n, n) + + #t1 = ReverseDiff.JacobianTape((dy,y)->f!(dy,0,y,p), dyt, y0) + #t2 = ReverseDiff.JacobianTape((dy,p)->f!(dy,0,y0,p), dyt, p) + + pbar = abs.(vcat(p, y0)) + y, ys = cvodes(f!, srhs, t0, y0, ys0, p, reltol, abstol, pbar, tout) end - ### internals ## data structure dealing with the sundials callbacks struct CVSData - f # f(t,y,dy) - fs # fs() - p - jys - jdys + f::Any # f(t,y,dy) + fs::Any # fs() + p::Any + jys::Any + jdys::Any end -CVSData(f, fs, p, n::Int, nS::Int) = CVSData(f, fs, p, Array{Float64}(undef, n, nS), Array{Float64}(undef, n, nS)) +CVSData(f, fs, p, n::Int, nS::Int) = + CVSData(f, fs, p, Array{Float64}(undef, n, nS), Array{Float64}(undef, n, nS)) function cvrhsfn(t::Float64, y::N_Vector, dy::N_Vector, data::CVSData) - data.f(convert(Vector,dy), t, convert(Vector,y), data.p) + data.f(convert(Vector, dy), t, convert(Vector, y), data.p) return Sundials.CV_SUCCESS end -function cvsensrhsfn(ns::Cint, t::Float64, y::N_Vector, dy::N_Vector, ys::N_Vector_S, dys::N_Vector_S, data::CVSData, tmp1::N_Vector, tmp2::N_Vector) +function cvsensrhsfn( + ns::Cint, + t::Float64, + y::N_Vector, + dy::N_Vector, + ys::N_Vector_S, + dys::N_Vector_S, + data::CVSData, + tmp1::N_Vector, + tmp2::N_Vector, +) jys = data.jys jdys = data.jdys mycopy!(ys, data.jys) - data.fs(t, convert(Vector,y), convert(Vector,dy), jys, jdys) + data.fs(t, convert(Vector, y), convert(Vector, dy), jys, jdys) mycopy!(jdys, dys) return Sundials.CV_SUCCESS end - ## cvodes wrapper "Given the sensivity problem, return (y,ys) where y[i,t] is the solutions i-th componnent for timestep t and ys[i,j,t] is the sensivity of the i-th component wrt to the j-th paramater, where the last parameter indices correspond to the initial conditions components." -function cvodes(f,fS, t0, y0, yS0, p, reltol, abstol, pbar, t::AbstractVector) - N, Ns = size(yS0) - y = zeros(N, length(t)) - ys = zeros(N, Ns, length(t)) - tret = [t0] - yret = similar(y0) - ysret = similar(yS0) - yS0n = [Sundials.NVector(yS0[:,j]) for j=1:Ns] - yS0nv = [N_Vector(n) for n in yS0n] - pyS0 = pointer(yS0nv) - crhs = Sundials.@cfunction(cvrhsfn, Cint, (Sundials.realtype, N_Vector, N_Vector, Ref{CVSData})) - csensrhs = Sundials.@cfunction(cvsensrhsfn, Cint, (Cint, Sundials.realtype, N_Vector, N_Vector, N_Vector_S, N_Vector_S, Ref{CVSData}, N_Vector, N_Vector)) - - ## - - mem_ptr = Sundials.CVodeCreate(Sundials.CV_ADAMS) - #mem_ptr = Sundials.CVodeCreate(Sundials.CV_BDF) - cvode_mem = Sundials.Handle(mem_ptr) - Sundials.CVodeSetUserData(cvode_mem, CVSData(f, fS, p, size(yS0)...)) - - Sundials.CVodeInit(cvode_mem, crhs, t0, convert(N_Vector, y0)) - Sundials.CVodeSStolerances(cvode_mem, reltol, abstol) - - Sundials.CVodeSensInit(cvode_mem, Ns, Sundials.CV_STAGGERED, csensrhs, pyS0) - Sundials.CVodeSetSensParams(cvode_mem, C_NULL, pbar, C_NULL) - Sundials.CVodeSensEEtolerances(cvode_mem) - for i in 1:length(t) - @info "here1" - Sundials.CVode(cvode_mem, t[i], yret, tret, Sundials.CV_NORMAL) - @info "here2" - Sundials.CVodeGetSens(cvode_mem, tret, pyS0) - @info "here3" - mycopy!(pyS0, ysret) - y[:,i] = yret - ys[:,:,i] = ysret - end - empty!(cvode_mem) - y, ys +function cvodes(f, fS, t0, y0, yS0, p, reltol, abstol, pbar, t::AbstractVector) + N, Ns = size(yS0) + y = zeros(N, length(t)) + ys = zeros(N, Ns, length(t)) + tret = [t0] + yret = similar(y0) + ysret = similar(yS0) + yS0n = [Sundials.NVector(yS0[:, j]) for j in 1:Ns] + yS0nv = [N_Vector(n) for n in yS0n] + pyS0 = pointer(yS0nv) + crhs = Sundials.@cfunction( + cvrhsfn, + Cint, + (Sundials.realtype, N_Vector, N_Vector, Ref{CVSData}) + ) + csensrhs = Sundials.@cfunction( + cvsensrhsfn, + Cint, + ( + Cint, + Sundials.realtype, + N_Vector, + N_Vector, + N_Vector_S, + N_Vector_S, + Ref{CVSData}, + N_Vector, + N_Vector, + ) + ) + + ## + + mem_ptr = Sundials.CVodeCreate(Sundials.CV_ADAMS) + #mem_ptr = Sundials.CVodeCreate(Sundials.CV_BDF) + cvode_mem = Sundials.Handle(mem_ptr) + Sundials.CVodeSetUserData(cvode_mem, CVSData(f, fS, p, size(yS0)...)) + + Sundials.CVodeInit(cvode_mem, crhs, t0, convert(N_Vector, y0)) + Sundials.CVodeSStolerances(cvode_mem, reltol, abstol) + + Sundials.CVodeSensInit(cvode_mem, Ns, Sundials.CV_STAGGERED, csensrhs, pyS0) + Sundials.CVodeSetSensParams(cvode_mem, C_NULL, pbar, C_NULL) + Sundials.CVodeSensEEtolerances(cvode_mem) + for i in 1:length(t) + @info "here1" + Sundials.CVode(cvode_mem, t[i], yret, tret, Sundials.CV_NORMAL) + @info "here2" + Sundials.CVodeGetSens(cvode_mem, tret, pyS0) + @info "here3" + mycopy!(pyS0, ysret) + y[:, i] = yret + ys[:, :, i] = ysret + end + empty!(cvode_mem) + y, ys end - -t0 = 0. -t = [1., 2.] -y0 = [1., 2.] -p = [3., 4.] +t0 = 0.0 +t = [1.0, 2.0] +y0 = [1.0, 2.0] +p = [3.0, 4.0] y, ys = sens(f!, t0, y0, p, t) -@test isapprox(y[1,1], 20.0856, rtol=1e-3) -@test isapprox(ys[2,2,2], 11924.3, rtol=1e-3) # todo: check if these are indeed the right results +@test isapprox(y[1, 1], 20.0856, rtol = 1e-3) +@test isapprox(ys[2, 2, 2], 11924.3, rtol = 1e-3) # todo: check if these are indeed the right results diff --git a/test/erkstep_nonlin.jl b/test/erkstep_nonlin.jl index 07d43707..475b1740 100644 --- a/test/erkstep_nonlin.jl +++ b/test/erkstep_nonlin.jl @@ -41,7 +41,7 @@ y0 = [0.0] function f(t, y, ydot, user_data) y = convert(Vector, y) ydot = convert(Vector, ydot) - ydot[1] = (t+1.0)*exp(-1*y[1]) + ydot[1] = (t + 1.0) * exp(-1 * y[1]) return Sundials.ARK_SUCCESS end @@ -61,9 +61,9 @@ while (tf - t[1] > 1e-15) end t = 0.0:1:10 -y_analytic = log.((0.5*t.^2 .+ t .+ 1)) +y_analytic = log.((0.5 * t .^ 2 .+ t .+ 1)) for i in 1:length(t) - @test isapprox(y_analytic[1], res[1]; atol= 1e-3) + @test isapprox(y_analytic[1], res[1]; atol = 1e-3) end y = nothing temp = Ref(Clong(-1)) diff --git a/test/handle_tests.jl b/test/handle_tests.jl index 623602e0..a4bf1373 100644 --- a/test/handle_tests.jl +++ b/test/handle_tests.jl @@ -17,32 +17,38 @@ h = Sundials.Handle(h1.ptr_ref[]) # Check construction with null pointers @test isempty(h) neq = 3 -h3 = Sundials.MatrixHandle(Sundials.SUNDenseMatrix(neq,neq),Sundials.DenseMatrix()) -h3 = Sundials.MatrixHandle(Sundials.SUNDenseMatrix(neq,neq),Sundials.DenseMatrix()) +h3 = Sundials.MatrixHandle(Sundials.SUNDenseMatrix(neq, neq), Sundials.DenseMatrix()) +h3 = Sundials.MatrixHandle(Sundials.SUNDenseMatrix(neq, neq), Sundials.DenseMatrix()) empty!(h3) @test isempty(h3) empty!(h3) @test isempty(h3) -h3 = Sundials.MatrixHandle(Sundials.SUNBandMatrix(100,3,3),Sundials.BandMatrix()) -h3 = Sundials.MatrixHandle(Sundials.SUNBandMatrix(100,3,3),Sundials.BandMatrix()) +h3 = Sundials.MatrixHandle(Sundials.SUNBandMatrix(100, 3, 3), Sundials.BandMatrix()) +h3 = Sundials.MatrixHandle(Sundials.SUNBandMatrix(100, 3, 3), Sundials.BandMatrix()) empty!(h3) @test isempty(h3) empty!(h3) @test isempty(h3) -h3 = Sundials.MatrixHandle(Sundials.SUNSparseMatrix(neq,neq,neq,Sundials.CSC_MAT),Sundials.SparseMatrix()) -h3 = Sundials.MatrixHandle(Sundials.SUNSparseMatrix(neq,neq,neq,Sundials.CSC_MAT),Sundials.SparseMatrix()) +h3 = Sundials.MatrixHandle( + Sundials.SUNSparseMatrix(neq, neq, neq, Sundials.CSC_MAT), + Sundials.SparseMatrix(), +) +h3 = Sundials.MatrixHandle( + Sundials.SUNSparseMatrix(neq, neq, neq, Sundials.CSC_MAT), + Sundials.SparseMatrix(), +) empty!(h3) @test isempty(h3) empty!(h3) @test isempty(h3) -A = Sundials.SUNDenseMatrix(neq,neq) +A = Sundials.SUNDenseMatrix(neq, neq) u0 = rand(neq) -Sundials.SUNLinSol_Dense(u0,A) -h3 = Sundials.LinSolHandle(Sundials.SUNLinSol_Dense(u0,A),Sundials.Dense()) -h3 = Sundials.LinSolHandle(Sundials.SUNLinSol_Dense(u0,A),Sundials.Dense()) +Sundials.SUNLinSol_Dense(u0, A) +h3 = Sundials.LinSolHandle(Sundials.SUNLinSol_Dense(u0, A), Sundials.Dense()) +h3 = Sundials.LinSolHandle(Sundials.SUNLinSol_Dense(u0, A), Sundials.Dense()) empty!(h3) @test isempty(h3) empty!(h3) diff --git a/test/ida_Heat2D.jl b/test/ida_Heat2D.jl index 4766d909..4157e7ff 100644 --- a/test/ida_Heat2D.jl +++ b/test/ida_Heat2D.jl @@ -26,9 +26,9 @@ using Sundials ## MGRID = 10 -NEQ = MGRID*MGRID +NEQ = MGRID * MGRID -dx = 1.0/(MGRID - 1.0) +dx = 1.0 / (MGRID - 1.0) coeff = 1.0 / (dx * dx) bval = 0.1 ## @@ -45,32 +45,32 @@ function heatres(t, u, up, r) r[:] = u ## Initialize r to u, to take care of boundary equations. ## Loop over interior points; set res = up - (central difference). - for j = 2:(MGRID-2) + for j in 2:(MGRID - 2) offset = MGRID * j - for i = 2:(MGRID-2) + for i in 2:(MGRID - 2) loc = offset + i - r[loc] = up[loc] - coeff * (u[loc-1] + u[loc+1] + - u[loc-MGRID] + u[loc+MGRID] - - 4.0 * u[loc]) + r[loc] = + up[loc] - + coeff * + (u[loc - 1] + u[loc + 1] + u[loc - MGRID] + u[loc + MGRID] - 4.0 * u[loc]) end end return Sundials.CV_SUCCESS end - function initial() mm = MGRID mm1 = mm - 1 - u = zeros(NEQ) + u = zeros(NEQ) id = ones(NEQ) ## initialize u on all grid points - for j = 1:mm-1 + for j in 1:(mm - 1) yfact = dx * j - offset = mm*j - for i = 1:mm-1 + offset = mm * j + for i in 1:(mm - 1) xfact = dx * i loc = offset + i u[loc] = 48.0 * xfact * (1.0 - xfact) * yfact * (1.0 - yfact) @@ -78,7 +78,7 @@ function initial() end up = zeros(NEQ) - r = zeros(NEQ) + r = zeros(NEQ) heatres(0.0, u, up, r) @@ -86,10 +86,10 @@ function initial() up[:] = -1.0 * r ## Finally, set values of u, up, and id at boundary points. - for j = 1:mm-1 + for j in 1:(mm - 1) offset = mm * j - for i = 1:mm-1 - loc = offset + i; + for i in 1:(mm - 1) + loc = offset + i if j == 1 || j == mm1 || i == 1 || i == mm1 u[loc] = bval up[loc] = 0 @@ -99,26 +99,45 @@ function initial() end constraints = ones(NEQ) - return (u,up,id,constraints) + return (u, up, id, constraints) end -function idabandsol(f::Function, y0::Vector{Float64}, yp0::Vector{Float64}, - id::Vector{Float64}, constraints::Vector{Float64}, - t::Vector{Float64}; - reltol::Float64=1e-4, abstol::Float64=1e-6) +function idabandsol( + f::Function, + y0::Vector{Float64}, + yp0::Vector{Float64}, + id::Vector{Float64}, + constraints::Vector{Float64}, + t::Vector{Float64}; + reltol::Float64 = 1e-4, + abstol::Float64 = 1e-6, +) neq = length(y0) mem = Sundials.IDACreate() - Sundials.@checkflag Sundials.IDAInit(mem, @cfunction( - Sundials.idasolfun, Cint, - (Sundials.realtype, Sundials.N_Vector, Sundials.N_Vector, Sundials.N_Vector, Ref{Function})), - t[1], y0, yp0) + Sundials.@checkflag Sundials.IDAInit( + mem, + @cfunction( + Sundials.idasolfun, + Cint, + ( + Sundials.realtype, + Sundials.N_Vector, + Sundials.N_Vector, + Sundials.N_Vector, + Ref{Function}, + ) + ), + t[1], + y0, + yp0, + ) Sundials.@checkflag Sundials.IDASetId(mem, id) Sundials.@checkflag Sundials.IDASetConstraints(mem, constraints) Sundials.@checkflag Sundials.IDASetUserData(mem, f) Sundials.@checkflag Sundials.IDASStolerances(mem, reltol, abstol) A = Sundials.SUNBandMatrix(neq, MGRID, MGRID)#,2MGRID) - LS = Sundials.SUNLinSol_Band(y0,A) + LS = Sundials.SUNLinSol_Band(y0, A) Sundials.@checkflag Sundials.IDADlsSetLinearSolver(mem, LS, A) rtest = zeros(neq) @@ -144,8 +163,7 @@ end nsteps = 10 tstep = 0.005 -t = collect(0.0:tstep:(tstep*nsteps)) +t = collect(0.0:tstep:(tstep * nsteps)) u0, up0, id, constraints = initial() -idabandsol(heatres, u0, up0, id, constraints, map(x -> x, t), - reltol = 0.0, abstol = 1e-3) +idabandsol(heatres, u0, up0, id, constraints, map(x -> x, t), reltol = 0.0, abstol = 1e-3) diff --git a/test/ida_Roberts_dns.jl b/test/ida_Roberts_dns.jl index 9c80b111..391aba5b 100644 --- a/test/ida_Roberts_dns.jl +++ b/test/ida_Roberts_dns.jl @@ -1,7 +1,6 @@ ## Adapted from doc/libsundials-serial-dev/examples/ida/serial/idaRoberts_dns.c and ## sundialsTB/ida/examples_ser/midasRoberts_dns.m - ## /* ## * ----------------------------------------------------------------- ## * $Revision: 1.2 $ @@ -33,16 +32,15 @@ using Sundials - ## Define the system residual function. function resrob(tres, yy_nv, yp_nv, rr_nv, user_data) yy = convert(Vector, yy_nv) yp = convert(Vector, yp_nv) rr = convert(Vector, rr_nv) - rr[1] = -0.04*yy[1] + 1.0e4*yy[2]*yy[3] - rr[2] = -rr[1] - 3.0e7*yy[2]*yy[2] - yp[2] - rr[1] -= yp[1] - rr[3] = yy[1] + yy[2] + yy[3] - 1.0 + rr[1] = -0.04 * yy[1] + 1.0e4 * yy[2] * yy[3] + rr[2] = -rr[1] - 3.0e7 * yy[2] * yy[2] - yp[2] + rr[1] -= yp[1] + rr[3] = yy[1] + yy[2] + yy[3] - 1.0 return Sundials.IDA_SUCCESS end @@ -56,26 +54,25 @@ function grob(t, yy_nv, yp_nv, gout_ptr, user_data) end ## Define the Jacobian function. BROKEN - JJ is wrong -function jacrob(Neq, tt, cj, yy, yp, resvec, - JJ, user_data, tempv1, tempv2, tempv3) - JJ = pointer_to_array(convert(Ptr{Float64}, JJ), (3,3)) - JJ[1,1] = -0.04 - cj - JJ[2,1] = 0.04 - JJ[3,1] = 1.0 - JJ[1,2] = 1.0e4*yy[3] - JJ[2,2] = -1.0e4*yy[3] - 6.0e7*yy[2] - cj - JJ[3,2] = 1.0 - JJ[1,3] = 1.0e4*yy[2] - JJ[2,3] = -1.0e4*yy[2] - JJ[3,3] = 1.0 +function jacrob(Neq, tt, cj, yy, yp, resvec, JJ, user_data, tempv1, tempv2, tempv3) + JJ = pointer_to_array(convert(Ptr{Float64}, JJ), (3, 3)) + JJ[1, 1] = -0.04 - cj + JJ[2, 1] = 0.04 + JJ[3, 1] = 1.0 + JJ[1, 2] = 1.0e4 * yy[3] + JJ[2, 2] = -1.0e4 * yy[3] - 6.0e7 * yy[2] - cj + JJ[3, 2] = 1.0 + JJ[1, 3] = 1.0e4 * yy[2] + JJ[2, 3] = -1.0e4 * yy[2] + JJ[3, 3] = 1.0 return Sundials.IDA_SUCCESS end neq = 3 nout = 12 t0 = 0.0 -yy0 = [1.0,0.0,0.0] -yp0 = [-0.04,0.04,0.0] +yy0 = [1.0, 0.0, 0.0] +yp0 = [-0.04, 0.04, 0.0] rtol = 1e-4 avtol = [1e-8, 1e-14, 1e-6] tout1 = 0.4 @@ -88,8 +85,8 @@ Sundials.@checkflag Sundials.IDASVtolerances(mem, rtol, avtol) Sundials.@checkflag Sundials.IDARootInit(mem, 2, grob) ## Call IDADense and set up the linear solver. -A = Sundials.SUNDenseMatrix(length(y0),length(y0)) -LS = Sundials.SUNLinSol_Dense(y0,A) +A = Sundials.SUNDenseMatrix(length(y0), length(y0)) +LS = Sundials.SUNLinSol_Dense(y0, A) Sundials.@checkflag Sundials.IDADlsSetLinearSolver(mem, LS, A) iout = 0 diff --git a/test/ida_Roberts_simplified.jl b/test/ida_Roberts_simplified.jl index 222ec95f..22003d1b 100644 --- a/test/ida_Roberts_simplified.jl +++ b/test/ida_Roberts_simplified.jl @@ -2,11 +2,11 @@ using Sundials ## Define the system residual function. function resrob(tres, y, yp, r) - r[1] = -0.04*y[1] + 1.0e4*y[2]*y[3] - r[2] = -r[1] - 3.0e7*y[2]*y[2] - yp[2] - r[1] -= yp[1] - r[3] = y[1] + y[2] + y[3] - 1.0 + r[1] = -0.04 * y[1] + 1.0e4 * y[2] * y[3] + r[2] = -r[1] - 3.0e7 * y[2] * y[2] - yp[2] + r[1] -= yp[1] + r[3] = y[1] + y[2] + y[3] - 1.0 end -t = [0.0; 4 * exp10.(range(-1., stop=5., length=7))] +t = [0.0; 4 * exp10.(range(-1.0, stop = 5.0, length = 7))] yout, ypout = Sundials.idasol(resrob, [1.0, 0, 0], [-0.04, 0.04, 0.0], t) diff --git a/test/kinsol_banded.jl b/test/kinsol_banded.jl index 820d23fe..88993fd5 100644 --- a/test/kinsol_banded.jl +++ b/test/kinsol_banded.jl @@ -1,7 +1,8 @@ function f!(resid, x) for i in eachindex(x) - resid[i] = sin(x[i]) + x[i]^3 + resid[i] = sin(x[i]) + x[i]^3 end end x = ones(5) -@test Sundials.kinsol(f!, x, linear_solver=:Band, jac_upper=0, jac_lower=0) == Sundials.kinsol(f!, x) +@test Sundials.kinsol(f!, x, linear_solver = :Band, jac_upper = 0, jac_lower = 0) == + Sundials.kinsol(f!, x) diff --git a/test/kinsol_mkinTest.jl b/test/kinsol_mkinTest.jl index 62dd57af..43b6fa11 100644 --- a/test/kinsol_mkinTest.jl +++ b/test/kinsol_mkinTest.jl @@ -28,13 +28,12 @@ Sundials.@checkflag Sundials.KINSetScaledStepTol(kmem, 1.0e-4) Sundials.@checkflag Sundials.KINSetMaxSetupCalls(kmem, 1) y = ones(neq) Sundials.@checkflag Sundials.KINInit(kmem, sysfn, y) -A = Sundials.SUNDenseMatrix(length(y),length(y)) -LS = Sundials.SUNLinSol_Dense(y,A) +A = Sundials.SUNDenseMatrix(length(y), length(y)) +LS = Sundials.SUNLinSol_Dense(y, A) Sundials.@checkflag Sundials.KINDlsSetLinearSolver(kmem, LS, A) ## Solve problem scale = ones(neq) -Sundials.@checkflag Sundials.KINSol(kmem, y, Sundials.KIN_LINESEARCH, - scale, scale) +Sundials.@checkflag Sundials.KINSol(kmem, y, Sundials.KIN_LINESEARCH, scale, scale) println("Solution: ", y) residual = ones(2) diff --git a/test/mri_twowaycouple.jl b/test/mri_twowaycouple.jl index 99e81438..db9eae63 100644 --- a/test/mri_twowaycouple.jl +++ b/test/mri_twowaycouple.jl @@ -39,8 +39,8 @@ using Sundials# Test function ff(t, y_nv, ydot_nv, user_data) y = convert(Vector, y_nv) ydot = convert(Vector, ydot_nv) - ydot[1] = 100.0*y[2] - ydot[2] = -100.0*y[1] + ydot[1] = 100.0 * y[2] + ydot[2] = -100.0 * y[1] ydot[3] = y[1] return Sundials.ARK_SUCCESS end @@ -58,7 +58,7 @@ T0 = 0.0 Tf = 2.0 dTout = 0.1 Neq = 3 -Nt = ceil(Tf/dTout) +Nt = ceil(Tf / dTout) hs = 0.001 hf = 0.00002 y0 = [0.90001, -9.999, 1000.0] @@ -66,7 +66,11 @@ y0 = [0.90001, -9.999, 1000.0] # Fast Integration portion _mem_ptr = Sundials.ARKStepCreate(ff, C_NULL, T0, y0); inner_arkode_mem = Sundials.Handle(_mem_ptr) -Sundials.@checkflag Sundials.ARKStepSetTableNum(inner_arkode_mem, -1, Sundials.KNOTH_WOLKE_3_3) +Sundials.@checkflag Sundials.ARKStepSetTableNum( + inner_arkode_mem, + -1, + Sundials.KNOTH_WOLKE_3_3, +) Sundials.@checkflag Sundials.ARKStepSetFixedStep(inner_arkode_mem, hf) # Slow integrator portion @@ -75,19 +79,19 @@ arkode_mem = Sundials.Handle(_arkode_mem_ptr) Sundials.@checkflag Sundials.MRIStepSetFixedStep(arkode_mem, hs) t = [T0] -tout = T0+dTout +tout = T0 + dTout res = Dict(0 => y0) for i in 1:Nt y = similar(y0) global retval = Sundials.MRIStepEvolve(arkode_mem, tout, y, t, Sundials.ARK_NORMAL) - global tout += dTout; - global tout = (tout > Tf) ? Tf : tout; + global tout += dTout + global tout = (tout > Tf) ? Tf : tout res[i] = y end for i in 1:3 - sol_1 = [ -0.927671 -8.500060 904.786828] - sol_end = [0.547358 -0.523577 135.169441] + sol_1 = [-0.927671 -8.500060 904.786828] + sol_end = [0.547358 -0.523577 135.169441] @test isapprox(res[1][i], sol_1[i], atol = 1e-3) @test isapprox(res[Nt][i], sol_end[i], atol = 1e-3) end diff --git a/test/runtests.jl b/test/runtests.jl index 44ee5ce5..67d1b1b9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,39 +2,77 @@ using Sundials using Test @testset "CVODE" begin - @testset "Roberts CVODE Simplified" begin include("cvode_Roberts_simplified.jl") end - @testset "Roberts CVODE Direct" begin include("cvode_Roberts_dns.jl") end + @testset "Roberts CVODE Simplified" begin + include("cvode_Roberts_simplified.jl") + end + @testset "Roberts CVODE Direct" begin + include("cvode_Roberts_dns.jl") + end #@testset "CVODES Direct" begin include("cvodes_dns.jl") end end @testset "IDA" begin - @testset "Roberts IDA Simplified" begin include("ida_Roberts_simplified.jl") end - @testset "Roberts IDA Direct" begin include("ida_Roberts_dns.jl") end - @testset "Heat IDA Direct" begin include("ida_Heat2D.jl") end + @testset "Roberts IDA Simplified" begin + include("ida_Roberts_simplified.jl") + end + @testset "Roberts IDA Direct" begin + include("ida_Roberts_dns.jl") + end + @testset "Heat IDA Direct" begin + include("ida_Heat2D.jl") + end # Commented out because still uses the syntax from Grid which is a deprecated package #@testset "Cable IDA Direct" begin include("ida_Cable.jl") end end @testset "ARK" begin - @testset "Roberts ARKStep Direct" begin include("arkstep_Roberts_dns.jl") end - @testset "NonLinear ERKStep Direct" begin include("erkstep_nonlin.jl") end - #@testset "MRI two way couple" begin include("mri_twowaycouple.jl") end + @testset "Roberts ARKStep Direct" begin + include("arkstep_Roberts_dns.jl") + end + @testset "NonLinear ERKStep Direct" begin + include("erkstep_nonlin.jl") + end + #@testset "MRI two way couple" begin include("mri_twowaycouple.jl") end end @testset "Kinsol" begin - @testset "Kinsol Simplified" begin include("kinsol_mkin_simplified.jl") end - @testset "Kinsol MKin" begin include("kinsol_mkinTest.jl") end - @testset "Kinsol Banded" begin include("kinsol_banded.jl") end + @testset "Kinsol Simplified" begin + include("kinsol_mkin_simplified.jl") + end + @testset "Kinsol MKin" begin + include("kinsol_mkinTest.jl") + end + @testset "Kinsol Banded" begin + include("kinsol_banded.jl") + end +end +@testset "Handle Tests" begin + include("handle_tests.jl") end -@testset "Handle Tests" begin include("handle_tests.jl") end @testset "Common Interface" begin - @testset "CVODE" begin include("common_interface/cvode.jl") end - @testset "ARKODE" begin include("common_interface/arkode.jl") end - @testset "IDA" begin include("common_interface/ida.jl") end - @testset "Jacobians" begin include("common_interface/jacobians.jl") end - @testset "Callbacks" begin include("common_interface/callbacks.jl") end - @testset "Iterator" begin include("common_interface/iterators.jl") end - @testset "Errors" begin include("common_interface/errors.jl") end - @testset "Mass Matrix" begin include("common_interface/mass_matrix.jl") end + @testset "CVODE" begin + include("common_interface/cvode.jl") + end + @testset "ARKODE" begin + include("common_interface/arkode.jl") + end + @testset "IDA" begin + include("common_interface/ida.jl") + end + @testset "Jacobians" begin + include("common_interface/jacobians.jl") + end + @testset "Callbacks" begin + include("common_interface/callbacks.jl") + end + @testset "Iterator" begin + include("common_interface/iterators.jl") + end + @testset "Errors" begin + include("common_interface/errors.jl") + end + @testset "Mass Matrix" begin + include("common_interface/mass_matrix.jl") + end end From d2a224c4ace270f7aeba995b6093b696ff4ba678 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Wed, 19 Aug 2020 21:16:05 -0700 Subject: [PATCH 2/2] undo changes to files in API folder --- src/API/api_overloads.jl | 186 +-- src/API/arkode.jl | 2308 +++++------------------------------ src/API/cvode.jl | 906 ++------------ src/API/cvodes.jl | 2213 +++++---------------------------- src/API/ida.jl | 807 ++---------- src/API/idas.jl | 2112 ++++---------------------------- src/API/kinsol.jl | 549 ++------- src/API/libsundials.jl | 520 +------- src/API/nvector.jl | 830 ++----------- src/API/sunlinsol.jl | 1218 +++--------------- src/API/sunmatrix.jl | 350 +----- src/API/sunnonlinsol.jl | 346 +----- src/API/types_and_consts.jl | 6 + 13 files changed, 1604 insertions(+), 10747 deletions(-) diff --git a/src/API/api_overloads.jl b/src/API/api_overloads.jl index ef8434a6..e814533c 100644 --- a/src/API/api_overloads.jl +++ b/src/API/api_overloads.jl @@ -1,25 +1,18 @@ -for ff in names(@__MODULE__; all = true) +for ff in names(@__MODULE__; all=true) fname = string(ff) if occursin("SetLinearSolver", fname) && - !occursin("#", fname) && # filter out compiler generated names - !occursin("Dls", fname) && - !occursin("Spils", fname) # filter out old names - @eval $ff(mem, LS::SUNLinearSolver, A::Ptr, args...) = - $ff(mem, LS, convert(SUNMatrix, A), args...) + !occursin("#", fname) && # filter out compiler generated names + !occursin("Dls", fname) && !occursin("Spils", fname) # filter out old names + @eval $ff(mem, LS::SUNLinearSolver, A::Ptr, args...) = $ff(mem, LS, convert(SUNMatrix, A), args...) end end # Julia wrapper for header: sunlinsol_lapackband.h # Automatically generated using Clang.jl + function SUNLinSol_LapackBand(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNLinSol_LapackBand, libsundials_sunlinsollapackband), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNLinSol_LapackBand, libsundials_sunlinsollapackband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNLinSol_LapackBand(y, A) @@ -28,13 +21,7 @@ function SUNLinSol_LapackBand(y, A) end function SUNLapackBand(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNLapackBand, libsundials_sunlinsollapackband), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNLapackBand, libsundials_sunlinsollapackband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNLapackBand(y, A) @@ -43,59 +30,23 @@ function SUNLapackBand(y, A) end function SUNLinSolGetType_LapackBand(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_LapackBand, libsundials_sunlinsollapackband), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_LapackBand, libsundials_sunlinsollapackband), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_LapackBand(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_LapackBand, libsundials_sunlinsollapackband), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_LapackBand, libsundials_sunlinsollapackband), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_LapackBand(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_LapackBand, libsundials_sunlinsollapackband), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetup_LapackBand(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_LapackBand, libsundials_sunlinsollapackband), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) + ccall((:SUNLinSolSetup_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver, SUNMatrix), S, A) end -function SUNLinSolSolve_LapackBand( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_LapackBand, libsundials_sunlinsollapackband), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) +function SUNLinSolSolve_LapackBand(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_LapackBand(S, A, x, b, tol) @@ -105,44 +56,22 @@ function SUNLinSolSolve_LapackBand(S, A, x, b, tol) end function SUNLinSolLastFlag_LapackBand(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_LapackBand, libsundials_sunlinsollapackband), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_LapackBand, libsundials_sunlinsollapackband), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_LapackBand(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_LapackBand, libsundials_sunlinsollapackband), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_LapackBand(S::SUNLinearSolver) - ccall( - (:SUNLinSolFree_LapackBand, libsundials_sunlinsollapackband), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolFree_LapackBand, libsundials_sunlinsollapackband), Cint, (SUNLinearSolver,), S) end # Julia wrapper for header: sunlinsol_lapackdense.h # Automatically generated using Clang.jl + function SUNLinSol_LapackDense(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNLinSol_LapackDense, libsundials_sunlinsollapackdense), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNLinSol_LapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNLinSol_LapackDense(y, A) @@ -151,13 +80,7 @@ function SUNLinSol_LapackDense(y, A) end function SUNLapackDense(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNLapackDense, libsundials_sunlinsollapackdense), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNLapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNLapackDense(y, A) @@ -166,59 +89,23 @@ function SUNLapackDense(y, A) end function SUNLinSolGetType_LapackDense(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_LapackDense, libsundials_sunlinsollapackdense), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_LapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_LapackDense(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_LapackDense, libsundials_sunlinsollapackdense), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_LapackDense, libsundials_sunlinsollapackdense), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_LapackDense(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_LapackDense, libsundials_sunlinsollapackdense), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetup_LapackDense(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_LapackDense, libsundials_sunlinsollapackdense), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) + ccall((:SUNLinSolSetup_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver, SUNMatrix), S, A) end -function SUNLinSolSolve_LapackDense( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_LapackDense, libsundials_sunlinsollapackdense), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) +function SUNLinSolSolve_LapackDense(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_LapackDense(S, A, x, b, tol) @@ -228,30 +115,13 @@ function SUNLinSolSolve_LapackDense(S, A, x, b, tol) end function SUNLinSolLastFlag_LapackDense(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_LapackDense, libsundials_sunlinsollapackdense), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_LapackDense, libsundials_sunlinsollapackdense), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_LapackDense(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_LapackDense, libsundials_sunlinsollapackdense), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_LapackDense(S::SUNLinearSolver) - ccall( - (:SUNLinSolFree_LapackDense, libsundials_sunlinsollapackdense), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolFree_LapackDense, libsundials_sunlinsollapackdense), Cint, (SUNLinearSolver,), S) end diff --git a/src/API/arkode.jl b/src/API/arkode.jl index 9a32249c..f83fdffd 100644 --- a/src/API/arkode.jl +++ b/src/API/arkode.jl @@ -4,16 +4,9 @@ # Julia wrapper for header: arkode_arkstep.h # Automatically generated using Clang.jl + function ARKStepCreate(fe::ARKRhsFn, fi::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall( - (:ARKStepCreate, libsundials_arkode), - ARKStepMemPtr, - (ARKRhsFn, ARKRhsFn, realtype, N_Vector), - fe, - fi, - t0, - y0, - ) + ccall((:ARKStepCreate, libsundials_arkode), ARKStepMemPtr, (ARKRhsFn, ARKRhsFn, realtype, N_Vector), fe, fi, t0, y0) end function ARKStepCreate(fe, fi, t0, y0) @@ -21,25 +14,8 @@ function ARKStepCreate(fe, fi, t0, y0) ARKStepCreate(ARKRhsFn_wrapper(fe), ARKRhsFn_wrapper(fi), t0, convert(N_Vector, __y0)) end -function ARKStepResize( - arkode_mem, - ynew::N_Vector, - hscale::realtype, - t0::realtype, - resize::ARKVecResizeFn, - resize_data, -) - ccall( - (:ARKStepResize, libsundials_arkode), - Cint, - (ARKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), - arkode_mem, - ynew, - hscale, - t0, - resize, - resize_data, - ) +function ARKStepResize(arkode_mem, ynew::N_Vector, hscale::realtype, t0::realtype, resize::ARKVecResizeFn, resize_data) + ccall((:ARKStepResize, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), arkode_mem, ynew, hscale, t0, resize, resize_data) end function ARKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) @@ -48,49 +24,20 @@ function ARKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) end function ARKStepReInit(arkode_mem, fe::ARKRhsFn, fi::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall( - (:ARKStepReInit, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKRhsFn, ARKRhsFn, realtype, N_Vector), - arkode_mem, - fe, - fi, - t0, - y0, - ) + ccall((:ARKStepReInit, libsundials_arkode), Cint, (ARKStepMemPtr, ARKRhsFn, ARKRhsFn, realtype, N_Vector), arkode_mem, fe, fi, t0, y0) end function ARKStepReInit(arkode_mem, fe, fi, t0, y0) __y0 = convert(NVector, y0) - ARKStepReInit( - arkode_mem, - ARKRhsFn_wrapper(fe), - ARKRhsFn_wrapper(fi), - t0, - convert(N_Vector, __y0), - ) + ARKStepReInit(arkode_mem, ARKRhsFn_wrapper(fe), ARKRhsFn_wrapper(fi), t0, convert(N_Vector, __y0)) end function ARKStepSStolerances(arkode_mem, reltol::realtype, abstol::realtype) - ccall( - (:ARKStepSStolerances, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype, realtype), - arkode_mem, - reltol, - abstol, - ) + ccall((:ARKStepSStolerances, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, realtype), arkode_mem, reltol, abstol) end function ARKStepSVtolerances(arkode_mem, reltol::realtype, abstol::N_Vector) - ccall( - (:ARKStepSVtolerances, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype, N_Vector), - arkode_mem, - reltol, - abstol, - ) + ccall((:ARKStepSVtolerances, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, N_Vector), arkode_mem, reltol, abstol) end function ARKStepSVtolerances(arkode_mem, reltol, abstol) @@ -99,33 +46,15 @@ function ARKStepSVtolerances(arkode_mem, reltol, abstol) end function ARKStepWFtolerances(arkode_mem, efun::ARKEwtFn) - ccall( - (:ARKStepWFtolerances, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKEwtFn), - arkode_mem, - efun, - ) + ccall((:ARKStepWFtolerances, libsundials_arkode), Cint, (ARKStepMemPtr, ARKEwtFn), arkode_mem, efun) end function ARKStepResStolerance(arkode_mem, rabstol::realtype) - ccall( - (:ARKStepResStolerance, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - rabstol, - ) + ccall((:ARKStepResStolerance, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, rabstol) end function ARKStepResVtolerance(arkode_mem, rabstol::N_Vector) - ccall( - (:ARKStepResVtolerance, libsundials_arkode), - Cint, - (ARKStepMemPtr, N_Vector), - arkode_mem, - rabstol, - ) + ccall((:ARKStepResVtolerance, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, rabstol) end function ARKStepResVtolerance(arkode_mem, rabstol) @@ -134,61 +63,23 @@ function ARKStepResVtolerance(arkode_mem, rabstol) end function ARKStepResFtolerance(arkode_mem, rfun::ARKRwtFn) - ccall( - (:ARKStepResFtolerance, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKRwtFn), - arkode_mem, - rfun, - ) + ccall((:ARKStepResFtolerance, libsundials_arkode), Cint, (ARKStepMemPtr, ARKRwtFn), arkode_mem, rfun) end function ARKStepSetLinearSolver(arkode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:ARKStepSetLinearSolver, libsundials_arkode), - Cint, - (ARKStepMemPtr, SUNLinearSolver, SUNMatrix), - arkode_mem, - LS, - A, - ) -end - -function ARKStepSetMassLinearSolver( - arkode_mem, - LS::SUNLinearSolver, - M::SUNMatrix, - time_dep::Cint, -) - ccall( - (:ARKStepSetMassLinearSolver, libsundials_arkode), - Cint, - (ARKStepMemPtr, SUNLinearSolver, SUNMatrix, Cint), - arkode_mem, - LS, - M, - time_dep, - ) + ccall((:ARKStepSetLinearSolver, libsundials_arkode), Cint, (ARKStepMemPtr, SUNLinearSolver, SUNMatrix), arkode_mem, LS, A) +end + +function ARKStepSetMassLinearSolver(arkode_mem, LS::SUNLinearSolver, M::SUNMatrix, time_dep::Cint) + ccall((:ARKStepSetMassLinearSolver, libsundials_arkode), Cint, (ARKStepMemPtr, SUNLinearSolver, SUNMatrix, Cint), arkode_mem, LS, M, time_dep) end function ARKStepSetMassLinearSolver(arkode_mem, LS::SUNLinearSolver, M::SUNMatrix, time_dep) - ARKStepSetMassLinearSolver( - arkode_mem, - LS::SUNLinearSolver, - M::SUNMatrix, - convert(Cint, time_dep), - ) + ARKStepSetMassLinearSolver(arkode_mem, LS::SUNLinearSolver, M::SUNMatrix, convert(Cint,time_dep)) end function ARKStepRootInit(arkode_mem, nrtfn::Cint, g::ARKRootFn) - ccall( - (:ARKStepRootInit, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint, ARKRootFn), - arkode_mem, - nrtfn, - g, - ) + ccall((:ARKStepRootInit, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, ARKRootFn), arkode_mem, nrtfn, g) end function ARKStepRootInit(arkode_mem, nrtfn, g::ARKRootFn) @@ -200,22 +91,11 @@ function ARKStepSetDefaults(arkode_mem) end function ARKStepSetOptimalParams(arkode_mem) - ccall( - (:ARKStepSetOptimalParams, libsundials_arkode), - Cint, - (ARKStepMemPtr,), - arkode_mem, - ) + ccall((:ARKStepSetOptimalParams, libsundials_arkode), Cint, (ARKStepMemPtr,), arkode_mem) end function ARKStepSetOrder(arkode_mem, maxord::Cint) - ccall( - (:ARKStepSetOrder, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - maxord, - ) + ccall((:ARKStepSetOrder, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxord) end function ARKStepSetOrder(arkode_mem, maxord) @@ -223,13 +103,7 @@ function ARKStepSetOrder(arkode_mem, maxord) end function ARKStepSetInterpolantType(arkode_mem, itype::Cint) - ccall( - (:ARKStepSetInterpolantType, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - itype, - ) + ccall((:ARKStepSetInterpolantType, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, itype) end function ARKStepSetInterpolantType(arkode_mem, itype) @@ -237,13 +111,7 @@ function ARKStepSetInterpolantType(arkode_mem, itype) end function ARKStepSetInterpolantDegree(arkode_mem, degree::Cint) - ccall( - (:ARKStepSetInterpolantDegree, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - degree, - ) + ccall((:ARKStepSetInterpolantDegree, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, degree) end function ARKStepSetInterpolantDegree(arkode_mem, degree) @@ -251,13 +119,7 @@ function ARKStepSetInterpolantDegree(arkode_mem, degree) end function ARKStepSetDenseOrder(arkode_mem, dord::Cint) - ccall( - (:ARKStepSetDenseOrder, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - dord, - ) + ccall((:ARKStepSetDenseOrder, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, dord) end function ARKStepSetDenseOrder(arkode_mem, dord) @@ -265,23 +127,11 @@ function ARKStepSetDenseOrder(arkode_mem, dord) end function ARKStepSetNonlinearSolver(arkode_mem, NLS::SUNNonlinearSolver) - ccall( - (:ARKStepSetNonlinearSolver, libsundials_arkode), - Cint, - (ARKStepMemPtr, SUNNonlinearSolver), - arkode_mem, - NLS, - ) + ccall((:ARKStepSetNonlinearSolver, libsundials_arkode), Cint, (ARKStepMemPtr, SUNNonlinearSolver), arkode_mem, NLS) end function ARKStepSetLinear(arkode_mem, timedepend::Cint) - ccall( - (:ARKStepSetLinear, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - timedepend, - ) + ccall((:ARKStepSetLinear, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, timedepend) end function ARKStepSetLinear(arkode_mem, timedepend) @@ -305,16 +155,7 @@ function ARKStepSetImEx(arkode_mem) end function ARKStepSetTables(arkode_mem, q::Cint, p::Cint, Bi, Be) - ccall( - (:ARKStepSetTables, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint, Cint, ARKodeButcherTable, ARKodeButcherTable), - arkode_mem, - q, - p, - Bi, - Be, - ) + ccall((:ARKStepSetTables, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, Cint, ARKodeButcherTable, ARKodeButcherTable), arkode_mem, q, p, Bi, Be) end function ARKStepSetTables(arkode_mem, q, p, Bi, Be) @@ -322,14 +163,7 @@ function ARKStepSetTables(arkode_mem, q, p, Bi, Be) end function ARKStepSetTableNum(arkode_mem, itable::Cint, etable::Cint) - ccall( - (:ARKStepSetTableNum, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint, Cint), - arkode_mem, - itable, - etable, - ) + ccall((:ARKStepSetTableNum, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, Cint), arkode_mem, itable, etable) end function ARKStepSetTableNum(arkode_mem, itable, etable) @@ -337,124 +171,47 @@ function ARKStepSetTableNum(arkode_mem, itable, etable) end function ARKStepSetCFLFraction(arkode_mem, cfl_frac::realtype) - ccall( - (:ARKStepSetCFLFraction, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - cfl_frac, - ) + ccall((:ARKStepSetCFLFraction, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, cfl_frac) end function ARKStepSetSafetyFactor(arkode_mem, safety::realtype) - ccall( - (:ARKStepSetSafetyFactor, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - safety, - ) + ccall((:ARKStepSetSafetyFactor, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, safety) end function ARKStepSetErrorBias(arkode_mem, bias::realtype) - ccall( - (:ARKStepSetErrorBias, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - bias, - ) + ccall((:ARKStepSetErrorBias, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, bias) end function ARKStepSetMaxGrowth(arkode_mem, mx_growth::realtype) - ccall( - (:ARKStepSetMaxGrowth, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - mx_growth, - ) + ccall((:ARKStepSetMaxGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, mx_growth) end function ARKStepSetFixedStepBounds(arkode_mem, lb::realtype, ub::realtype) - ccall( - (:ARKStepSetFixedStepBounds, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype, realtype), - arkode_mem, - lb, - ub, - ) -end - -function ARKStepSetAdaptivityMethod( - arkode_mem, - imethod::Cint, - idefault::Cint, - pq::Cint, - adapt_params, -) - ccall( - (:ARKStepSetAdaptivityMethod, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), - arkode_mem, - imethod, - idefault, - pq, - adapt_params, - ) + ccall((:ARKStepSetFixedStepBounds, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, realtype), arkode_mem, lb, ub) +end + +function ARKStepSetAdaptivityMethod(arkode_mem, imethod::Cint, idefault::Cint, pq::Cint, adapt_params) + ccall((:ARKStepSetAdaptivityMethod, libsundials_arkode), Cint, (ARKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), arkode_mem, imethod, idefault, pq, adapt_params) end function ARKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) - ARKStepSetAdaptivityMethod( - arkode_mem, - convert(Cint, imethod), - convert(Cint, idefault), - convert(Cint, pq), - adapt_params, - ) + ARKStepSetAdaptivityMethod(arkode_mem, convert(Cint, imethod), convert(Cint, idefault), convert(Cint, pq), adapt_params) end function ARKStepSetAdaptivityFn(arkode_mem, hfun::ARKAdaptFn, h_data) - ccall( - (:ARKStepSetAdaptivityFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), - arkode_mem, - hfun, - h_data, - ) + ccall((:ARKStepSetAdaptivityFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), arkode_mem, hfun, h_data) end function ARKStepSetMaxFirstGrowth(arkode_mem, etamx1::realtype) - ccall( - (:ARKStepSetMaxFirstGrowth, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - etamx1, - ) + ccall((:ARKStepSetMaxFirstGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, etamx1) end function ARKStepSetMaxEFailGrowth(arkode_mem, etamxf::realtype) - ccall( - (:ARKStepSetMaxEFailGrowth, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - etamxf, - ) + ccall((:ARKStepSetMaxEFailGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, etamxf) end function ARKStepSetSmallNumEFails(arkode_mem, small_nef::Cint) - ccall( - (:ARKStepSetSmallNumEFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - small_nef, - ) + ccall((:ARKStepSetSmallNumEFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, small_nef) end function ARKStepSetSmallNumEFails(arkode_mem, small_nef) @@ -462,67 +219,31 @@ function ARKStepSetSmallNumEFails(arkode_mem, small_nef) end function ARKStepSetMaxCFailGrowth(arkode_mem, etacf::realtype) - ccall( - (:ARKStepSetMaxCFailGrowth, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - etacf, - ) + ccall((:ARKStepSetMaxCFailGrowth, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, etacf) end function ARKStepSetNonlinCRDown(arkode_mem, crdown::realtype) - ccall( - (:ARKStepSetNonlinCRDown, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - crdown, - ) + ccall((:ARKStepSetNonlinCRDown, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, crdown) end function ARKStepSetNonlinRDiv(arkode_mem, rdiv::realtype) - ccall( - (:ARKStepSetNonlinRDiv, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - rdiv, - ) + ccall((:ARKStepSetNonlinRDiv, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, rdiv) end function ARKStepSetDeltaGammaMax(arkode_mem, dgmax::realtype) - ccall( - (:ARKStepSetDeltaGammaMax, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - dgmax, - ) + ccall((:ARKStepSetDeltaGammaMax, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, dgmax) end function ARKStepSetMaxStepsBetweenLSet(arkode_mem, msbp::Cint) - ccall( - (:ARKStepSetMaxStepsBetweenLSet, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - msbp, - ) + ccall((:ARKStepSetMaxStepsBetweenLSet, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, msbp) end function ARKStepSetMaxStepsBetweenLSet(arkode_mem, msbp) - ARKStepSetMaxStepsBetweenLSet(arkode_mem, convert(Cint, msbp)) + ARKStepSetMaxStepsBetweenLSet(arkode_mem, convert(Cint,msbp)) end function ARKStepSetPredictorMethod(arkode_mem, method::Cint) - ccall( - (:ARKStepSetPredictorMethod, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - method, - ) + ccall((:ARKStepSetPredictorMethod, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, method) end function ARKStepSetPredictorMethod(arkode_mem, method) @@ -530,24 +251,11 @@ function ARKStepSetPredictorMethod(arkode_mem, method) end function ARKStepSetStabilityFn(arkode_mem, EStab::ARKExpStabFn, estab_data) - ccall( - (:ARKStepSetStabilityFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), - arkode_mem, - EStab, - estab_data, - ) + ccall((:ARKStepSetStabilityFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), arkode_mem, EStab, estab_data) end function ARKStepSetMaxErrTestFails(arkode_mem, maxnef::Cint) - ccall( - (:ARKStepSetMaxErrTestFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - maxnef, - ) + ccall((:ARKStepSetMaxErrTestFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxnef) end function ARKStepSetMaxErrTestFails(arkode_mem, maxnef) @@ -555,13 +263,7 @@ function ARKStepSetMaxErrTestFails(arkode_mem, maxnef) end function ARKStepSetMaxNonlinIters(arkode_mem, maxcor::Cint) - ccall( - (:ARKStepSetMaxNonlinIters, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - maxcor, - ) + ccall((:ARKStepSetMaxNonlinIters, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxcor) end function ARKStepSetMaxNonlinIters(arkode_mem, maxcor) @@ -569,13 +271,7 @@ function ARKStepSetMaxNonlinIters(arkode_mem, maxcor) end function ARKStepSetMaxConvFails(arkode_mem, maxncf::Cint) - ccall( - (:ARKStepSetMaxConvFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - maxncf, - ) + ccall((:ARKStepSetMaxConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxncf) end function ARKStepSetMaxConvFails(arkode_mem, maxncf) @@ -583,23 +279,11 @@ function ARKStepSetMaxConvFails(arkode_mem, maxncf) end function ARKStepSetNonlinConvCoef(arkode_mem, nlscoef::realtype) - ccall( - (:ARKStepSetNonlinConvCoef, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - nlscoef, - ) + ccall((:ARKStepSetNonlinConvCoef, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, nlscoef) end function ARKStepSetConstraints(arkode_mem, constraints::N_Vector) - ccall( - (:ARKStepSetConstraints, libsundials_arkode), - Cint, - (ARKStepMemPtr, N_Vector), - arkode_mem, - constraints, - ) + ccall((:ARKStepSetConstraints, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, constraints) end function ARKStepSetConstraints(arkode_mem, constraints) @@ -608,13 +292,7 @@ function ARKStepSetConstraints(arkode_mem, constraints) end function ARKStepSetMaxNumSteps(arkode_mem, mxsteps::Clong) - ccall( - (:ARKStepSetMaxNumSteps, libsundials_arkode), - Cint, - (ARKStepMemPtr, Clong), - arkode_mem, - mxsteps, - ) + ccall((:ARKStepSetMaxNumSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Clong), arkode_mem, mxsteps) end function ARKStepSetMaxNumSteps(arkode_mem, mxsteps) @@ -622,13 +300,7 @@ function ARKStepSetMaxNumSteps(arkode_mem, mxsteps) end function ARKStepSetMaxHnilWarns(arkode_mem, mxhnil::Cint) - ccall( - (:ARKStepSetMaxHnilWarns, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - mxhnil, - ) + ccall((:ARKStepSetMaxHnilWarns, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, mxhnil) end function ARKStepSetMaxHnilWarns(arkode_mem, mxhnil) @@ -636,63 +308,27 @@ function ARKStepSetMaxHnilWarns(arkode_mem, mxhnil) end function ARKStepSetInitStep(arkode_mem, hin::realtype) - ccall( - (:ARKStepSetInitStep, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - hin, - ) + ccall((:ARKStepSetInitStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hin) end function ARKStepSetMinStep(arkode_mem, hmin::realtype) - ccall( - (:ARKStepSetMinStep, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - hmin, - ) + ccall((:ARKStepSetMinStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hmin) end function ARKStepSetMaxStep(arkode_mem, hmax::realtype) - ccall( - (:ARKStepSetMaxStep, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - hmax, - ) + ccall((:ARKStepSetMaxStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hmax) end function ARKStepSetStopTime(arkode_mem, tstop::realtype) - ccall( - (:ARKStepSetStopTime, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - tstop, - ) + ccall((:ARKStepSetStopTime, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, tstop) end function ARKStepSetFixedStep(arkode_mem, hfixed::realtype) - ccall( - (:ARKStepSetFixedStep, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - hfixed, - ) + ccall((:ARKStepSetFixedStep, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, hfixed) end function ARKStepSetMaxNumConstrFails(arkode_mem, maxfails::Cint) - ccall( - (:ARKStepSetMaxNumConstrFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Cint), - arkode_mem, - maxfails, - ) + ccall((:ARKStepSetMaxNumConstrFails, libsundials_arkode), Cint, (ARKStepMemPtr, Cint), arkode_mem, maxfails) end function ARKStepSetMaxNumConstrFails(arkode_mem, maxfails) @@ -700,114 +336,48 @@ function ARKStepSetMaxNumConstrFails(arkode_mem, maxfails) end function ARKStepSetRootDirection(arkode_mem, rootdir) - ccall( - (:ARKStepSetRootDirection, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Cint}), - arkode_mem, - rootdir, - ) + ccall((:ARKStepSetRootDirection, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Cint}), arkode_mem, rootdir) end function ARKStepSetNoInactiveRootWarn(arkode_mem) - ccall( - (:ARKStepSetNoInactiveRootWarn, libsundials_arkode), - Cint, - (ARKStepMemPtr,), - arkode_mem, - ) + ccall((:ARKStepSetNoInactiveRootWarn, libsundials_arkode), Cint, (ARKStepMemPtr,), arkode_mem) end function ARKStepSetErrHandlerFn(arkode_mem, ehfun::ARKErrHandlerFn, eh_data) - ccall( - (:ARKStepSetErrHandlerFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), - arkode_mem, - ehfun, - eh_data, - ) + ccall((:ARKStepSetErrHandlerFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), arkode_mem, ehfun, eh_data) end function ARKStepSetErrFile(arkode_mem, errfp) - ccall( - (:ARKStepSetErrFile, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{FILE}), - arkode_mem, - errfp, - ) + ccall((:ARKStepSetErrFile, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, errfp) end function ARKStepSetUserData(arkode_mem, user_data) - ccall( - (:ARKStepSetUserData, libsundials_arkode), - Cint, - (ARKStepMemPtr, Any), - arkode_mem, - user_data, - ) + ccall((:ARKStepSetUserData, libsundials_arkode), Cint, (ARKStepMemPtr, Any), arkode_mem, user_data) end function ARKStepSetDiagnostics(arkode_mem, diagfp) - ccall( - (:ARKStepSetDiagnostics, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{FILE}), - arkode_mem, - diagfp, - ) + ccall((:ARKStepSetDiagnostics, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, diagfp) end #This should change to ARKPostProcessFn function ARKStepSetPostprocessStepFn(arkode_mem, ProcessStep::ARKPostProcessStepFn) - ccall( - (:ARKStepSetPostprocessStepFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKPostProcessStepFn), - arkode_mem, - ProcessStep, - ) + ccall((:ARKStepSetPostprocessStepFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKPostProcessStepFn), arkode_mem, ProcessStep) end function ARKStepSetStagePredictFn(arkode_mem, PredictStage::ARKStepStagePredictFn) - ccall( - (:ARKStepSetStagePredictFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKStepStagePredictFn), - arkode_mem, - PredictStage, - ) + ccall((:ARKStepSetStagePredictFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKStepStagePredictFn), arkode_mem, PredictStage) end function ARKStepSetJacFn(arkode_mem, jac::ARKLsJacFn) - ccall( - (:ARKStepSetJacFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKLsJacFn), - arkode_mem, - jac, - ) + ccall((:ARKStepSetJacFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsJacFn), arkode_mem, jac) end function ARKStepSetMassFn(arkode_mem, mass::ARKLsMassFn) - ccall( - (:ARKStepSetMassFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKLsMassFn), - arkode_mem, - mass, - ) + ccall((:ARKStepSetMassFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsMassFn), arkode_mem, mass) end function ARKStepSetMaxStepsBetweenJac(arkode_mem, msbj::Clong) - ccall( - (:ARKStepSetMaxStepsBetweenJac, libsundials_arkode), - Cint, - (ARKStepMemPtr, Clong), - arkode_mem, - msbj, - ) + ccall((:ARKStepSetMaxStepsBetweenJac, libsundials_arkode), Cint, (ARKStepMemPtr, Clong), arkode_mem, msbj) end function ARKStepSetMaxStepsBetweenJac(arkode_mem, msbj) @@ -815,108 +385,35 @@ function ARKStepSetMaxStepsBetweenJac(arkode_mem, msbj) end function ARKStepSetEpsLin(arkode_mem, eplifac::realtype) - ccall( - (:ARKStepSetEpsLin, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - eplifac, - ) + ccall((:ARKStepSetEpsLin, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, eplifac) end function ARKStepSetMassEpsLin(arkode_mem, eplifac::realtype) - ccall( - (:ARKStepSetMassEpsLin, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype), - arkode_mem, - eplifac, - ) -end - -function ARKStepSetPreconditioner( - arkode_mem, - psetup::ARKLsPrecSetupFn, - psolve::ARKLsPrecSolveFn, -) - ccall( - (:ARKStepSetPreconditioner, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKLsPrecSetupFn, ARKLsPrecSolveFn), - arkode_mem, - psetup, - psolve, - ) -end - -function ARKStepSetMassPreconditioner( - arkode_mem, - psetup::ARKLsMassPrecSetupFn, - psolve::ARKLsMassPrecSolveFn, -) - ccall( - (:ARKStepSetMassPreconditioner, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKLsMassPrecSetupFn, ARKLsMassPrecSolveFn), - arkode_mem, - psetup, - psolve, - ) -end - -function ARKStepSetJacTimes( - arkode_mem, - jtsetup::ARKLsJacTimesSetupFn, - jtimes::ARKLsJacTimesVecFn, -) - ccall( - (:ARKStepSetJacTimes, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKLsJacTimesSetupFn, ARKLsJacTimesVecFn), - arkode_mem, - jtsetup, - jtimes, - ) -end - -function ARKStepSetMassTimes( - arkode_mem, - msetup::ARKLsMassTimesSetupFn, - mtimes::ARKLsMassTimesVecFn, - mtimes_data, -) - ccall( - (:ARKStepSetMassTimes, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKLsMassTimesSetupFn, ARKLsMassTimesVecFn, Ptr{Cvoid}), - arkode_mem, - msetup, - mtimes, - mtimes_data, - ) + ccall((:ARKStepSetMassEpsLin, libsundials_arkode), Cint, (ARKStepMemPtr, realtype), arkode_mem, eplifac) +end + +function ARKStepSetPreconditioner(arkode_mem, psetup::ARKLsPrecSetupFn, psolve::ARKLsPrecSolveFn) + ccall((:ARKStepSetPreconditioner, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsPrecSetupFn, ARKLsPrecSolveFn), arkode_mem, psetup, psolve) +end + +function ARKStepSetMassPreconditioner(arkode_mem, psetup::ARKLsMassPrecSetupFn, psolve::ARKLsMassPrecSolveFn) + ccall((:ARKStepSetMassPreconditioner, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsMassPrecSetupFn, ARKLsMassPrecSolveFn), arkode_mem, psetup, psolve) +end + +function ARKStepSetJacTimes(arkode_mem, jtsetup::ARKLsJacTimesSetupFn, jtimes::ARKLsJacTimesVecFn) + ccall((:ARKStepSetJacTimes, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsJacTimesSetupFn, ARKLsJacTimesVecFn), arkode_mem, jtsetup, jtimes) +end + +function ARKStepSetMassTimes(arkode_mem, msetup::ARKLsMassTimesSetupFn, mtimes::ARKLsMassTimesVecFn, mtimes_data) + ccall((:ARKStepSetMassTimes, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsMassTimesSetupFn, ARKLsMassTimesVecFn, Ptr{Cvoid}), arkode_mem, msetup, mtimes, mtimes_data) end function ARKStepSetLinSysFn(arkode_mem, linsys::ARKLsLinSysFn) - ccall( - (:ARKStepSetLinSysFn, libsundials_arkode), - Cint, - (ARKStepMemPtr, ARKLsLinSysFn), - arkode_mem, - linsys, - ) + ccall((:ARKStepSetLinSysFn, libsundials_arkode), Cint, (ARKStepMemPtr, ARKLsLinSysFn), arkode_mem, linsys) end function ARKStepEvolve(arkode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall( - (:ARKStepEvolve, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), - arkode_mem, - tout, - yout, - tret, - itask, - ) + ccall((:ARKStepEvolve, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), arkode_mem, tout, yout, tret, itask) end function ARKStepEvolve(arkode_mem, tout, yout, tret, itask) @@ -924,16 +421,9 @@ function ARKStepEvolve(arkode_mem, tout, yout, tret, itask) ARKStepEvolve(arkode_mem, tout, convert(N_Vector, __yout), tret, convert(Cint, itask)) end + function ARKStepGetDky(arkode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:ARKStepGetDky, libsundials_arkode), - Cint, - (ARKStepMemPtr, realtype, Cint, N_Vector), - arkode_mem, - t, - k, - dky, - ) + ccall((:ARKStepGetDky, libsundials_arkode), Cint, (ARKStepMemPtr, realtype, Cint, N_Vector), arkode_mem, t, k, dky) end function ARKStepGetDky(arkode_mem, t::realtype, k, dky) @@ -942,85 +432,35 @@ function ARKStepGetDky(arkode_mem, t::realtype, k, dky) end function ARKStepGetNumExpSteps(arkode_mem, expsteps) - ccall( - (:ARKStepGetNumExpSteps, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - expsteps, - ) + ccall((:ARKStepGetNumExpSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, expsteps) end function ARKStepGetNumAccSteps(arkode_mem, accsteps) - ccall( - (:ARKStepGetNumAccSteps, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - accsteps, - ) + ccall((:ARKStepGetNumAccSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, accsteps) end function ARKStepGetNumStepAttempts(arkode_mem, step_attempts) - ccall( - (:ARKStepGetNumStepAttempts, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - step_attempts, - ) + ccall((:ARKStepGetNumStepAttempts, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, step_attempts) end function ARKStepGetNumRhsEvals(arkode_mem, nfe_evals, nfi_evals) - ccall( - (:ARKStepGetNumRhsEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - nfe_evals, - nfi_evals, - ) + ccall((:ARKStepGetNumRhsEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, nfe_evals, nfi_evals) end function ARKStepGetNumLinSolvSetups(arkode_mem, nlinsetups) - ccall( - (:ARKStepGetNumLinSolvSetups, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nlinsetups, - ) + ccall((:ARKStepGetNumLinSolvSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nlinsetups) end function ARKStepGetNumErrTestFails(arkode_mem, netfails) - ccall( - (:ARKStepGetNumErrTestFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - netfails, - ) + ccall((:ARKStepGetNumErrTestFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, netfails) end function ARKStepGetCurrentButcherTables(arkode_mem, Bi, Be) - ccall( - (:ARKStepGetCurrentButcherTables, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{ARKodeButcherTable}, Ptr{ARKodeButcherTable}), - arkode_mem, - Bi, - Be, - ) + ccall((:ARKStepGetCurrentButcherTables, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{ARKodeButcherTable}, Ptr{ARKodeButcherTable}), arkode_mem, Bi, Be) end function ARKStepGetEstLocalErrors(arkode_mem, ele::N_Vector) - ccall( - (:ARKStepGetEstLocalErrors, libsundials_arkode), - Cint, - (ARKStepMemPtr, N_Vector), - arkode_mem, - ele, - ) + ccall((:ARKStepGetEstLocalErrors, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, ele) end function ARKStepGetEstLocalErrors(arkode_mem, ele) @@ -1029,104 +469,43 @@ function ARKStepGetEstLocalErrors(arkode_mem, ele) end function ARKStepGetWorkSpace(arkode_mem, lenrw, leniw) - ccall( - (:ARKStepGetWorkSpace, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - lenrw, - leniw, - ) + ccall((:ARKStepGetWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrw, leniw) end function ARKStepGetNumSteps(arkode_mem, nsteps) - ccall( - (:ARKStepGetNumSteps, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nsteps, - ) + ccall((:ARKStepGetNumSteps, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nsteps) end function ARKStepGetActualInitStep(arkode_mem, hinused) - ccall( - (:ARKStepGetActualInitStep, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{realtype}), - arkode_mem, - hinused, - ) + ccall((:ARKStepGetActualInitStep, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, hinused) end function ARKStepGetLastStep(arkode_mem, hlast) - ccall( - (:ARKStepGetLastStep, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{realtype}), - arkode_mem, - hlast, - ) + ccall((:ARKStepGetLastStep, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, hlast) end function ARKStepGetCurrentStep(arkode_mem, hcur) - ccall( - (:ARKStepGetCurrentStep, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{realtype}), - arkode_mem, - hcur, - ) + ccall((:ARKStepGetCurrentStep, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, hcur) end function ARKStepGetCurrentTime(arkode_mem, tcur) - ccall( - (:ARKStepGetCurrentTime, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{realtype}), - arkode_mem, - tcur, - ) + ccall((:ARKStepGetCurrentTime, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, tcur) end function ARKStepGetCurrentState(arkode_mem, ycur) - ccall( - (:ARKStepGetCurrentState, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{N_Vector}), - arkode_mem, - ycur, - ) + ccall((:ARKStepGetCurrentState, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{N_Vector}), arkode_mem, ycur) end function ARKStepGetCurrentGamma(arkode_mem, gamma) - ccall( - (:ARKStepGetCurrentGamma, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{realtype}), - arkode_mem, - gamma, - ) + ccall((:ARKStepGetCurrentGamma, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, gamma) end function ARKStepGetTolScaleFactor(arkode_mem, tolsfac) - ccall( - (:ARKStepGetTolScaleFactor, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{realtype}), - arkode_mem, - tolsfac, - ) + ccall((:ARKStepGetTolScaleFactor, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{realtype}), arkode_mem, tolsfac) end function ARKStepGetErrWeights(arkode_mem, eweight::N_Vector) - ccall( - (:ARKStepGetErrWeights, libsundials_arkode), - Cint, - (ARKStepMemPtr, N_Vector), - arkode_mem, - eweight, - ) + ccall((:ARKStepGetErrWeights, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, eweight) end function ARKStepGetErrWeights(arkode_mem, eweight) @@ -1135,13 +514,7 @@ function ARKStepGetErrWeights(arkode_mem, eweight) end function ARKStepGetResWeights(arkode_mem, rweight::N_Vector) - ccall( - (:ARKStepGetResWeights, libsundials_arkode), - Cint, - (ARKStepMemPtr, N_Vector), - arkode_mem, - rweight, - ) + ccall((:ARKStepGetResWeights, libsundials_arkode), Cint, (ARKStepMemPtr, N_Vector), arkode_mem, rweight) end function ARKStepGetResWeights(arkode_mem, rweight) @@ -1150,33 +523,15 @@ function ARKStepGetResWeights(arkode_mem, rweight) end function ARKStepGetNumGEvals(arkode_mem, ngevals) - ccall( - (:ARKStepGetNumGEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - ngevals, - ) + ccall((:ARKStepGetNumGEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, ngevals) end function ARKStepGetRootInfo(arkode_mem, rootsfound) - ccall( - (:ARKStepGetRootInfo, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Cint}), - arkode_mem, - rootsfound, - ) + ccall((:ARKStepGetRootInfo, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Cint}), arkode_mem, rootsfound) end function ARKStepGetNumConstrFails(arkode_mem, nconstrfails) - ccall( - (:ARKStepGetNumConstrFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nconstrfails, - ) + ccall((:ARKStepGetNumConstrFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nconstrfails) end function ARKStepGetReturnFlagName(flag::Clong) @@ -1188,321 +543,115 @@ function ARKStepGetReturnFlagName(flag) end function ARKStepWriteParameters(arkode_mem, fp) - ccall( - (:ARKStepWriteParameters, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{FILE}), - arkode_mem, - fp, - ) + ccall((:ARKStepWriteParameters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, fp) end function ARKStepWriteButcher(arkode_mem, fp) - ccall( - (:ARKStepWriteButcher, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{FILE}), - arkode_mem, - fp, - ) -end - -function ARKStepGetTimestepperStats( - arkode_mem, - expsteps, - accsteps, - step_attempts, - nfe_evals, - nfi_evals, - nlinsetups, - netfails, -) - ccall( - (:ARKStepGetTimestepperStats, libsundials_arkode), - Cint, - ( - ARKStepMemPtr, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - ), - arkode_mem, - expsteps, - accsteps, - step_attempts, - nfe_evals, - nfi_evals, - nlinsetups, - netfails, - ) + ccall((:ARKStepWriteButcher, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, fp) +end + +function ARKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfe_evals, nfi_evals, nlinsetups, netfails) + ccall((:ARKStepGetTimestepperStats, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), arkode_mem, expsteps, accsteps, step_attempts, nfe_evals, nfi_evals, nlinsetups, netfails) end function ARKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) - ccall( - (:ARKStepGetStepStats, libsundials_arkode), - Cint, - ( - ARKStepMemPtr, - Ptr{Clong}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - ), - arkode_mem, - nsteps, - hinused, - hlast, - hcur, - tcur, - ) + ccall((:ARKStepGetStepStats, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), arkode_mem, nsteps, hinused, hlast, hcur, tcur) end function ARKStepGetNumNonlinSolvIters(arkode_mem, nniters) - ccall( - (:ARKStepGetNumNonlinSolvIters, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nniters, - ) + ccall((:ARKStepGetNumNonlinSolvIters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nniters) end function ARKStepGetNumNonlinSolvConvFails(arkode_mem, nncfails) - ccall( - (:ARKStepGetNumNonlinSolvConvFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nncfails, - ) + ccall((:ARKStepGetNumNonlinSolvConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nncfails) end function ARKStepGetNonlinSolvStats(arkode_mem, nniters, nncfails) - ccall( - (:ARKStepGetNonlinSolvStats, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - nniters, - nncfails, - ) + ccall((:ARKStepGetNonlinSolvStats, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, nniters, nncfails) end function ARKStepGetLinWorkSpace(arkode_mem, lenrwLS, leniwLS) - ccall( - (:ARKStepGetLinWorkSpace, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - lenrwLS, - leniwLS, - ) + ccall((:ARKStepGetLinWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwLS, leniwLS) end function ARKStepGetNumJacEvals(arkode_mem, njevals) - ccall( - (:ARKStepGetNumJacEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - njevals, - ) + ccall((:ARKStepGetNumJacEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, njevals) end function ARKStepGetNumPrecEvals(arkode_mem, npevals) - ccall( - (:ARKStepGetNumPrecEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - npevals, - ) + ccall((:ARKStepGetNumPrecEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, npevals) end function ARKStepGetNumPrecSolves(arkode_mem, npsolves) - ccall( - (:ARKStepGetNumPrecSolves, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - npsolves, - ) + ccall((:ARKStepGetNumPrecSolves, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, npsolves) end function ARKStepGetNumLinIters(arkode_mem, nliters) - ccall( - (:ARKStepGetNumLinIters, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nliters, - ) + ccall((:ARKStepGetNumLinIters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nliters) end function ARKStepGetNumLinConvFails(arkode_mem, nlcfails) - ccall( - (:ARKStepGetNumLinConvFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nlcfails, - ) + ccall((:ARKStepGetNumLinConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nlcfails) end function ARKStepGetNumJTSetupEvals(arkode_mem, njtsetups) - ccall( - (:ARKStepGetNumJTSetupEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - njtsetups, - ) + ccall((:ARKStepGetNumJTSetupEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, njtsetups) end function ARKStepGetNumJtimesEvals(arkode_mem, njvevals) - ccall( - (:ARKStepGetNumJtimesEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - njvevals, - ) + ccall((:ARKStepGetNumJtimesEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, njvevals) end function ARKStepGetNumLinRhsEvals(arkode_mem, nfevalsLS) - ccall( - (:ARKStepGetNumLinRhsEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nfevalsLS, - ) + ccall((:ARKStepGetNumLinRhsEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nfevalsLS) end function ARKStepGetLastLinFlag(arkode_mem, flag) - ccall( - (:ARKStepGetLastLinFlag, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - flag, - ) + ccall((:ARKStepGetLastLinFlag, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, flag) end function ARKStepGetMassWorkSpace(arkode_mem, lenrwMLS, leniwMLS) - ccall( - (:ARKStepGetMassWorkSpace, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - lenrwMLS, - leniwMLS, - ) + ccall((:ARKStepGetMassWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwMLS, leniwMLS) end function ARKStepGetNumMassSetups(arkode_mem, nmsetups) - ccall( - (:ARKStepGetNumMassSetups, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmsetups, - ) + ccall((:ARKStepGetNumMassSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmsetups) end function ARKStepGetNumMassMultSetups(arkode_mem, nmvsetups) - ccall( - (:ARKStepGetNumMassMultSetups, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmvsetups, - ) + ccall((:ARKStepGetNumMassMultSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmvsetups) end function ARKStepGetNumMassMult(arkode_mem, nmvevals) - ccall( - (:ARKStepGetNumMassMult, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmvevals, - ) + ccall((:ARKStepGetNumMassMult, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmvevals) end function ARKStepGetNumMassSolves(arkode_mem, nmsolves) - ccall( - (:ARKStepGetNumMassSolves, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmsolves, - ) + ccall((:ARKStepGetNumMassSolves, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmsolves) end function ARKStepGetNumMassPrecEvals(arkode_mem, nmpevals) - ccall( - (:ARKStepGetNumMassPrecEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmpevals, - ) + ccall((:ARKStepGetNumMassPrecEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmpevals) end function ARKStepGetNumMassPrecSolves(arkode_mem, nmpsolves) - ccall( - (:ARKStepGetNumMassPrecSolves, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmpsolves, - ) + ccall((:ARKStepGetNumMassPrecSolves, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmpsolves) end function ARKStepGetNumMassIters(arkode_mem, nmiters) - ccall( - (:ARKStepGetNumMassIters, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmiters, - ) + ccall((:ARKStepGetNumMassIters, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmiters) end function ARKStepGetNumMassConvFails(arkode_mem, nmcfails) - ccall( - (:ARKStepGetNumMassConvFails, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmcfails, - ) + ccall((:ARKStepGetNumMassConvFails, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmcfails) end function ARKStepGetNumMTSetups(arkode_mem, nmtsetups) - ccall( - (:ARKStepGetNumMTSetups, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nmtsetups, - ) + ccall((:ARKStepGetNumMTSetups, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nmtsetups) end function ARKStepGetLastMassFlag(arkode_mem, flag) - ccall( - (:ARKStepGetLastMassFlag, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - flag, - ) + ccall((:ARKStepGetLastMassFlag, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, flag) end function ARKStepGetLinReturnFlagName(flag::Clong) @@ -1518,184 +667,64 @@ function ARKStepFree(arkode_mem) end function ARKStepPrintMem(arkode_mem, outfile) - ccall( - (:ARKStepPrintMem, libsundials_arkode), - Cvoid, - (ARKStepMemPtr, Ptr{FILE}), - arkode_mem, - outfile, - ) + ccall((:ARKStepPrintMem, libsundials_arkode), Cvoid, (ARKStepMemPtr, Ptr{FILE}), arkode_mem, outfile) end # Julia wrapper for header: arkode_bandpre.h # Automatically generated using Clang.jl + function ARKBandPrecInit(arkode_mem, N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall( - (:ARKBandPrecInit, libsundials_arkode), - Cint, - (ARKStepMemPtr, sunindextype, sunindextype, sunindextype), - arkode_mem, - N, - mu, - ml, - ) + ccall((:ARKBandPrecInit, libsundials_arkode), Cint, (ARKStepMemPtr, sunindextype, sunindextype, sunindextype), arkode_mem, N, mu, ml) end function ARKBandPrecGetWorkSpace(arkode_mem, lenrwLS, leniwLS) - ccall( - (:ARKBandPrecGetWorkSpace, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - lenrwLS, - leniwLS, - ) + ccall((:ARKBandPrecGetWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwLS, leniwLS) end function ARKBandPrecGetNumRhsEvals(arkode_mem, nfevalsBP) - ccall( - (:ARKBandPrecGetNumRhsEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - nfevalsBP, - ) + ccall((:ARKBandPrecGetNumRhsEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, nfevalsBP) end # Julia wrapper for header: arkode_bbdpre.h # Automatically generated using Clang.jl -function ARKBBDPrecInit( - arkode_mem, - Nlocal::sunindextype, - mudq::sunindextype, - mldq::sunindextype, - mukeep::sunindextype, - mlkeep::sunindextype, - dqrely::realtype, - gloc::ARKLocalFn, - cfn::ARKCommFn, -) - ccall( - (:ARKBBDPrecInit, libsundials_arkode), - Cint, - ( - ARKStepMemPtr, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - ARKLocalFn, - ARKCommFn, - ), - arkode_mem, - Nlocal, - mudq, - mldq, - mukeep, - mlkeep, - dqrely, - gloc, - cfn, - ) -end - -function ARKBBDPrecReInit( - arkode_mem, - mudq::sunindextype, - mldq::sunindextype, - dqrely::realtype, -) - ccall( - (:ARKBBDPrecReInit, libsundials_arkode), - Cint, - (ARKStepMemPtr, sunindextype, sunindextype, realtype), - arkode_mem, - mudq, - mldq, - dqrely, - ) + +function ARKBBDPrecInit(arkode_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dqrely::realtype, gloc::ARKLocalFn, cfn::ARKCommFn) + ccall((:ARKBBDPrecInit, libsundials_arkode), Cint, (ARKStepMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, ARKLocalFn, ARKCommFn), arkode_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) +end + +function ARKBBDPrecReInit(arkode_mem, mudq::sunindextype, mldq::sunindextype, dqrely::realtype) + ccall((:ARKBBDPrecReInit, libsundials_arkode), Cint, (ARKStepMemPtr, sunindextype, sunindextype, realtype), arkode_mem, mudq, mldq, dqrely) end function ARKBBDPrecGetWorkSpace(arkode_mem, lenrwBBDP, leniwBBDP) - ccall( - (:ARKBBDPrecGetWorkSpace, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - lenrwBBDP, - leniwBBDP, - ) + ccall((:ARKBBDPrecGetWorkSpace, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrwBBDP, leniwBBDP) end function ARKBBDPrecGetNumGfnEvals(arkode_mem, ngevalsBBDP) - ccall( - (:ARKBBDPrecGetNumGfnEvals, libsundials_arkode), - Cint, - (ARKStepMemPtr, Ptr{Clong}), - arkode_mem, - ngevalsBBDP, - ) + ccall((:ARKBBDPrecGetNumGfnEvals, libsundials_arkode), Cint, (ARKStepMemPtr, Ptr{Clong}), arkode_mem, ngevalsBBDP) end # Julia wrapper for header: arkode_butcher.h # Automatically generated using Clang.jl + function ARKodeButcherTable_Alloc(stages, embedded) - ccall( - (:ARKodeButcherTable_Alloc, libsundials_arkode), - ARKodeButcherTable, - (Cint, Cint), - stages, - embedded, - ) + ccall((:ARKodeButcherTable_Alloc, libsundials_arkode), ARKodeButcherTable, (Cint, Cint), stages, embedded) end function ARKodeButcherTable_Create(s, q::Cint, p::Cint, c::Cint, A, b, d) - ccall( - (:ARKodeButcherTable_Create, libsundials_arkode), - ARKodeButcherTable, - (Cint, Cint, Cint, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), - s, - q, - p, - c, - A, - b, - d, - ) + ccall((:ARKodeButcherTable_Create, libsundials_arkode), ARKodeButcherTable, (Cint, Cint, Cint, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), s, q, p, c, A, b, d) end function ARKodeButcherTable_Create(s, q, p, c, A, b, d) - ARKodeButcherTable_Create( - convert(Cint, s), - convert(Cint, q), - convert(Cint, p), - convert(Cint, c), - A, - b, - d, - ) + ARKodeButcherTable_Create(convert(Cint,s), convert(Cint,q), convert(Cint,p), convert(Cint, c), A, b, d) end function ARKodeButcherTable_Copy(B) - ccall( - (:ARKodeButcherTable_Copy, libsundials_arkode), - ARKodeButcherTable, - (ARKodeButcherTable,), - B, - ) + ccall((:ARKodeButcherTable_Copy, libsundials_arkode), ARKodeButcherTable, (ARKodeButcherTable,), B) end function ARKodeButcherTable_Space(B, liw, lrw) - ccall( - (:ARKodeButcherTable_Space, libsundials_arkode), - Cvoid, - (ARKodeButcherTable, Ptr{sunindextype}, Ptr{sunindextype}), - B, - liw, - lrw, - ) + ccall((:ARKodeButcherTable_Space, libsundials_arkode), Cvoid, (ARKodeButcherTable, Ptr{sunindextype}, Ptr{sunindextype}), B, liw, lrw) end function ARKodeButcherTable_Free(B) @@ -1703,49 +732,22 @@ function ARKodeButcherTable_Free(B) end function ARKodeButcherTable_Write(B, outfile) - ccall( - (:ARKodeButcherTable_Write, libsundials_arkode), - Cvoid, - (ARKodeButcherTable, Ptr{Cint}), - B, - outfile, - ) + ccall((:ARKodeButcherTable_Write, libsundials_arkode), Cvoid, (ARKodeButcherTable, Ptr{Cint}), B, outfile) end function ARKodeButcherTable_CheckOrder(B, q, p, outfile) - ccall( - (:ARKodeButcherTable_CheckOrder, libsundials_arkode), - Cint, - (ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), - B, - q, - p, - outfile, - ) + ccall((:ARKodeButcherTable_CheckOrder, libsundials_arkode), Cint, (ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), B, q, p, outfile) end function ARKodeButcherTable_CheckARKOrder(B1, B2, q, p, outfile) - ccall( - (:ARKodeButcherTable_CheckARKOrder, libsundials_arkode), - Cint, - (ARKodeButcherTable, ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), - B1, - B2, - q, - p, - outfile, - ) + ccall((:ARKodeButcherTable_CheckARKOrder, libsundials_arkode), Cint, (ARKodeButcherTable, ARKodeButcherTable, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), B1, B2, q, p, outfile) end # Julia wrapper for header: arkode_butcher_dirk.h # Automatically generated using Clang.jl + function ARKodeButcherTable_LoadDIRK(imethod::Cint) - ccall( - (:ARKodeButcherTable_LoadDIRK, libsundials_arkode), - ARKodeButcherTable, - (Cint,), - imethod, - ) + ccall((:ARKodeButcherTable_LoadDIRK, libsundials_arkode), ARKodeButcherTable, (Cint,), imethod) end function ARKodeButcherTable_LoadDIRK(imethod) @@ -1755,17 +757,13 @@ end # Julia wrapper for header: arkode_butcher_erk.h # Automatically generated using Clang.jl + function ARKodeButcherTable_LoadERK(imethod::Cint) - ccall( - (:ARKodeButcherTable_LoadERK, libsundials_arkode), - ARKodeButcherTable, - (Cint,), - imethod, - ) + ccall((:ARKodeButcherTable_LoadERK, libsundials_arkode), ARKodeButcherTable, (Cint,), imethod) end function ARKodeButcherTable_LoadERK(imethod) - ARKodeButcherTable_LoadERK(convert(Cint, imethod)) + ARKodeButcherTable_LoadERK(convert(Cint,imethod)) end # Julia wrapper for header: arkode_erkstep.h # Automatically generated using Clang.jl @@ -1777,14 +775,7 @@ end # Automatically generated using Clang.jl function ERKStepCreate(f::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall( - (:ERKStepCreate, libsundials_arkode), - ERKStepMemPtr, - (ARKRhsFn, realtype, N_Vector), - f, - t0, - y0, - ) + ccall((:ERKStepCreate, libsundials_arkode), ERKStepMemPtr, (ARKRhsFn, realtype, N_Vector), f, t0, y0) end function ERKStepCreate(f, t0, y0) @@ -1792,25 +783,8 @@ function ERKStepCreate(f, t0, y0) ERKStepCreate(ARKRhsFn_wrapper(f), t0, convert(N_Vector, __y0)) end -function ERKStepResize( - arkode_mem, - ynew::N_Vector, - hscale::realtype, - t0::realtype, - resize::ARKVecResizeFn, - resize_data, -) - ccall( - (:ERKStepResize, libsundials_arkode), - Cint, - (ERKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), - arkode_mem, - ynew, - hscale, - t0, - resize, - resize_data, - ) +function ERKStepResize(arkode_mem, ynew::N_Vector, hscale::realtype, t0::realtype, resize::ARKVecResizeFn, resize_data) + ccall((:ERKStepResize, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector, realtype, realtype, ARKVecResizeFn, Ptr{Cvoid}), arkode_mem, ynew, hscale, t0, resize, resize_data) end function ERKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) @@ -1819,15 +793,7 @@ function ERKStepResize(arkode_mem, ynew, hscale, t0, resize, resize_data) end function ERKStepReInit(arkode_mem, f::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall( - (:ERKStepReInit, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKRhsFn, realtype, N_Vector), - arkode_mem, - f, - t0, - y0, - ) + ccall((:ERKStepReInit, libsundials_arkode), Cint, (ERKStepMemPtr, ARKRhsFn, realtype, N_Vector), arkode_mem, f, t0, y0) end function ARKStepReInit(arkode_mem, f, t0, y0) @@ -1836,25 +802,11 @@ function ARKStepReInit(arkode_mem, f, t0, y0) end function ERKStepSStolerances(arkode_mem, reltol::realtype, abstol::realtype) - ccall( - (:ERKStepSStolerances, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype, realtype), - arkode_mem, - reltol, - abstol, - ) + ccall((:ERKStepSStolerances, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, realtype), arkode_mem, reltol, abstol) end function ERKStepSVtolerances(arkode_mem, reltol::realtype, abstol::N_Vector) - ccall( - (:ERKStepSVtolerances, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype, N_Vector), - arkode_mem, - reltol, - abstol, - ) + ccall((:ERKStepSVtolerances, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, N_Vector), arkode_mem, reltol, abstol) end function ERKStepSVtolerances(arkode_mem, reltol, abstol) @@ -1863,24 +815,11 @@ function ERKStepSVtolerances(arkode_mem, reltol, abstol) end function ERKStepWFtolerances(arkode_mem, efun::ARKEwtFn) - ccall( - (:ERKStepWFtolerances, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKEwtFn), - arkode_mem, - efun, - ) + ccall((:ERKStepWFtolerances, libsundials_arkode), Cint, (ERKStepMemPtr, ARKEwtFn), arkode_mem, efun) end function ERKStepRootInit(arkode_mem, nrtfn::Cint, g::ARKRootFn) - ccall( - (:ERKStepRootInit, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint, ARKRootFn), - arkode_mem, - nrtfn, - g, - ) + ccall((:ERKStepRootInit, libsundials_arkode), Cint, (ERKStepMemPtr, Cint, ARKRootFn), arkode_mem, nrtfn, g) end function ERKStepRootInit(arkode_mem, nrtfn, g::ARKRootFn) @@ -1892,13 +831,7 @@ function ERKStepSetDefaults(arkode_mem) end function ERKStepSetOrder(arkode_mem, maxord::Cint) - ccall( - (:ERKStepSetOrder, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - maxord, - ) + ccall((:ERKStepSetOrder, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, maxord) end function ERKStepSetOrder(arkode_mem, maxord) @@ -1906,13 +839,7 @@ function ERKStepSetOrder(arkode_mem, maxord) end function ERKStepSetInterpolantType(arkode_mem, itype::Cint) - ccall( - (:ERKStepSetInterpolantType, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - itype, - ) + ccall((:ERKStepSetInterpolantType, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, itype) end function ERKStepSetInterpolantType(arkode_mem, itype) @@ -1920,13 +847,7 @@ function ERKStepSetInterpolantType(arkode_mem, itype) end function ERKStepSetInterpolantDegree(arkode_mem, degree::Cint) - ccall( - (:ERKStepSetInterpolantDegree, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - degree, - ) + ccall((:ERKStepSetInterpolantDegree, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, degree) end function ERKStepSetInterpolantDegree(arkode_mem, degree) @@ -1934,13 +855,7 @@ function ERKStepSetInterpolantDegree(arkode_mem, degree) end function ERKStepSetDenseOrder(arkode_mem, dord::Cint) - ccall( - (:ERKStepSetDenseOrder, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - dord, - ) + ccall((:ERKStepSetDenseOrder, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, dord) end function ERKStepSetDenseOrder(arkode_mem, maxord) @@ -1948,23 +863,11 @@ function ERKStepSetDenseOrder(arkode_mem, maxord) end function ERKStepSetTable(arkode_mem, B) - ccall( - (:ERKStepSetTable, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKodeButcherTable), - arkode_mem, - B, - ) + ccall((:ERKStepSetTable, libsundials_arkode), Cint, (ERKStepMemPtr, ARKodeButcherTable), arkode_mem, B) end function ERKStepSetTableNum(arkode_mem, itable::Cint) - ccall( - (:ERKStepSetTableNum, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - itable, - ) + ccall((:ERKStepSetTableNum, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, itable) end function ERKStepSetTableNum(arkode_mem, itable) @@ -1972,124 +875,47 @@ function ERKStepSetTableNum(arkode_mem, itable) end function ERKStepSetCFLFraction(arkode_mem, cfl_frac::realtype) - ccall( - (:ERKStepSetCFLFraction, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - cfl_frac, - ) + ccall((:ERKStepSetCFLFraction, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, cfl_frac) end function ERKStepSetSafetyFactor(arkode_mem, safety::realtype) - ccall( - (:ERKStepSetSafetyFactor, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - safety, - ) + ccall((:ERKStepSetSafetyFactor, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, safety) end function ERKStepSetErrorBias(arkode_mem, bias::realtype) - ccall( - (:ERKStepSetErrorBias, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - bias, - ) + ccall((:ERKStepSetErrorBias, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, bias) end function ERKStepSetMaxGrowth(arkode_mem, mx_growth::realtype) - ccall( - (:ERKStepSetMaxGrowth, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - mx_growth, - ) + ccall((:ERKStepSetMaxGrowth, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, mx_growth) end function ERKStepSetFixedStepBounds(arkode_mem, lb::realtype, ub::realtype) - ccall( - (:ERKStepSetFixedStepBounds, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype, realtype), - arkode_mem, - lb, - ub, - ) -end - -function ERKStepSetAdaptivityMethod( - arkode_mem, - imethod::Cint, - idefault::Cint, - pq::Cint, - adapt_params, -) - ccall( - (:ERKStepSetAdaptivityMethod, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), - arkode_mem, - imethod, - idefault, - pq, - adapt_params, - ) + ccall((:ERKStepSetFixedStepBounds, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, realtype), arkode_mem, lb, ub) +end + +function ERKStepSetAdaptivityMethod(arkode_mem,imethod::Cint, idefault::Cint, pq::Cint, adapt_params) + ccall((:ERKStepSetAdaptivityMethod, libsundials_arkode), Cint, (ERKStepMemPtr, Cint, Cint, Cint, Ptr{realtype}), arkode_mem, imethod, idefault, pq, adapt_params) end function ERKStepSetAdaptivityMethod(arkode_mem, imethod, idefault, pq, adapt_params) - ERKStepSetAdaptivityMethod( - arkode_mem, - convert(Cint, imethod), - convert(Cint, idefault), - convert(Cint, pq), - adapt_params, - ) + ERKStepSetAdaptivityMethod(arkode_mem, convert(Cint, imethod), convert(Cint, idefault), convert(Cint, pq), adapt_params) end function ERKStepSetAdaptivityFn(arkode_mem, hfun::ARKAdaptFn, h_data) - ccall( - (:ERKStepSetAdaptivityFn, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), - arkode_mem, - hfun, - h_data, - ) + ccall((:ERKStepSetAdaptivityFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKAdaptFn, Ptr{Cvoid}), arkode_mem, hfun, h_data) end function ERKStepSetMaxFirstGrowth(arkode_mem, etamx1::realtype) - ccall( - (:ERKStepSetMaxFirstGrowth, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - etamx1, - ) + ccall((:ERKStepSetMaxFirstGrowth, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, etamx1) end function ERKStepSetMaxEFailGrowth(arkode_mem, etamxf::realtype) - ccall( - (:ERKStepSetMaxEFailGrowth, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - etamxf, - ) + ccall((:ERKStepSetMaxEFailGrowth, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, etamxf) end function ERKStepSetSmallNumEFails(arkode_mem, small_nef::Cint) - ccall( - (:ERKStepSetSmallNumEFails, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - small_nef, - ) + ccall((:ERKStepSetSmallNumEFails, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, small_nef) end function ERKStepSetSmallNumEFails(arkode_mem, small_nef) @@ -2098,24 +924,11 @@ end # Note ARKExpStabFn not implemented in Julia function ERKStepSetStabilityFn(arkode_mem, EStab, estab_data) - ccall( - (:ERKStepSetStabilityFn, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), - arkode_mem, - EStab, - estab_data, - ) + ccall((:ERKStepSetStabilityFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKExpStabFn, Ptr{Cvoid}), arkode_mem, EStab, estab_data) end function ERKStepSetMaxErrTestFails(arkode_mem, maxnef::Cint) - ccall( - (:ERKStepSetMaxErrTestFails, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - maxnef, - ) + ccall((:ERKStepSetMaxErrTestFails, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, maxnef) end function ERKStepSetMaxErrTestFails(arkode_mem, maxnef) @@ -2123,13 +936,7 @@ function ERKStepSetMaxErrTestFails(arkode_mem, maxnef) end function ERKStepSetConstraints(arkode_mem, constraints::N_Vector) - ccall( - (:ERKStepSetConstraints, libsundials_arkode), - Cint, - (ERKStepMemPtr, N_Vector), - arkode_mem, - constraints, - ) + ccall((:ERKStepSetConstraints, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector), arkode_mem, constraints) end function ERKStepSetConstraints(arkode_mem, constraints) @@ -2138,23 +945,11 @@ function ERKStepSetConstraints(arkode_mem, constraints) end function ERKStepSetMaxNumSteps(arkode_mem, mxsteps::Clong) - ccall( - (:ERKStepSetMaxNumSteps, libsundials_arkode), - Cint, - (ERKStepMemPtr, Clong), - arkode_mem, - mxsteps, - ) + ccall((:ERKStepSetMaxNumSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Clong), arkode_mem, mxsteps) end function ERKStepSetMaxHnilWarns(arkode_mem, mxhnil::Cint) - ccall( - (:ERKStepSetMaxHnilWarns, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - mxhnil, - ) + ccall((:ERKStepSetMaxHnilWarns, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, mxhnil) end function ERKStepSetMaxHnilWarns(arkode_mem, mxhnil) @@ -2162,63 +957,27 @@ function ERKStepSetMaxHnilWarns(arkode_mem, mxhnil) end function ERKStepSetInitStep(arkode_mem, hin::realtype) - ccall( - (:ERKStepSetInitStep, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - hin, - ) + ccall((:ERKStepSetInitStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hin) end function ERKStepSetMinStep(arkode_mem, hmin::realtype) - ccall( - (:ERKStepSetMinStep, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - hmin, - ) + ccall((:ERKStepSetMinStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hmin) end function ERKStepSetMaxStep(arkode_mem, hmax::realtype) - ccall( - (:ERKStepSetMaxStep, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - hmax, - ) + ccall((:ERKStepSetMaxStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hmax) end function ERKStepSetStopTime(arkode_mem, tstop::realtype) - ccall( - (:ERKStepSetStopTime, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - tstop, - ) + ccall((:ERKStepSetStopTime, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, tstop) end function ERKStepSetFixedStep(arkode_mem, hfixed::realtype) - ccall( - (:ERKStepSetFixedStep, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype), - arkode_mem, - hfixed, - ) + ccall((:ERKStepSetFixedStep, libsundials_arkode), Cint, (ERKStepMemPtr, realtype), arkode_mem, hfixed) end function ERKStepSetMaxNumConstrFails(arkode_mem, maxfails::Cint) - ccall( - (:ERKStepSetMaxNumConstrFails, libsundials_arkode), - Cint, - (ERKStepMemPtr, Cint), - arkode_mem, - maxfails, - ) + ccall((:ERKStepSetMaxNumConstrFails, libsundials_arkode), Cint, (ERKStepMemPtr, Cint), arkode_mem, maxfails) end function ERKStepSetMaxNumConstrFails(arkode_mem, maxfails) @@ -2226,97 +985,40 @@ function ERKStepSetMaxNumConstrFails(arkode_mem, maxfails) end function ERKStepSetRootDirection(arkode_mem, rootdir) - ccall( - (:ERKStepSetRootDirection, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Cint}), - arkode_mem, - rootdir, - ) + ccall((:ERKStepSetRootDirection, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Cint}), arkode_mem, rootdir) end function ERKStepSetNoInactiveRootWarn(arkode_mem) - ccall( - (:ERKStepSetNoInactiveRootWarn, libsundials_arkode), - Cint, - (ERKStepMemPtr,), - arkode_mem, - ) + ccall((:ERKStepSetNoInactiveRootWarn, libsundials_arkode), Cint, (ERKStepMemPtr,), arkode_mem) end function ERKStepSetErrHandlerFn(arkode_mem, ehfun::ARKErrHandlerFn, eh_data) - ccall( - (:ERKStepSetErrHandlerFn, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), - arkode_mem, - ehfun, - eh_data, - ) + ccall((:ERKStepSetErrHandlerFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), arkode_mem, ehfun, eh_data) end function ERKStepSetErrFile(arkode_mem, errfp) - ccall( - (:ERKStepSetErrFile, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{FILE}), - arkode_mem, - errfp, - ) + ccall((:ERKStepSetErrFile, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, errfp) end function ERKStepSetUserData(arkode_mem, user_data) - ccall( - (:ERKStepSetUserData, libsundials_arkode), - Cint, - (ERKStepMemPtr, Any), - arkode_mem, - user_data, - ) + ccall((:ERKStepSetUserData, libsundials_arkode), Cint, (ERKStepMemPtr, Any), arkode_mem, user_data) end function ERKStepSetDiagnostics(arkode_mem, diagfp) - ccall( - (:ERKStepSetDiagnostics, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{FILE}), - arkode_mem, - diagfp, - ) + ccall((:ERKStepSetDiagnostics, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, diagfp) end #Note, this const was before ARKPostProcessStepFn and now ARKPostProcessFn function ERKStepSetPostprocessStepFn(arkode_mem, ProcessStep::ARKPostProcessFn) - ccall( - (:ERKStepSetPostprocessStepFn, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKPostProcessFn), - arkode_mem, - ProcessStep, - ) + ccall((:ERKStepSetPostprocessStepFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStep) end function ERKStepSetPostprocessStageFn(arkode_mem, ProcessStage::ARKPostProcessFn) - ccall( - (:ERKStepSetPostprocessStageFn, libsundials_arkode), - Cint, - (ERKStepMemPtr, ARKPostProcessFn), - arkode_mem, - ProcessStage, - ) + ccall((:ERKStepSetPostprocessStageFn, libsundials_arkode), Cint, (ERKStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStage) end function ERKStepEvolve(arkode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall( - (:ERKStepEvolve, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), - arkode_mem, - tout, - yout, - tret, - itask, - ) + ccall((:ERKStepEvolve, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), arkode_mem, tout, yout, tret, itask) end function ERKStepEvolve(arkode_mem, tout, yout, tret, itask) @@ -2325,15 +1027,7 @@ function ERKStepEvolve(arkode_mem, tout, yout, tret, itask) end function ERKStepGetDky(arkode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:ERKStepGetDky, libsundials_arkode), - Cint, - (ERKStepMemPtr, realtype, Cint, N_Vector), - arkode_mem, - t, - k, - dky, - ) + ccall((:ERKStepGetDky, libsundials_arkode), Cint, (ERKStepMemPtr, realtype, Cint, N_Vector), arkode_mem, t, k, dky) end function ERKStepGetDky(arkode_mem, t::realtype, k, dky) @@ -2342,73 +1036,31 @@ function ERKStepGetDky(arkode_mem, t::realtype, k, dky) end function ERKStepGetNumExpSteps(arkode_mem, expsteps) - ccall( - (:ERKStepGetNumExpSteps, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - expsteps, - ) + ccall((:ERKStepGetNumExpSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, expsteps) end function ERKStepGetNumAccSteps(arkode_mem, accsteps) - ccall( - (:ERKStepGetNumAccSteps, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - accsteps, - ) + ccall((:ERKStepGetNumAccSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, accsteps) end function ERKStepGetNumStepAttempts(arkode_mem, step_attempts) - ccall( - (:ERKStepGetNumStepAttempts, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - step_attempts, - ) + ccall((:ERKStepGetNumStepAttempts, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, step_attempts) end function ERKStepGetNumRhsEvals(arkode_mem, nfevals) - ccall( - (:ERKStepGetNumRhsEvals, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - nfevals, - ) + ccall((:ERKStepGetNumRhsEvals, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, nfevals) end function ERKStepGetNumErrTestFails(arkode_mem, netfails) - ccall( - (:ERKStepGetNumErrTestFails, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - netfails, - ) + ccall((:ERKStepGetNumErrTestFails, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, netfails) end function ERKStepGetCurrentButcherTable(arkode_mem, B) - ccall( - (:ERKStepGetCurrentButcherTable, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{ARKodeButcherTable}), - arkode_mem, - B, - ) + ccall((:ERKStepGetCurrentButcherTable, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{ARKodeButcherTable}), arkode_mem, B) end function ERKStepGetEstLocalErrors(arkode_mem, ele::N_Vector) - ccall( - (:ERKStepGetEstLocalErrors, libsundials_arkode), - Cint, - (ERKStepMemPtr, N_Vector), - arkode_mem, - ele, - ) + ccall((:ERKStepGetEstLocalErrors, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector), arkode_mem, ele) end function ERKStepGetEstLocalErrors(arkode_mem, ele) @@ -2417,84 +1069,35 @@ function ERKStepGetEstLocalErrors(arkode_mem, ele) end function ERKStepGetWorkSpace(arkode_mem, lenrw, leniw) - ccall( - (:ERKStepGetWorkSpace, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - lenrw, - leniw, - ) + ccall((:ERKStepGetWorkSpace, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrw, leniw) end function ERKStepGetNumSteps(arkode_mem, nsteps) - ccall( - (:ERKStepGetNumSteps, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - nsteps, - ) + ccall((:ERKStepGetNumSteps, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, nsteps) end function ERKStepGetActualInitStep(arkode_mem, hinused) - ccall( - (:ERKStepGetActualInitStep, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{realtype}), - arkode_mem, - hinused, - ) + ccall((:ERKStepGetActualInitStep, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, hinused) end function ERKStepGetLastStep(arkode_mem, hlast) - ccall( - (:ERKStepGetLastStep, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{realtype}), - arkode_mem, - hlast, - ) + ccall((:ERKStepGetLastStep, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, hlast) end function ERKStepGetCurrentStep(arkode_mem, hcur) - ccall( - (:ERKStepGetCurrentStep, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{realtype}), - arkode_mem, - hcur, - ) + ccall((:ERKStepGetCurrentStep, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, hcur) end function ERKStepGetCurrentTime(arkode_mem, tcur) - ccall( - (:ERKStepGetCurrentTime, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{realtype}), - arkode_mem, - tcur, - ) + ccall((:ERKStepGetCurrentTime, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, tcur) end function ERKStepGetTolScaleFactor(arkode_mem, tolsfac) - ccall( - (:ERKStepGetTolScaleFactor, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{realtype}), - arkode_mem, - tolsfac, - ) + ccall((:ERKStepGetTolScaleFactor, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{realtype}), arkode_mem, tolsfac) end function ERKStepGetErrWeights(arkode_mem, eweight::N_Vector) - ccall( - (:ERKStepGetErrWeights, libsundials_arkode), - Cint, - (ERKStepMemPtr, N_Vector), - arkode_mem, - eweight, - ) + ccall((:ERKStepGetErrWeights, libsundials_arkode), Cint, (ERKStepMemPtr, N_Vector), arkode_mem, eweight) end function ERKStepGetErrWeights(arkode_mem, eweight) @@ -2503,33 +1106,15 @@ function ERKStepGetErrWeights(arkode_mem, eweight) end function ERKStepGetNumGEvals(arkode_mem, ngevals) - ccall( - (:ERKStepGetNumGEvals, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - ngevals, - ) + ccall((:ERKStepGetNumGEvals, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, ngevals) end function ERKStepGetRootInfo(arkode_mem, rootsfound) - ccall( - (:ERKStepGetRootInfo, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Cint}), - arkode_mem, - rootsfound, - ) + ccall((:ERKStepGetRootInfo, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Cint}), arkode_mem, rootsfound) end function ERKStepGetNumConstrFails(arkode_mem, nconstrfails) - ccall( - (:ERKStepGetNumConstrFails, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}), - arkode_mem, - nconstrfails, - ) + ccall((:ERKStepGetNumConstrFails, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}), arkode_mem, nconstrfails) end function ERKStepGetReturnFlagName(flag::Clong) @@ -2537,65 +1122,19 @@ function ERKStepGetReturnFlagName(flag::Clong) end function ERKStepWriteParameters(arkode_mem, fp) - ccall( - (:ERKStepWriteParameters, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{FILE}), - arkode_mem, - fp, - ) + ccall((:ERKStepWriteParameters, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, fp) end function ERKStepWriteButcher(arkode_mem, fp) - ccall( - (:ERKStepWriteButcher, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{FILE}), - arkode_mem, - fp, - ) -end - -function ERKStepGetTimestepperStats( - arkode_mem, - expsteps, - accsteps, - step_attempts, - nfevals, - netfails, -) - ccall( - (:ERKStepGetTimestepperStats, libsundials_arkode), - Cint, - (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - expsteps, - accsteps, - step_attempts, - nfevals, - netfails, - ) + ccall((:ERKStepWriteButcher, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, fp) +end + +function ERKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attempts, nfevals, netfails) + ccall((:ERKStepGetTimestepperStats, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), arkode_mem, expsteps, accsteps, step_attempts, nfevals, netfails) end function ERKStepGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur) - ccall( - (:ERKStepGetStepStats, libsundials_arkode), - Cint, - ( - ERKStepMemPtr, - Ptr{Clong}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - ), - arkode_mem, - nsteps, - hinused, - hlast, - hcur, - tcur, - ) + ccall((:ERKStepGetStepStats, libsundials_arkode), Cint, (ERKStepMemPtr, Ptr{Clong}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), arkode_mem, nsteps, hinused, hlast, hcur, tcur) end function ERKStepFree(arkode_mem) @@ -2603,13 +1142,7 @@ function ERKStepFree(arkode_mem) end function ERKStepPrintMem(arkode_mem, outfile) - ccall( - (:ERKStepPrintMem, libsundials_arkode), - Cvoid, - (ERKStepMemPtr, Ptr{FILE}), - arkode_mem, - outfile, - ) + ccall((:ERKStepPrintMem, libsundials_arkode), Cvoid, (ERKStepMemPtr, Ptr{FILE}), arkode_mem, outfile) end # Julia wrapper for header: arkode_ls.h # Automatically generated using Clang.jl @@ -2617,47 +1150,18 @@ end # Julia wrapper for header: arkode_mristep.h # Automatically generated using Clang.jl -function MRIStepCreate( - fs::ARKRhsFn, - t0::realtype, - y0::N_Vector, - inner_step_id, - inner_step_mem, -) - ccall( - (:MRIStepCreate, libsundials_arkode), - MRIStepMemPtr, - (ARKRhsFn, realtype, N_Vector, Sundials.MRISTEP_ID, Ptr{Cvoid}), - fs, - t0, - y0, - inner_step_id, - inner_step_mem, - ) + +function MRIStepCreate(fs::ARKRhsFn, t0::realtype, y0::N_Vector, inner_step_id, inner_step_mem) + ccall((:MRIStepCreate, libsundials_arkode), MRIStepMemPtr, (ARKRhsFn, realtype, N_Vector, Sundials.MRISTEP_ID, Ptr{Cvoid}), fs, t0, y0, inner_step_id, inner_step_mem) end function MRIStepCreate(fs, t0::realtype, y0, inner_step_mem) __y0 = convert(NVector, y0) - return MRIStepCreate( - ARKRhsFn_wrapper(fs), - t0, - convert(N_Vector, __y0), - Sundials.MRISTEP_ARKSTEP, - inner_step_mem, - ) + return MRIStepCreate(ARKRhsFn_wrapper(fs), t0, convert(N_Vector, __y0), Sundials.MRISTEP_ARKSTEP, inner_step_mem) end function MRIStepResize(arkode_mem, ynew::N_Vector, t0::realtype, resize, resize_data) - ccall( - (:MRIStepResize, libsundials_arkode), - Cint, - (MRIStepMemPtr, N_Vector, realtype, ARKVecResizeFn, Ptr{Cvoid}), - arkode_mem, - ynew, - t0, - resize, - resize_data, - ) + ccall((:MRIStepResize, libsundials_arkode), Cint, (MRIStepMemPtr, N_Vector, realtype, ARKVecResizeFn, Ptr{Cvoid}), arkode_mem, ynew, t0, resize, resize_data) end function MRIStepResize(arkode_mem, ynew, t0::realtype, resize, resize_data) @@ -2666,15 +1170,7 @@ function MRIStepResize(arkode_mem, ynew, t0::realtype, resize, resize_data) end function MRIStepReInit(arkode_mem, fs::ARKRhsFn, t0::realtype, y0::N_Vector) - ccall( - (:MRIStepReInit, libsundials_arkode), - Cint, - (MRIStepMemPtr, ARKRhsFn, realtype, N_Vector), - arkode_mem, - fs, - t0, - y0, - ) + ccall((:MRIStepReInit, libsundials_arkode), Cint, (MRIStepMemPtr, ARKRhsFn, realtype, N_Vector), arkode_mem, fs, t0, y0) end function MRIStepReInit(arkode_mem, fs, t0, y0) @@ -2683,14 +1179,7 @@ function MRIStepReInit(arkode_mem, fs, t0, y0) end function MRIStepRootInit(arkode_mem, nrtfn::Cint, g::ARKRootFn) - ccall( - (:MRIStepRootInit, libsundials_arkode), - Cint, - (MRIStepMemPtr, Cint, ARKRootFn), - arkode_mem, - nrtfn, - g, - ) + ccall((:MRIStepRootInit, libsundials_arkode), Cint, (MRIStepMemPtr, Cint, ARKRootFn), arkode_mem, nrtfn, g) end function MRIStepRootInit(arkode_mem, nrtfn, g::ARKRootFn) @@ -2702,13 +1191,7 @@ function MRIStepSetDefaults(arkode_mem) end function MRIStepSetInterpolantType(arkode_mem, itype::Cint) - ccall( - (:MRIStepSetInterpolantType, libsundials_arkode), - Cint, - (MRIStepMemPtr, Cint), - arkode_mem, - itype, - ) + ccall((:MRIStepSetInterpolantType, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, itype) end function MRIStepSetInterpolantType(arkode_mem, itype) @@ -2716,13 +1199,7 @@ function MRIStepSetInterpolantType(arkode_mem, itype) end function MRIStepSetInterpolantDegree(arkode_mem, degree::Cint) - ccall( - (:MRIStepSetInterpolantDegree, libsundials_arkode), - Cint, - (MRIStepMemPtr, Cint), - arkode_mem, - degree, - ) + ccall((:MRIStepSetInterpolantDegree, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, degree) end function MRIStepSetInterpolantDegree(arkode_mem, degree) @@ -2730,13 +1207,7 @@ function MRIStepSetInterpolantDegree(arkode_mem, degree) end function MRIStepSetDenseOrder(arkode_mem, dord::Cint) - ccall( - (:MRIStepSetDenseOrder, libsundials_arkode), - Cint, - (MRIStepMemPtr, Cint), - arkode_mem, - dord, - ) + ccall((:MRIStepSetDenseOrder, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, dord) end function MRIStepDenseSetOrder(arkode_mem, dord) @@ -2744,14 +1215,7 @@ function MRIStepDenseSetOrder(arkode_mem, dord) end function MRIStepSetTable(arkode_mem, q::Cint, B) - ccall( - (:MRIStepSetTable, libsundials_arkode), - Cint, - (MRIStepMemPtr, Cint, ARKodeButcherTable), - arkode_mem, - q, - B, - ) + ccall((:MRIStepSetTable, libsundials_arkode), Cint, (MRIStepMemPtr, Cint, ARKodeButcherTable), arkode_mem, q, B) end function MRIStepSetTable(arkode_mem, q, B) @@ -2759,13 +1223,7 @@ function MRIStepSetTable(arkode_mem, q, B) end function MRIStepSetTableNum(arkode_mem, itable::Cint) - ccall( - (:MRIStepSetTableNum, libsundials_arkode), - Cint, - (MRIStepMemPtr, Cint), - arkode_mem, - itable, - ) + ccall((:MRIStepSetTableNum, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, itable) end function MRIStepSetTableNum(arkode_mem, itable) @@ -2773,23 +1231,11 @@ function MRIStepSetTableNum(arkode_mem, itable) end function MRIStepSetMaxNumSteps(arkode_mem, mxsteps::Clong) - ccall( - (:MRIStepSetMaxNumSteps, libsundials_arkode), - Cint, - (MRIStepMemPtr, Clong), - arkode_mem, - mxsteps, - ) + ccall((:MRIStepSetMaxNumSteps, libsundials_arkode), Cint, (MRIStepMemPtr, Clong), arkode_mem, mxsteps) end function MRIStepSetMaxHnilWarns(arkode_mem, mxhnil::Cint) - ccall( - (:MRIStepSetMaxHnilWarns, libsundials_arkode), - Cint, - (MRIStepMemPtr, Cint), - arkode_mem, - mxhnil, - ) + ccall((:MRIStepSetMaxHnilWarns, libsundials_arkode), Cint, (MRIStepMemPtr, Cint), arkode_mem, mxhnil) end function MRIStepSetMaxHnilWarns(arkode_mem, mxhnil) @@ -2797,139 +1243,58 @@ function MRIStepSetMaxHnilWarns(arkode_mem, mxhnil) end function MRIStepSetStopTime(arkode_mem, tstop) - ccall( - (:MRIStepSetStopTime, libsundials_arkode), - Cint, - (MRIStepMemPtr, realtype), - arkode_mem, - tstop, - ) + ccall((:MRIStepSetStopTime, libsundials_arkode), Cint, (MRIStepMemPtr, realtype), arkode_mem, tstop) end function MRIStepSetFixedStep(arkode_mem, hsfixed::realtype) - ccall( - (:MRIStepSetFixedStep, libsundials_arkode), - Cint, - (MRIStepMemPtr, realtype), - arkode_mem, - hsfixed, - ) + ccall((:MRIStepSetFixedStep, libsundials_arkode), Cint, (MRIStepMemPtr, realtype), arkode_mem, hsfixed) end function MRIStepSetRootDirection(arkode_mem, rootdir) - ccall( - (:MRIStepSetRootDirection, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{Cint}), - arkode_mem, - rootdir, - ) + ccall((:MRIStepSetRootDirection, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Cint}), arkode_mem, rootdir) end function MRIStepSetNoInactiveRootWarn(arkode_mem) - ccall( - (:MRIStepSetNoInactiveRootWarn, libsundials_arkode), - Cint, - (MRIStepMemPtr,), - arkode_mem, - ) + ccall((:MRIStepSetNoInactiveRootWarn, libsundials_arkode), Cint, (MRIStepMemPtr,), arkode_mem) end function MRIStepSetErrHandlerFn(arkode_mem, ehfun::ARKErrHandlerFn, eh_data) - ccall( - (:MRIStepSetErrHandlerFn, libsundials_arkode), - Cint, - (MRIStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), - arkode_mem, - ehfun, - eh_data, - ) + ccall((:MRIStepSetErrHandlerFn, libsundials_arkode), Cint, (MRIStepMemPtr, ARKErrHandlerFn, Ptr{Cvoid}), arkode_mem, ehfun, eh_data) end function MRIStepSetErrFile(arkode_mem, errfp) - ccall( - (:MRIStepSetErrFile, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{FILE}), - arkode_mem, - errfp, - ) + ccall((:MRIStepSetErrFile, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, errfp) end function MRIStepSetUserData(arkode_mem, user_data) - ccall( - (:MRIStepSetUserData, libsundials_arkode), - Cint, - (MRIStepMemPtr, Any), - arkode_mem, - user_data, - ) + ccall((:MRIStepSetUserData, libsundials_arkode), Cint, (MRIStepMemPtr, Any), arkode_mem, user_data) end function MRIStepSetDiagnostics(arkode_mem, diagfp) - ccall( - (:MRIStepSetDiagnostics, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{FILE}), - arkode_mem, - diagfp, - ) + ccall((:MRIStepSetDiagnostics, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, diagfp) end #new ARKPostProcessFn type. Before it was ARKPostProcessStepFn function MRIStepSetPostprocessStepFn(arkode_mem, ProcessStep::ARKPostProcessFn) - ccall( - (:MRIStepSetPostprocessStepFn, libsundials_arkode), - Cint, - (MRIStepMemPtr, ARKPostProcessFn), - arkode_mem, - ProcessStep, - ) + ccall((:MRIStepSetPostprocessStepFn, libsundials_arkode), Cint, (MRIStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStep) end function MRIStepSetPostprocessStageFn(arkode_mem, ProcessStage::ARKPostProcessFn) - ccall( - (:MRIStepSetPostprocessStageFn, libsundials_arkode), - Cint, - (MRIStepMemPtr, ARKPostProcessFn), - arkode_mem, - ProcessStage, - ) + ccall((:MRIStepSetPostprocessStageFn, libsundials_arkode), Cint, (MRIStepMemPtr, ARKPostProcessFn), arkode_mem, ProcessStage) end #This one does not have MRIStepPreInnerFn function MRIStepSetPreInnerFn(arkode_mem, prefn::MRIStepPreInnerFn) - ccall( - (:MRIStepSetPreInnerFn, libsundials_arkode), - Cint, - (MRIStepMemPtr, MRIStepPreInnerFn), - arkode_mem, - prefn, - ) + ccall((:MRIStepSetPreInnerFn, libsundials_arkode), Cint, (MRIStepMemPtr, MRIStepPreInnerFn), arkode_mem, prefn) end #This one does not have MRIStepPostInnerFn function MRIStepSetPostInnerFn(arkode_mem, postfn::MRIStepPostInnerFn) - ccall( - (:MRIStepSetPostInnerFn, libsundials_arkode), - Cint, - (MRIStepMemPtr, MRIStepPostInnerFn), - arkode_mem, - postfn, - ) + ccall((:MRIStepSetPostInnerFn, libsundials_arkode), Cint, (MRIStepMemPtr, MRIStepPostInnerFn), arkode_mem, postfn) end function MRIStepEvolve(arkode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall( - (:MRIStepEvolve, libsundials_arkode), - Cint, - (MRIStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), - arkode_mem, - tout, - yout, - tret, - itask, - ) + ccall((:MRIStepEvolve, libsundials_arkode), Cint, (MRIStepMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), arkode_mem, tout, yout, tret, itask) end function MRIStepEvolve(arkode_mem, tout, yout, tret, itask) @@ -2938,15 +1303,7 @@ function MRIStepEvolve(arkode_mem, tout, yout, tret, itask) end function MRIStepGetDky(arkode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:MRIStepGetDky, libsundials_arkode), - Cint, - (MRIStepMemPtr, realtype, Cint, N_Vector), - arkode_mem, - t, - k, - dky, - ) + ccall((:MRIStepGetDky, libsundials_arkode), Cint, (MRIStepMemPtr, realtype, Cint, N_Vector), arkode_mem, t, k, dky) end function MRIStepGetDky(arkode_mem, t::realtype, k, dky) @@ -2955,104 +1312,43 @@ function MRIStepGetDky(arkode_mem, t::realtype, k, dky) end function MRIStepGetNumRhsEvals(arkode_mem, nfs_evals) - ccall( - (:MRIStepGetNumRhsEvals, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{Clong}), - arkode_mem, - nfs_evals, - ) + ccall((:MRIStepGetNumRhsEvals, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}), arkode_mem, nfs_evals) end function MRIStepGetCurrentButcherTables(arkode_mem, B) - ccall( - (:MRIStepGetCurrentButcherTables, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{ARKodeButcherTable}), - arkode_mem, - B, - ) + ccall((:MRIStepGetCurrentButcherTables, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{ARKodeButcherTable}), arkode_mem, B) end function MRIStepGetWorkSpace(arkode_mem, lenrw, leniw) - ccall( - (:MRIStepGetWorkSpace, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{Clong}, Ptr{Clong}), - arkode_mem, - lenrw, - leniw, - ) + ccall((:MRIStepGetWorkSpace, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}, Ptr{Clong}), arkode_mem, lenrw, leniw) end function MRIStepGetNumSteps(arkode_mem, nssteps) - ccall( - (:MRIStepGetNumSteps, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{Clong}), - arkode_mem, - nssteps, - ) + ccall((:MRIStepGetNumSteps, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}), arkode_mem, nssteps) end function MRIStepGetLastStep(arkode_mem, hlast) - ccall( - (:MRIStepGetLastStep, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{realtype}), - arkode_mem, - hlast, - ) + ccall((:MRIStepGetLastStep, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{realtype}), arkode_mem, hlast) end function MRIStepGetCurrentTime(arkode_mem, tcur) - ccall( - (:MRIStepGetCurrentTime, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{realtype}), - arkode_mem, - tcur, - ) + ccall((:MRIStepGetCurrentTime, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{realtype}), arkode_mem, tcur) end function MRIStepGetCurrentState(arkode_mem, ycur) - ccall( - (:MRIStepGetCurrentState, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{N_Vector}), - arkode_mem, - ycur, - ) + ccall((:MRIStepGetCurrentState, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{N_Vector}), arkode_mem, ycur) end function MRIStepGetNumGEvals(arkode_mem, ngevals) - ccall( - (:MRIStepGetNumGEvals, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{Clong}), - arkode_mem, - ngevals, - ) + ccall((:MRIStepGetNumGEvals, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Clong}), arkode_mem, ngevals) end function MRIStepGetRootInfo(arkode_mem, rootsfound) - ccall( - (:MRIStepGetRootInfo, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{Cint}), - arkode_mem, - rootsfound, - ) + ccall((:MRIStepGetRootInfo, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Cint}), arkode_mem, rootsfound) end function MRIStepGetLastInnerStepFlag(arkode_mem, flag) - ccall( - (:MRIStepGetLastInnerStepFlag, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{Cint}), - arkode_mem, - flag, - ) + ccall((:MRIStepGetLastInnerStepFlag, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{Cint}), arkode_mem, flag) end function MRIStepGetReturnFlagName(flag) @@ -3060,23 +1356,11 @@ function MRIStepGetReturnFlagName(flag) end function MRIStepWriteParameters(arkode_mem, fp) - ccall( - (:MRIStepWriteParameters, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{FILE}), - arkode_mem, - fp, - ) + ccall((:MRIStepWriteParameters, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, fp) end function MRIStepWriteButcher(arkode_mem, fp) - ccall( - (:MRIStepWriteButcher, libsundials_arkode), - Cint, - (MRIStepMemPtr, Ptr{FILE}), - arkode_mem, - fp, - ) + ccall((:MRIStepWriteButcher, libsundials_arkode), Cint, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, fp) end function MRIStepFree(arkode_mem) @@ -3084,11 +1368,5 @@ function MRIStepFree(arkode_mem) end function MRIStepPrintMem(arkode_mem, outfile) - ccall( - (:MRIStepPrintMem, libsundials_arkode), - Cvoid, - (MRIStepMemPtr, Ptr{FILE}), - arkode_mem, - outfile, - ) + ccall((:MRIStepPrintMem, libsundials_arkode), Cvoid, (MRIStepMemPtr, Ptr{FILE}), arkode_mem, outfile) end diff --git a/src/API/cvode.jl b/src/API/cvode.jl index 8f70d07a..5b39ff37 100644 --- a/src/API/cvode.jl +++ b/src/API/cvode.jl @@ -1,6 +1,7 @@ # Julia wrapper for header: cvode.h # Automatically generated using Clang.jl + function CVodeCreate(lmm::Cint) ccall((:CVodeCreate, libsundials_cvode), CVODEMemPtr, (Cint,), lmm) end @@ -10,15 +11,7 @@ function CVodeCreate(lmm) end function CVodeInit(cvode_mem, f::CVRhsFn, t0::realtype, y0::N_Vector) - ccall( - (:CVodeInit, libsundials_cvode), - Cint, - (CVODEMemPtr, CVRhsFn, realtype, N_Vector), - cvode_mem, - f, - t0, - y0, - ) + ccall((:CVodeInit, libsundials_cvode), Cint, (CVODEMemPtr, CVRhsFn, realtype, N_Vector), cvode_mem, f, t0, y0) end function CVodeInit(cvode_mem, f, t0, y0) @@ -27,14 +20,7 @@ function CVodeInit(cvode_mem, f, t0, y0) end function CVodeReInit(cvode_mem, t0::realtype, y0::N_Vector) - ccall( - (:CVodeReInit, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype, N_Vector), - cvode_mem, - t0, - y0, - ) + ccall((:CVodeReInit, libsundials_cvode), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, t0, y0) end function CVodeReInit(cvode_mem, t0, y0) @@ -43,25 +29,11 @@ function CVodeReInit(cvode_mem, t0, y0) end function CVodeSStolerances(cvode_mem, reltol::realtype, abstol::realtype) - ccall( - (:CVodeSStolerances, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype, realtype), - cvode_mem, - reltol, - abstol, - ) + ccall((:CVodeSStolerances, libsundials_cvode), Cint, (CVODEMemPtr, realtype, realtype), cvode_mem, reltol, abstol) end function CVodeSVtolerances(cvode_mem, reltol::realtype, abstol::N_Vector) - ccall( - (:CVodeSVtolerances, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype, N_Vector), - cvode_mem, - reltol, - abstol, - ) + ccall((:CVodeSVtolerances, libsundials_cvode), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, reltol, abstol) end function CVodeSVtolerances(cvode_mem, reltol, abstol) @@ -70,54 +42,23 @@ function CVodeSVtolerances(cvode_mem, reltol, abstol) end function CVodeWFtolerances(cvode_mem, efun::CVEwtFn) - ccall( - (:CVodeWFtolerances, libsundials_cvode), - Cint, - (CVODEMemPtr, CVEwtFn), - cvode_mem, - efun, - ) + ccall((:CVodeWFtolerances, libsundials_cvode), Cint, (CVODEMemPtr, CVEwtFn), cvode_mem, efun) end function CVodeSetErrHandlerFn(cvode_mem, ehfun::CVErrHandlerFn, eh_data) - ccall( - (:CVodeSetErrHandlerFn, libsundials_cvode), - Cint, - (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), - cvode_mem, - ehfun, - eh_data, - ) + ccall((:CVodeSetErrHandlerFn, libsundials_cvode), Cint, (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), cvode_mem, ehfun, eh_data) end function CVodeSetErrFile(cvode_mem, errfp) - ccall( - (:CVodeSetErrFile, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{FILE}), - cvode_mem, - errfp, - ) + ccall((:CVodeSetErrFile, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{FILE}), cvode_mem, errfp) end function CVodeSetUserData(cvode_mem, user_data) - ccall( - (:CVodeSetUserData, libsundials_cvode), - Cint, - (CVODEMemPtr, Any), - cvode_mem, - user_data, - ) + ccall((:CVodeSetUserData, libsundials_cvode), Cint, (CVODEMemPtr, Any), cvode_mem, user_data) end function CVodeSetMaxOrd(cvode_mem, maxord::Cint) - ccall( - (:CVodeSetMaxOrd, libsundials_cvode), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxord, - ) + ccall((:CVodeSetMaxOrd, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxord) end function CVodeSetMaxOrd(cvode_mem, maxord) @@ -125,13 +66,7 @@ function CVodeSetMaxOrd(cvode_mem, maxord) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps::Clong) - ccall( - (:CVodeSetMaxNumSteps, libsundials_cvode), - Cint, - (CVODEMemPtr, Clong), - cvode_mem, - mxsteps, - ) + ccall((:CVodeSetMaxNumSteps, libsundials_cvode), Cint, (CVODEMemPtr, Clong), cvode_mem, mxsteps) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps) @@ -139,13 +74,7 @@ function CVodeSetMaxNumSteps(cvode_mem, mxsteps) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil::Clong) - ccall( - (:CVodeSetMaxHnilWarns, libsundials_cvode), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - mxhnil, - ) + ccall((:CVodeSetMaxHnilWarns, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, mxhnil) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) @@ -153,13 +82,7 @@ function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) end function CVodeSetStabLimDet(cvode_mem, stldet::Cint) - ccall( - (:CVodeSetStabLimDet, libsundials_cvode), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - stldet, - ) + ccall((:CVodeSetStabLimDet, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, stldet) end function CVodeSetStabLimDet(cvode_mem, stldet) @@ -167,53 +90,23 @@ function CVodeSetStabLimDet(cvode_mem, stldet) end function CVodeSetInitStep(cvode_mem, hin::realtype) - ccall( - (:CVodeSetInitStep, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - hin, - ) + ccall((:CVodeSetInitStep, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, hin) end function CVodeSetMinStep(cvode_mem, hmin::realtype) - ccall( - (:CVodeSetMinStep, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - hmin, - ) + ccall((:CVodeSetMinStep, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, hmin) end function CVodeSetMaxStep(cvode_mem, hmax::realtype) - ccall( - (:CVodeSetMaxStep, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - hmax, - ) + ccall((:CVodeSetMaxStep, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, hmax) end function CVodeSetStopTime(cvode_mem, tstop::realtype) - ccall( - (:CVodeSetStopTime, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - tstop, - ) + ccall((:CVodeSetStopTime, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, tstop) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef::Cint) - ccall( - (:CVodeSetMaxErrTestFails, libsundials_cvode), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxnef, - ) + ccall((:CVodeSetMaxErrTestFails, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxnef) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef) @@ -221,13 +114,7 @@ function CVodeSetMaxErrTestFails(cvode_mem, maxnef) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor::Cint) - ccall( - (:CVodeSetMaxNonlinIters, libsundials_cvode), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxcor, - ) + ccall((:CVodeSetMaxNonlinIters, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxcor) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor) @@ -235,13 +122,7 @@ function CVodeSetMaxNonlinIters(cvode_mem, maxcor) end function CVodeSetMaxConvFails(cvode_mem, maxncf::Cint) - ccall( - (:CVodeSetMaxConvFails, libsundials_cvode), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxncf, - ) + ccall((:CVodeSetMaxConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Cint), cvode_mem, maxncf) end function CVodeSetMaxConvFails(cvode_mem, maxncf) @@ -249,23 +130,11 @@ function CVodeSetMaxConvFails(cvode_mem, maxncf) end function CVodeSetNonlinConvCoef(cvode_mem, nlscoef::realtype) - ccall( - (:CVodeSetNonlinConvCoef, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - nlscoef, - ) + ccall((:CVodeSetNonlinConvCoef, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, nlscoef) end function CVodeSetConstraints(cvode_mem, constraints::N_Vector) - ccall( - (:CVodeSetConstraints, libsundials_cvode), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - constraints, - ) + ccall((:CVodeSetConstraints, libsundials_cvode), Cint, (CVODEMemPtr, N_Vector), cvode_mem, constraints) end function CVodeSetConstraints(cvode_mem, constraints) @@ -274,24 +143,11 @@ function CVodeSetConstraints(cvode_mem, constraints) end function CVodeSetNonlinearSolver(cvode_mem, NLS::SUNNonlinearSolver) - ccall( - (:CVodeSetNonlinearSolver, libsundials_cvode), - Cint, - (CVODEMemPtr, SUNNonlinearSolver), - cvode_mem, - NLS, - ) + ccall((:CVodeSetNonlinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) end function CVodeRootInit(cvode_mem, nrtfn::Cint, g::CVRootFn) - ccall( - (:CVodeRootInit, libsundials_cvode), - Cint, - (CVODEMemPtr, Cint, CVRootFn), - cvode_mem, - nrtfn, - g, - ) + ccall((:CVodeRootInit, libsundials_cvode), Cint, (CVODEMemPtr, Cint, CVRootFn), cvode_mem, nrtfn, g) end function CVodeRootInit(cvode_mem, nrtfn, g) @@ -299,13 +155,7 @@ function CVodeRootInit(cvode_mem, nrtfn, g) end function CVodeSetRootDirection(cvode_mem, rootdir) - ccall( - (:CVodeSetRootDirection, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - rootdir, - ) + ccall((:CVodeSetRootDirection, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootdir) end function CVodeSetNoInactiveRootWarn(cvode_mem) @@ -313,16 +163,7 @@ function CVodeSetNoInactiveRootWarn(cvode_mem) end function CVode(cvode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall( - (:CVode, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), - cvode_mem, - tout, - yout, - tret, - itask, - ) + ccall((:CVode, libsundials_cvode), Cint, (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), cvode_mem, tout, yout, tret, itask) end function CVode(cvode_mem, tout, yout::N_Vector, tret, itask) @@ -331,15 +172,7 @@ function CVode(cvode_mem, tout, yout::N_Vector, tret, itask) end function CVodeGetDky(cvode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:CVodeGetDky, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype, Cint, N_Vector), - cvode_mem, - t, - k, - dky, - ) + ccall((:CVodeGetDky, libsundials_cvode), Cint, (CVODEMemPtr, realtype, Cint, N_Vector), cvode_mem, t, k, dky) end function CVodeGetDky(cvode_mem, t, k, dky) @@ -348,164 +181,67 @@ function CVodeGetDky(cvode_mem, t, k, dky) end function CVodeGetWorkSpace(cvode_mem, lenrw, leniw) - ccall( - (:CVodeGetWorkSpace, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrw, - leniw, - ) + ccall((:CVodeGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrw, leniw) end function CVodeGetNumSteps(cvode_mem, nsteps) - ccall( - (:CVodeGetNumSteps, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nsteps, - ) + ccall((:CVodeGetNumSteps, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nsteps) end function CVodeGetNumRhsEvals(cvode_mem, nfevals) - ccall( - (:CVodeGetNumRhsEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevals, - ) + ccall((:CVodeGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevals) end function CVodeGetNumLinSolvSetups(cvode_mem, nlinsetups) - ccall( - (:CVodeGetNumLinSolvSetups, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nlinsetups, - ) + ccall((:CVodeGetNumLinSolvSetups, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlinsetups) end function CVodeGetNumErrTestFails(cvode_mem, netfails) - ccall( - (:CVodeGetNumErrTestFails, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - netfails, - ) + ccall((:CVodeGetNumErrTestFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, netfails) end function CVodeGetLastOrder(cvode_mem, qlast) - ccall( - (:CVodeGetLastOrder, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - qlast, - ) + ccall((:CVodeGetLastOrder, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qlast) end function CVodeGetCurrentOrder(cvode_mem, qcur) - ccall( - (:CVodeGetCurrentOrder, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - qcur, - ) + ccall((:CVodeGetCurrentOrder, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qcur) end function CVodeGetCurrentGamma(cvode_mem, gamma) - ccall( - (:CVodeGetCurrentGamma, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - gamma, - ) + ccall((:CVodeGetCurrentGamma, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, gamma) end function CVodeGetNumStabLimOrderReds(cvode_mem, nslred) - ccall( - (:CVodeGetNumStabLimOrderReds, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nslred, - ) + ccall((:CVodeGetNumStabLimOrderReds, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nslred) end function CVodeGetActualInitStep(cvode_mem, hinused) - ccall( - (:CVodeGetActualInitStep, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - hinused, - ) + ccall((:CVodeGetActualInitStep, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hinused) end function CVodeGetLastStep(cvode_mem, hlast) - ccall( - (:CVodeGetLastStep, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - hlast, - ) + ccall((:CVodeGetLastStep, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hlast) end function CVodeGetCurrentStep(cvode_mem, hcur) - ccall( - (:CVodeGetCurrentStep, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - hcur, - ) + ccall((:CVodeGetCurrentStep, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hcur) end function CVodeGetCurrentState(cvode_mem, y) - ccall( - (:CVodeGetCurrentState, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{N_Vector}), - cvode_mem, - y, - ) + ccall((:CVodeGetCurrentState, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, y) end function CVodeGetCurrentTime(cvode_mem, tcur) - ccall( - (:CVodeGetCurrentTime, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - tcur, - ) + ccall((:CVodeGetCurrentTime, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tcur) end function CVodeGetTolScaleFactor(cvode_mem, tolsfac) - ccall( - (:CVodeGetTolScaleFactor, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - tolsfac, - ) + ccall((:CVodeGetTolScaleFactor, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tolsfac) end function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) - ccall( - (:CVodeGetErrWeights, libsundials_cvode), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - eweight, - ) + ccall((:CVodeGetErrWeights, libsundials_cvode), Cint, (CVODEMemPtr, N_Vector), cvode_mem, eweight) end function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) @@ -514,13 +250,7 @@ function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) end function CVodeGetEstLocalErrors(cvode_mem, ele::N_Vector) - ccall( - (:CVodeGetEstLocalErrors, libsundials_cvode), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - ele, - ) + ccall((:CVodeGetEstLocalErrors, libsundials_cvode), Cint, (CVODEMemPtr, N_Vector), cvode_mem, ele) end function CVodeGetEstLocalErrors(cvode_mem, ele) @@ -529,97 +259,27 @@ function CVodeGetEstLocalErrors(cvode_mem, ele) end function CVodeGetNumGEvals(cvode_mem, ngevals) - ccall( - (:CVodeGetNumGEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - ngevals, - ) + ccall((:CVodeGetNumGEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevals) end function CVodeGetRootInfo(cvode_mem, rootsfound) - ccall( - (:CVodeGetRootInfo, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - rootsfound, - ) -end - -function CVodeGetIntegratorStats( - cvode_mem, - nsteps, - nfevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, -) - ccall( - (:CVodeGetIntegratorStats, libsundials_cvode), - Cint, - ( - CVODEMemPtr, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - ), - cvode_mem, - nsteps, - nfevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, - ) + ccall((:CVodeGetRootInfo, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootsfound) +end + +function CVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall((:CVodeGetIntegratorStats, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) end function CVodeGetNumNonlinSolvIters(cvode_mem, nniters) - ccall( - (:CVodeGetNumNonlinSolvIters, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nniters, - ) + ccall((:CVodeGetNumNonlinSolvIters, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nniters) end function CVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) - ccall( - (:CVodeGetNumNonlinSolvConvFails, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nncfails, - ) + ccall((:CVodeGetNumNonlinSolvConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nncfails) end function CVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) - ccall( - (:CVodeGetNonlinSolvStats, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - nniters, - nncfails, - ) + ccall((:CVodeGetNonlinSolvStats, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nniters, nncfails) end function CVodeGetReturnFlagName(flag::Clong) @@ -636,151 +296,55 @@ end # Julia wrapper for header: cvode_bandpre.h # Automatically generated using Clang.jl + function CVBandPrecInit(cvode_mem, N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall( - (:CVBandPrecInit, libsundials_cvode), - Cint, - (CVODEMemPtr, sunindextype, sunindextype, sunindextype), - cvode_mem, - N, - mu, - ml, - ) + ccall((:CVBandPrecInit, libsundials_cvode), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype), cvode_mem, N, mu, ml) end function CVBandPrecGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVBandPrecGetWorkSpace, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVBandPrecGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVBandPrecGetNumRhsEvals(cvode_mem, nfevalsBP) - ccall( - (:CVBandPrecGetNumRhsEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsBP, - ) + ccall((:CVBandPrecGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsBP) end # Julia wrapper for header: cvode_bbdpre.h # Automatically generated using Clang.jl -function CVBBDPrecInit( - cvode_mem, - Nlocal::sunindextype, - mudq::sunindextype, - mldq::sunindextype, - mukeep::sunindextype, - mlkeep::sunindextype, - dqrely::realtype, - gloc::CVLocalFn, - cfn::CVCommFn, -) - ccall( - (:CVBBDPrecInit, libsundials_cvode), - Cint, - ( - CVODEMemPtr, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - CVLocalFn, - CVCommFn, - ), - cvode_mem, - Nlocal, - mudq, - mldq, - mukeep, - mlkeep, - dqrely, - gloc, - cfn, - ) -end - -function CVBBDPrecReInit( - cvode_mem, - mudq::sunindextype, - mldq::sunindextype, - dqrely::realtype, -) - ccall( - (:CVBBDPrecReInit, libsundials_cvode), - Cint, - (CVODEMemPtr, sunindextype, sunindextype, realtype), - cvode_mem, - mudq, - mldq, - dqrely, - ) + +function CVBBDPrecInit(cvode_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dqrely::realtype, gloc::CVLocalFn, cfn::CVCommFn) + ccall((:CVBBDPrecInit, libsundials_cvode), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, CVLocalFn, CVCommFn), cvode_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) +end + +function CVBBDPrecReInit(cvode_mem, mudq::sunindextype, mldq::sunindextype, dqrely::realtype) + ccall((:CVBBDPrecReInit, libsundials_cvode), Cint, (CVODEMemPtr, sunindextype, sunindextype, realtype), cvode_mem, mudq, mldq, dqrely) end function CVBBDPrecGetWorkSpace(cvode_mem, lenrwBBDP, leniwBBDP) - ccall( - (:CVBBDPrecGetWorkSpace, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwBBDP, - leniwBBDP, - ) + ccall((:CVBBDPrecGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwBBDP, leniwBBDP) end function CVBBDPrecGetNumGfnEvals(cvode_mem, ngevalsBBDP) - ccall( - (:CVBBDPrecGetNumGfnEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - ngevalsBBDP, - ) + ccall((:CVBBDPrecGetNumGfnEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevalsBBDP) end # Julia wrapper for header: cvode_diag.h # Automatically generated using Clang.jl + function CVDiag(cvode_mem) ccall((:CVDiag, libsundials_cvode), Cint, (CVODEMemPtr,), cvode_mem) end function CVDiagGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVDiagGetWorkSpace, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVDiagGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVDiagGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVDiagGetNumRhsEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVDiagGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVDiagGetLastFlag(cvode_mem, flag) - ccall( - (:CVDiagGetLastFlag, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVDiagGetLastFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVDiagGetReturnFlagName(flag::Clong) @@ -793,66 +357,29 @@ end # Julia wrapper for header: cvode_direct.h # Automatically generated using Clang.jl + function CVDlsSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:CVDlsSetLinearSolver, libsundials_cvode), - Cint, - (CVODEMemPtr, SUNLinearSolver, SUNMatrix), - cvode_mem, - LS, - A, - ) + ccall((:CVDlsSetLinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) end function CVDlsSetJacFn(cvode_mem, jac::CVDlsJacFn) - ccall( - (:CVDlsSetJacFn, libsundials_cvode), - Cint, - (CVODEMemPtr, CVDlsJacFn), - cvode_mem, - jac, - ) + ccall((:CVDlsSetJacFn, libsundials_cvode), Cint, (CVODEMemPtr, CVDlsJacFn), cvode_mem, jac) end function CVDlsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVDlsGetWorkSpace, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVDlsGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVDlsGetNumJacEvals(cvode_mem, njevals) - ccall( - (:CVDlsGetNumJacEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njevals, - ) + ccall((:CVDlsGetNumJacEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) end function CVDlsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVDlsGetNumRhsEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVDlsGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVDlsGetLastFlag(cvode_mem, flag) - ccall( - (:CVDlsGetLastFlag, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVDlsGetLastFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVDlsGetReturnFlagName(flag::Clong) @@ -865,35 +392,17 @@ end # Julia wrapper for header: cvode_ls.h # Automatically generated using Clang.jl + function CVodeSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:CVodeSetLinearSolver, libsundials_cvode), - Cint, - (CVODEMemPtr, SUNLinearSolver, SUNMatrix), - cvode_mem, - LS, - A, - ) + ccall((:CVodeSetLinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) end function CVodeSetJacFn(cvode_mem, jac::CVLsJacFn) - ccall( - (:CVodeSetJacFn, libsundials_cvode), - Cint, - (CVODEMemPtr, CVLsJacFn), - cvode_mem, - jac, - ) + ccall((:CVodeSetJacFn, libsundials_cvode), Cint, (CVODEMemPtr, CVLsJacFn), cvode_mem, jac) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj::Clong) - ccall( - (:CVodeSetMaxStepsBetweenJac, libsundials_cvode), - Cint, - (CVODEMemPtr, Clong), - cvode_mem, - msbj, - ) + ccall((:CVodeSetMaxStepsBetweenJac, libsundials_cvode), Cint, (CVODEMemPtr, Clong), cvode_mem, msbj) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) @@ -901,150 +410,59 @@ function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) end function CVodeSetEpsLin(cvode_mem, eplifac::realtype) - ccall( - (:CVodeSetEpsLin, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - eplifac, - ) + ccall((:CVodeSetEpsLin, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) end function CVodeSetPreconditioner(cvode_mem, pset::CVLsPrecSetupFn, psolve::CVLsPrecSolveFn) - ccall( - (:CVodeSetPreconditioner, libsundials_cvode), - Cint, - (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), - cvode_mem, - pset, - psolve, - ) -end - -function CVodeSetJacTimes( - cvode_mem, - jtsetup::CVLsJacTimesSetupFn, - jtimes::CVLsJacTimesVecFn, -) - ccall( - (:CVodeSetJacTimes, libsundials_cvode), - Cint, - (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), - cvode_mem, - jtsetup, - jtimes, - ) + ccall((:CVodeSetPreconditioner, libsundials_cvode), Cint, (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), cvode_mem, pset, psolve) +end + +function CVodeSetJacTimes(cvode_mem, jtsetup::CVLsJacTimesSetupFn, jtimes::CVLsJacTimesVecFn) + ccall((:CVodeSetJacTimes, libsundials_cvode), Cint, (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), cvode_mem, jtsetup, jtimes) end function CVodeSetLinSysFn(cvode_mem, linsys::CVLsLinSysFn) - ccall( - (:CVodeSetLinSysFn, libsundials_cvode), - Cint, - (CVODEMemPtr, CVLsLinSysFn), - cvode_mem, - linsys, - ) + ccall((:CVodeSetLinSysFn, libsundials_cvode), Cint, (CVODEMemPtr, CVLsLinSysFn), cvode_mem, linsys) end function CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVodeGetLinWorkSpace, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVodeGetLinWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVodeGetNumJacEvals(cvode_mem, njevals) - ccall( - (:CVodeGetNumJacEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njevals, - ) + ccall((:CVodeGetNumJacEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) end function CVodeGetNumPrecEvals(cvode_mem, npevals) - ccall( - (:CVodeGetNumPrecEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npevals, - ) + ccall((:CVodeGetNumPrecEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) end function CVodeGetNumPrecSolves(cvode_mem, npsolves) - ccall( - (:CVodeGetNumPrecSolves, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npsolves, - ) + ccall((:CVodeGetNumPrecSolves, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) end function CVodeGetNumLinIters(cvode_mem, nliters) - ccall( - (:CVodeGetNumLinIters, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nliters, - ) + ccall((:CVodeGetNumLinIters, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) end function CVodeGetNumLinConvFails(cvode_mem, nlcfails) - ccall( - (:CVodeGetNumLinConvFails, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nlcfails, - ) + ccall((:CVodeGetNumLinConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) end function CVodeGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall( - (:CVodeGetNumJTSetupEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njtsetups, - ) + ccall((:CVodeGetNumJTSetupEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) end function CVodeGetNumJtimesEvals(cvode_mem, njvevals) - ccall( - (:CVodeGetNumJtimesEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njvevals, - ) + ccall((:CVodeGetNumJtimesEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) end function CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVodeGetNumLinRhsEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVodeGetNumLinRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVodeGetLastLinFlag(cvode_mem, flag) - ccall( - (:CVodeGetLastLinFlag, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVodeGetLastLinFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVodeGetLinReturnFlagName(flag::Clong) @@ -1057,145 +475,57 @@ end # Julia wrapper for header: cvode_spils.h # Automatically generated using Clang.jl + function CVSpilsSetLinearSolver(cvode_mem, LS::SUNLinearSolver) - ccall( - (:CVSpilsSetLinearSolver, libsundials_cvode), - Cint, - (CVODEMemPtr, SUNLinearSolver), - cvode_mem, - LS, - ) + ccall((:CVSpilsSetLinearSolver, libsundials_cvode), Cint, (CVODEMemPtr, SUNLinearSolver), cvode_mem, LS) end function CVSpilsSetEpsLin(cvode_mem, eplifac::realtype) - ccall( - (:CVSpilsSetEpsLin, libsundials_cvode), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - eplifac, - ) -end - -function CVSpilsSetPreconditioner( - cvode_mem, - pset::CVSpilsPrecSetupFn, - psolve::CVSpilsPrecSolveFn, -) - ccall( - (:CVSpilsSetPreconditioner, libsundials_cvode), - Cint, - (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), - cvode_mem, - pset, - psolve, - ) -end - -function CVSpilsSetJacTimes( - cvode_mem, - jtsetup::CVSpilsJacTimesSetupFn, - jtimes::CVSpilsJacTimesVecFn, -) - ccall( - (:CVSpilsSetJacTimes, libsundials_cvode), - Cint, - (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), - cvode_mem, - jtsetup, - jtimes, - ) + ccall((:CVSpilsSetEpsLin, libsundials_cvode), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) +end + +function CVSpilsSetPreconditioner(cvode_mem, pset::CVSpilsPrecSetupFn, psolve::CVSpilsPrecSolveFn) + ccall((:CVSpilsSetPreconditioner, libsundials_cvode), Cint, (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), cvode_mem, pset, psolve) +end + +function CVSpilsSetJacTimes(cvode_mem, jtsetup::CVSpilsJacTimesSetupFn, jtimes::CVSpilsJacTimesVecFn) + ccall((:CVSpilsSetJacTimes, libsundials_cvode), Cint, (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), cvode_mem, jtsetup, jtimes) end function CVSpilsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVSpilsGetWorkSpace, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVSpilsGetWorkSpace, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVSpilsGetNumPrecEvals(cvode_mem, npevals) - ccall( - (:CVSpilsGetNumPrecEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npevals, - ) + ccall((:CVSpilsGetNumPrecEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) end function CVSpilsGetNumPrecSolves(cvode_mem, npsolves) - ccall( - (:CVSpilsGetNumPrecSolves, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npsolves, - ) + ccall((:CVSpilsGetNumPrecSolves, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) end function CVSpilsGetNumLinIters(cvode_mem, nliters) - ccall( - (:CVSpilsGetNumLinIters, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nliters, - ) + ccall((:CVSpilsGetNumLinIters, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) end function CVSpilsGetNumConvFails(cvode_mem, nlcfails) - ccall( - (:CVSpilsGetNumConvFails, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nlcfails, - ) + ccall((:CVSpilsGetNumConvFails, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) end function CVSpilsGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall( - (:CVSpilsGetNumJTSetupEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njtsetups, - ) + ccall((:CVSpilsGetNumJTSetupEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) end function CVSpilsGetNumJtimesEvals(cvode_mem, njvevals) - ccall( - (:CVSpilsGetNumJtimesEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njvevals, - ) + ccall((:CVSpilsGetNumJtimesEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) end function CVSpilsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVSpilsGetNumRhsEvals, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVSpilsGetNumRhsEvals, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVSpilsGetLastFlag(cvode_mem, flag) - ccall( - (:CVSpilsGetLastFlag, libsundials_cvode), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVSpilsGetLastFlag, libsundials_cvode), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVSpilsGetReturnFlagName(flag::Clong) diff --git a/src/API/cvodes.jl b/src/API/cvodes.jl index a48a7423..2ba85ed7 100644 --- a/src/API/cvodes.jl +++ b/src/API/cvodes.jl @@ -1,6 +1,7 @@ # Julia wrapper for header: cvodes.h # Automatically generated using Clang.jl + function CVodeCreate(lmm::Cint) ccall((:CVodeCreate, libsundials_cvodes), CVODEMemPtr, (Cint,), lmm) end @@ -10,15 +11,7 @@ function CVodeCreate(lmm) end function CVodeInit(cvode_mem, f::CVRhsFn, t0::realtype, y0::N_Vector) - ccall( - (:CVodeInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVRhsFn, realtype, N_Vector), - cvode_mem, - f, - t0, - y0, - ) + ccall((:CVodeInit, libsundials_cvodes), Cint, (CVODEMemPtr, CVRhsFn, realtype, N_Vector), cvode_mem, f, t0, y0) end function CVodeInit(cvode_mem, f, t0::realtype, y0) @@ -27,14 +20,7 @@ function CVodeInit(cvode_mem, f, t0::realtype, y0) end function CVodeReInit(cvode_mem, t0::realtype, y0::N_Vector) - ccall( - (:CVodeReInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, N_Vector), - cvode_mem, - t0, - y0, - ) + ccall((:CVodeReInit, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, t0, y0) end function CVodeReInit(cvode_mem, t0::realtype, y0) @@ -43,25 +29,11 @@ function CVodeReInit(cvode_mem, t0::realtype, y0) end function CVodeSStolerances(cvode_mem, reltol::realtype, abstol::realtype) - ccall( - (:CVodeSStolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, realtype), - cvode_mem, - reltol, - abstol, - ) + ccall((:CVodeSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, realtype), cvode_mem, reltol, abstol) end function CVodeSVtolerances(cvode_mem, reltol::realtype, abstol::N_Vector) - ccall( - (:CVodeSVtolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, N_Vector), - cvode_mem, - reltol, - abstol, - ) + ccall((:CVodeSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, reltol, abstol) end function CVodeSVtolerances(cvode_mem, reltol, abstol) @@ -70,54 +42,23 @@ function CVodeSVtolerances(cvode_mem, reltol, abstol) end function CVodeWFtolerances(cvode_mem, efun::CVEwtFn) - ccall( - (:CVodeWFtolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVEwtFn), - cvode_mem, - efun, - ) + ccall((:CVodeWFtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, CVEwtFn), cvode_mem, efun) end function CVodeSetErrHandlerFn(cvode_mem, ehfun::CVErrHandlerFn, eh_data) - ccall( - (:CVodeSetErrHandlerFn, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), - cvode_mem, - ehfun, - eh_data, - ) + ccall((:CVodeSetErrHandlerFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVErrHandlerFn, Ptr{Cvoid}), cvode_mem, ehfun, eh_data) end function CVodeSetErrFile(cvode_mem, errfp) - ccall( - (:CVodeSetErrFile, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{FILE}), - cvode_mem, - errfp, - ) + ccall((:CVodeSetErrFile, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{FILE}), cvode_mem, errfp) end function CVodeSetUserData(cvode_mem, user_data) - ccall( - (:CVodeSetUserData, libsundials_cvodes), - Cint, - (CVODEMemPtr, Any), - cvode_mem, - user_data, - ) + ccall((:CVodeSetUserData, libsundials_cvodes), Cint, (CVODEMemPtr, Any), cvode_mem, user_data) end function CVodeSetMaxOrd(cvode_mem, maxord::Cint) - ccall( - (:CVodeSetMaxOrd, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxord, - ) + ccall((:CVodeSetMaxOrd, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxord) end function CVodeSetMaxOrd(cvode_mem, maxord) @@ -125,13 +66,7 @@ function CVodeSetMaxOrd(cvode_mem, maxord) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps::Clong) - ccall( - (:CVodeSetMaxNumSteps, libsundials_cvodes), - Cint, - (CVODEMemPtr, Clong), - cvode_mem, - mxsteps, - ) + ccall((:CVodeSetMaxNumSteps, libsundials_cvodes), Cint, (CVODEMemPtr, Clong), cvode_mem, mxsteps) end function CVodeSetMaxNumSteps(cvode_mem, mxsteps) @@ -139,13 +74,7 @@ function CVodeSetMaxNumSteps(cvode_mem, mxsteps) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil::Cint) - ccall( - (:CVodeSetMaxHnilWarns, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - mxhnil, - ) + ccall((:CVodeSetMaxHnilWarns, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, mxhnil) end function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) @@ -153,13 +82,7 @@ function CVodeSetMaxHnilWarns(cvode_mem, mxhnil) end function CVodeSetStabLimDet(cvode_mem, stldet::Cint) - ccall( - (:CVodeSetStabLimDet, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - stldet, - ) + ccall((:CVodeSetStabLimDet, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, stldet) end function CVodeSetStabLimDet(cvode_mem, stldet) @@ -167,53 +90,23 @@ function CVodeSetStabLimDet(cvode_mem, stldet) end function CVodeSetInitStep(cvode_mem, hin::realtype) - ccall( - (:CVodeSetInitStep, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - hin, - ) + ccall((:CVodeSetInitStep, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, hin) end function CVodeSetMinStep(cvode_mem, hmin::realtype) - ccall( - (:CVodeSetMinStep, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - hmin, - ) + ccall((:CVodeSetMinStep, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, hmin) end function CVodeSetMaxStep(cvode_mem, hmax::realtype) - ccall( - (:CVodeSetMaxStep, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - hmax, - ) + ccall((:CVodeSetMaxStep, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, hmax) end function CVodeSetStopTime(cvode_mem, tstop::realtype) - ccall( - (:CVodeSetStopTime, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - tstop, - ) + ccall((:CVodeSetStopTime, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, tstop) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef::Cint) - ccall( - (:CVodeSetMaxErrTestFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxnef, - ) + ccall((:CVodeSetMaxErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxnef) end function CVodeSetMaxErrTestFails(cvode_mem, maxnef) @@ -221,13 +114,7 @@ function CVodeSetMaxErrTestFails(cvode_mem, maxnef) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor::Cint) - ccall( - (:CVodeSetMaxNonlinIters, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxcor, - ) + ccall((:CVodeSetMaxNonlinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxcor) end function CVodeSetMaxNonlinIters(cvode_mem, maxcor) @@ -235,13 +122,7 @@ function CVodeSetMaxNonlinIters(cvode_mem, maxcor) end function CVodeSetMaxConvFails(cvode_mem, maxncf::Cint) - ccall( - (:CVodeSetMaxConvFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxncf, - ) + ccall((:CVodeSetMaxConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxncf) end function CVodeSetMaxConvFails(cvode_mem, maxncf) @@ -249,23 +130,11 @@ function CVodeSetMaxConvFails(cvode_mem, maxncf) end function CVodeSetNonlinConvCoef(cvode_mem, nlscoef::realtype) - ccall( - (:CVodeSetNonlinConvCoef, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - nlscoef, - ) + ccall((:CVodeSetNonlinConvCoef, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, nlscoef) end function CVodeSetConstraints(cvode_mem, constraints::N_Vector) - ccall( - (:CVodeSetConstraints, libsundials_cvodes), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - constraints, - ) + ccall((:CVodeSetConstraints, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, constraints) end function CVodeSetConstraints(cvode_mem, constraints) @@ -274,24 +143,11 @@ function CVodeSetConstraints(cvode_mem, constraints) end function CVodeSetNonlinearSolver(cvode_mem, NLS::SUNNonlinearSolver) - ccall( - (:CVodeSetNonlinearSolver, libsundials_cvodes), - Cint, - (CVODEMemPtr, SUNNonlinearSolver), - cvode_mem, - NLS, - ) + ccall((:CVodeSetNonlinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) end function CVodeRootInit(cvode_mem, nrtfn::Cint, g::CVRootFn) - ccall( - (:CVodeRootInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVRootFn), - cvode_mem, - nrtfn, - g, - ) + ccall((:CVodeRootInit, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVRootFn), cvode_mem, nrtfn, g) end function CVodeRootInit(cvode_mem, nrtfn, g) @@ -299,35 +155,15 @@ function CVodeRootInit(cvode_mem, nrtfn, g) end function CVodeSetRootDirection(cvode_mem, rootdir) - ccall( - (:CVodeSetRootDirection, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - rootdir, - ) + ccall((:CVodeSetRootDirection, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootdir) end function CVodeSetNoInactiveRootWarn(cvode_mem) - ccall( - (:CVodeSetNoInactiveRootWarn, libsundials_cvodes), - Cint, - (CVODEMemPtr,), - cvode_mem, - ) + ccall((:CVodeSetNoInactiveRootWarn, libsundials_cvodes), Cint, (CVODEMemPtr,), cvode_mem) end function CVode(cvode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint) - ccall( - (:CVode, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), - cvode_mem, - tout, - yout, - tret, - itask, - ) + ccall((:CVode, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint), cvode_mem, tout, yout, tret, itask) end function CVode(cvode_mem, tout, yout, tret, itask) @@ -336,15 +172,7 @@ function CVode(cvode_mem, tout, yout, tret, itask) end function CVodeGetDky(cvode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:CVodeGetDky, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Cint, N_Vector), - cvode_mem, - t, - k, - dky, - ) + ccall((:CVodeGetDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, N_Vector), cvode_mem, t, k, dky) end function CVodeGetDky(cvode_mem, t, k, dky) @@ -353,184 +181,75 @@ function CVodeGetDky(cvode_mem, t, k, dky) end function CVodeGetWorkSpace(cvode_mem, lenrw, leniw) - ccall( - (:CVodeGetWorkSpace, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrw, - leniw, - ) + ccall((:CVodeGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrw, leniw) end function CVodeGetNumSteps(cvode_mem, nsteps) - ccall( - (:CVodeGetNumSteps, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nsteps, - ) + ccall((:CVodeGetNumSteps, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nsteps) end function CVodeGetNumRhsEvals(cvode_mem, nfevals) - ccall( - (:CVodeGetNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevals, - ) + ccall((:CVodeGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevals) end function CVodeGetNumLinSolvSetups(cvode_mem, nlinsetups) - ccall( - (:CVodeGetNumLinSolvSetups, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nlinsetups, - ) + ccall((:CVodeGetNumLinSolvSetups, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlinsetups) end function CVodeGetNumErrTestFails(cvode_mem, netfails) - ccall( - (:CVodeGetNumErrTestFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - netfails, - ) + ccall((:CVodeGetNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, netfails) end function CVodeGetLastOrder(cvode_mem, qlast) - ccall( - (:CVodeGetLastOrder, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - qlast, - ) + ccall((:CVodeGetLastOrder, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qlast) end function CVodeGetCurrentOrder(cvode_mem, qcur) - ccall( - (:CVodeGetCurrentOrder, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - qcur, - ) + ccall((:CVodeGetCurrentOrder, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, qcur) end function CVodeGetCurrentGamma(cvode_mem, gamma) - ccall( - (:CVodeGetCurrentGamma, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - gamma, - ) + ccall((:CVodeGetCurrentGamma, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, gamma) end function CVodeGetNumStabLimOrderReds(cvode_mem, nslred) - ccall( - (:CVodeGetNumStabLimOrderReds, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nslred, - ) + ccall((:CVodeGetNumStabLimOrderReds, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nslred) end function CVodeGetActualInitStep(cvode_mem, hinused) - ccall( - (:CVodeGetActualInitStep, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - hinused, - ) + ccall((:CVodeGetActualInitStep, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hinused) end function CVodeGetLastStep(cvode_mem, hlast) - ccall( - (:CVodeGetLastStep, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - hlast, - ) + ccall((:CVodeGetLastStep, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hlast) end function CVodeGetCurrentStep(cvode_mem, hcur) - ccall( - (:CVodeGetCurrentStep, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - hcur, - ) + ccall((:CVodeGetCurrentStep, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, hcur) end function CVodeGetCurrentState(cvode_mem, y) - ccall( - (:CVodeGetCurrentState, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{N_Vector}), - cvode_mem, - y, - ) + ccall((:CVodeGetCurrentState, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, y) end function CVodeGetCurrentStateSens(cvode_mem, yS) - ccall( - (:CVodeGetCurrentStateSens, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Ptr{N_Vector}}), - cvode_mem, - yS, - ) + ccall((:CVodeGetCurrentStateSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Ptr{N_Vector}}), cvode_mem, yS) end function CVodeGetCurrentSensSolveIndex(cvode_mem, index) - ccall( - (:CVodeGetCurrentSensSolveIndex, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - index, - ) + ccall((:CVodeGetCurrentSensSolveIndex, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, index) end function CVodeGetCurrentTime(cvode_mem, tcur) - ccall( - (:CVodeGetCurrentTime, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - tcur, - ) + ccall((:CVodeGetCurrentTime, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tcur) end function CVodeGetTolScaleFactor(cvode_mem, tolsfac) - ccall( - (:CVodeGetTolScaleFactor, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}), - cvode_mem, - tolsfac, - ) + ccall((:CVodeGetTolScaleFactor, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}), cvode_mem, tolsfac) end function CVodeGetErrWeights(cvode_mem, eweight::N_Vector) - ccall( - (:CVodeGetErrWeights, libsundials_cvodes), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - eweight, - ) + ccall((:CVodeGetErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, eweight) end function CVodeGetErrWeights(cvode_mem, eweight) @@ -539,13 +258,7 @@ function CVodeGetErrWeights(cvode_mem, eweight) end function CVodeGetEstLocalErrors(cvode_mem, ele::N_Vector) - ccall( - (:CVodeGetEstLocalErrors, libsundials_cvodes), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - ele, - ) + ccall((:CVodeGetEstLocalErrors, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, ele) end function CVodeGetEstLocalErrors(cvode_mem, ele) @@ -554,97 +267,27 @@ function CVodeGetEstLocalErrors(cvode_mem, ele) end function CVodeGetNumGEvals(cvode_mem, ngevals) - ccall( - (:CVodeGetNumGEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - ngevals, - ) + ccall((:CVodeGetNumGEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevals) end function CVodeGetRootInfo(cvode_mem, rootsfound) - ccall( - (:CVodeGetRootInfo, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Cint}), - cvode_mem, - rootsfound, - ) -end - -function CVodeGetIntegratorStats( - cvode_mem, - nsteps, - nfevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, -) - ccall( - (:CVodeGetIntegratorStats, libsundials_cvodes), - Cint, - ( - CVODEMemPtr, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - ), - cvode_mem, - nsteps, - nfevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, - ) + ccall((:CVodeGetRootInfo, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Cint}), cvode_mem, rootsfound) +end + +function CVodeGetIntegratorStats(cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall((:CVodeGetIntegratorStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), cvode_mem, nsteps, nfevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) end function CVodeGetNumNonlinSolvIters(cvode_mem, nniters) - ccall( - (:CVodeGetNumNonlinSolvIters, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nniters, - ) + ccall((:CVodeGetNumNonlinSolvIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nniters) end function CVodeGetNumNonlinSolvConvFails(cvode_mem, nncfails) - ccall( - (:CVodeGetNumNonlinSolvConvFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nncfails, - ) + ccall((:CVodeGetNumNonlinSolvConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nncfails) end function CVodeGetNonlinSolvStats(cvode_mem, nniters, nncfails) - ccall( - (:CVodeGetNonlinSolvStats, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - nniters, - nncfails, - ) + ccall((:CVodeGetNonlinSolvStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nniters, nncfails) end function CVodeGetReturnFlagName(flag::Clong) @@ -660,14 +303,7 @@ function CVodeFree(cvode_mem) end function CVodeQuadInit(cvode_mem, fQ::CVQuadRhsFn, yQ0::N_Vector) - ccall( - (:CVodeQuadInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVQuadRhsFn, N_Vector), - cvode_mem, - fQ, - yQ0, - ) + ccall((:CVodeQuadInit, libsundials_cvodes), Cint, (CVODEMemPtr, CVQuadRhsFn, N_Vector), cvode_mem, fQ, yQ0) end function CVodeQuadInit(cvode_mem, fQ, yQ0) @@ -676,13 +312,7 @@ function CVodeQuadInit(cvode_mem, fQ, yQ0) end function CVodeQuadReInit(cvode_mem, yQ0::N_Vector) - ccall( - (:CVodeQuadReInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - yQ0, - ) + ccall((:CVodeQuadReInit, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, yQ0) end function CVodeQuadReInit(cvode_mem, yQ0) @@ -691,25 +321,11 @@ function CVodeQuadReInit(cvode_mem, yQ0) end function CVodeQuadSStolerances(cvode_mem, reltolQ::realtype, abstolQ::realtype) - ccall( - (:CVodeQuadSStolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, realtype), - cvode_mem, - reltolQ, - abstolQ, - ) + ccall((:CVodeQuadSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, realtype), cvode_mem, reltolQ, abstolQ) end function CVodeQuadSVtolerances(cvode_mem, reltolQ::realtype, abstolQ::N_Vector) - ccall( - (:CVodeQuadSVtolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, N_Vector), - cvode_mem, - reltolQ, - abstolQ, - ) + ccall((:CVodeQuadSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, reltolQ, abstolQ) end function CVodeQuadSVtolerances(cvode_mem, reltolQ, abstolQ) @@ -718,13 +334,7 @@ function CVodeQuadSVtolerances(cvode_mem, reltolQ, abstolQ) end function CVodeSetQuadErrCon(cvode_mem, errconQ::Cint) - ccall( - (:CVodeSetQuadErrCon, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - errconQ, - ) + ccall((:CVodeSetQuadErrCon, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, errconQ) end function CVodeSetQuadErrCon(cvode_mem, errconQ) @@ -732,14 +342,7 @@ function CVodeSetQuadErrCon(cvode_mem, errconQ) end function CVodeGetQuad(cvode_mem, tret, yQout::N_Vector) - ccall( - (:CVodeGetQuad, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}, N_Vector), - cvode_mem, - tret, - yQout, - ) + ccall((:CVodeGetQuad, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, N_Vector), cvode_mem, tret, yQout) end function CVodeGetQuad(cvode_mem, tret, yQout) @@ -748,15 +351,7 @@ function CVodeGetQuad(cvode_mem, tret, yQout) end function CVodeGetQuadDky(cvode_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:CVodeGetQuadDky, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Cint, N_Vector), - cvode_mem, - t, - k, - dky, - ) + ccall((:CVodeGetQuadDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, N_Vector), cvode_mem, t, k, dky) end function CVodeGetQuadDky(cvode_mem, t, k, dky) @@ -765,33 +360,15 @@ function CVodeGetQuadDky(cvode_mem, t, k, dky) end function CVodeGetQuadNumRhsEvals(cvode_mem, nfQevals) - ccall( - (:CVodeGetQuadNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfQevals, - ) + ccall((:CVodeGetQuadNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfQevals) end function CVodeGetQuadNumErrTestFails(cvode_mem, nQetfails) - ccall( - (:CVodeGetQuadNumErrTestFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nQetfails, - ) + ccall((:CVodeGetQuadNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nQetfails) end function CVodeGetQuadErrWeights(cvode_mem, eQweight::N_Vector) - ccall( - (:CVodeGetQuadErrWeights, libsundials_cvodes), - Cint, - (CVODEMemPtr, N_Vector), - cvode_mem, - eQweight, - ) + ccall((:CVodeGetQuadErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, N_Vector), cvode_mem, eQweight) end function CVodeGetQuadErrWeights(cvode_mem, eQweight) @@ -800,14 +377,7 @@ function CVodeGetQuadErrWeights(cvode_mem, eQweight) end function CVodeGetQuadStats(cvode_mem, nfQevals, nQetfails) - ccall( - (:CVodeGetQuadStats, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - nfQevals, - nQetfails, - ) + ccall((:CVodeGetQuadStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nfQevals, nQetfails) end function CVodeQuadFree(cvode_mem) @@ -815,16 +385,7 @@ function CVodeQuadFree(cvode_mem) end function CVodeSensInit(cvode_mem, Ns::Cint, ism::Cint, fS::CVSensRhsFn, yS0) - ccall( - (:CVodeSensInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Cint, CVSensRhsFn, Ptr{N_Vector}), - cvode_mem, - Ns, - ism, - fS, - yS0, - ) + ccall((:CVodeSensInit, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint, CVSensRhsFn, Ptr{N_Vector}), cvode_mem, Ns, ism, fS, yS0) end function CVodeSensInit(cvode_mem, Ns, ism, fS, yS0) @@ -832,16 +393,7 @@ function CVodeSensInit(cvode_mem, Ns, ism, fS, yS0) end function CVodeSensInit1(cvode_mem, Ns::Cint, ism::Cint, fS1::CVSensRhs1Fn, yS0) - ccall( - (:CVodeSensInit1, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Cint, CVSensRhs1Fn, Ptr{N_Vector}), - cvode_mem, - Ns, - ism, - fS1, - yS0, - ) + ccall((:CVodeSensInit1, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint, CVSensRhs1Fn, Ptr{N_Vector}), cvode_mem, Ns, ism, fS1, yS0) end function CVodeSensInit1(cvode_mem, Ns, ism, fS1, yS0) @@ -849,14 +401,7 @@ function CVodeSensInit1(cvode_mem, Ns, ism, fS1, yS0) end function CVodeSensReInit(cvode_mem, ism::Cint, yS0) - ccall( - (:CVodeSensReInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Ptr{N_Vector}), - cvode_mem, - ism, - yS0, - ) + ccall((:CVodeSensReInit, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{N_Vector}), cvode_mem, ism, yS0) end function CVodeSensReInit(cvode_mem, ism, yS0) @@ -864,25 +409,11 @@ function CVodeSensReInit(cvode_mem, ism, yS0) end function CVodeSensSStolerances(cvode_mem, reltolS::realtype, abstolS) - ccall( - (:CVodeSensSStolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Ptr{realtype}), - cvode_mem, - reltolS, - abstolS, - ) + ccall((:CVodeSensSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{realtype}), cvode_mem, reltolS, abstolS) end function CVodeSensSVtolerances(cvode_mem, reltolS::realtype, abstolS) - ccall( - (:CVodeSensSVtolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Ptr{N_Vector}), - cvode_mem, - reltolS, - abstolS, - ) + ccall((:CVodeSensSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{N_Vector}), cvode_mem, reltolS, abstolS) end function CVodeSensEEtolerances(cvode_mem) @@ -890,14 +421,7 @@ function CVodeSensEEtolerances(cvode_mem) end function CVodeSetSensDQMethod(cvode_mem, DQtype::Cint, DQrhomax::realtype) - ccall( - (:CVodeSetSensDQMethod, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype), - cvode_mem, - DQtype, - DQrhomax, - ) + ccall((:CVodeSetSensDQMethod, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, DQtype, DQrhomax) end function CVodeSetSensDQMethod(cvode_mem, DQtype, DQrhomax) @@ -905,13 +429,7 @@ function CVodeSetSensDQMethod(cvode_mem, DQtype, DQrhomax) end function CVodeSetSensErrCon(cvode_mem, errconS::Cint) - ccall( - (:CVodeSetSensErrCon, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - errconS, - ) + ccall((:CVodeSetSensErrCon, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, errconS) end function CVodeSetSensErrCon(cvode_mem, errconS) @@ -919,13 +437,7 @@ function CVodeSetSensErrCon(cvode_mem, errconS) end function CVodeSetSensMaxNonlinIters(cvode_mem, maxcorS::Cint) - ccall( - (:CVodeSetSensMaxNonlinIters, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - maxcorS, - ) + ccall((:CVodeSetSensMaxNonlinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, maxcorS) end function CVodeSetSensMaxNonlinIters(cvode_mem, maxcorS) @@ -933,45 +445,19 @@ function CVodeSetSensMaxNonlinIters(cvode_mem, maxcorS) end function CVodeSetSensParams(cvode_mem, p, pbar, plist) - ccall( - (:CVodeSetSensParams, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), - cvode_mem, - p, - pbar, - plist, - ) + ccall((:CVodeSetSensParams, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), cvode_mem, p, pbar, plist) end function CVodeSetNonlinearSolverSensSim(cvode_mem, NLS::SUNNonlinearSolver) - ccall( - (:CVodeSetNonlinearSolverSensSim, libsundials_cvodes), - Cint, - (CVODEMemPtr, SUNNonlinearSolver), - cvode_mem, - NLS, - ) + ccall((:CVodeSetNonlinearSolverSensSim, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) end function CVodeSetNonlinearSolverSensStg(cvode_mem, NLS::SUNNonlinearSolver) - ccall( - (:CVodeSetNonlinearSolverSensStg, libsundials_cvodes), - Cint, - (CVODEMemPtr, SUNNonlinearSolver), - cvode_mem, - NLS, - ) + ccall((:CVodeSetNonlinearSolverSensStg, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) end function CVodeSetNonlinearSolverSensStg1(cvode_mem, NLS::SUNNonlinearSolver) - ccall( - (:CVodeSetNonlinearSolverSensStg1, libsundials_cvodes), - Cint, - (CVODEMemPtr, SUNNonlinearSolver), - cvode_mem, - NLS, - ) + ccall((:CVodeSetNonlinearSolverSensStg1, libsundials_cvodes), Cint, (CVODEMemPtr, SUNNonlinearSolver), cvode_mem, NLS) end function CVodeSensToggleOff(cvode_mem) @@ -979,26 +465,11 @@ function CVodeSensToggleOff(cvode_mem) end function CVodeGetSens(cvode_mem, tret, ySout) - ccall( - (:CVodeGetSens, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), - cvode_mem, - tret, - ySout, - ) + ccall((:CVodeGetSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), cvode_mem, tret, ySout) end function CVodeGetSens1(cvode_mem, tret, is::Cint, ySout::N_Vector) - ccall( - (:CVodeGetSens1, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), - cvode_mem, - tret, - is, - ySout, - ) + ccall((:CVodeGetSens1, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), cvode_mem, tret, is, ySout) end function CVodeGetSens1(cvode_mem, tret, is, ySout) @@ -1007,15 +478,7 @@ function CVodeGetSens1(cvode_mem, tret, is, ySout) end function CVodeGetSensDky(cvode_mem, t::realtype, k::Cint, dkyA) - ccall( - (:CVodeGetSensDky, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), - cvode_mem, - t, - k, - dkyA, - ) + ccall((:CVodeGetSensDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), cvode_mem, t, k, dkyA) end function CVodeGetSensDky(cvode_mem, t, k, dkyA) @@ -1023,141 +486,56 @@ function CVodeGetSensDky(cvode_mem, t, k, dkyA) end function CVodeGetSensDky1(cvode_mem, t::realtype, k::Cint, is::Cint, dky::N_Vector) - ccall( - (:CVodeGetSensDky1, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Cint, Cint, N_Vector), - cvode_mem, - t, - k, - is, - dky, - ) + ccall((:CVodeGetSensDky1, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Cint, N_Vector), cvode_mem, t, k, is, dky) end function CVodeGetSensDky1(cvode_mem, t, k, is, dky) __dky = convert(NVector, dky) - CVodeGetSensDky1( - cvode_mem, - t, - convert(Cint, k), - convert(Cint, is), - convert(N_Vector, __dky), - ) + CVodeGetSensDky1(cvode_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dky)) end function CVodeGetSensNumRhsEvals(cvode_mem, nfSevals) - ccall( - (:CVodeGetSensNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfSevals, - ) + ccall((:CVodeGetSensNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfSevals) end function CVodeGetNumRhsEvalsSens(cvode_mem, nfevalsS) - ccall( - (:CVodeGetNumRhsEvalsSens, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsS, - ) + ccall((:CVodeGetNumRhsEvalsSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsS) end function CVodeGetSensNumErrTestFails(cvode_mem, nSetfails) - ccall( - (:CVodeGetSensNumErrTestFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nSetfails, - ) + ccall((:CVodeGetSensNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSetfails) end function CVodeGetSensNumLinSolvSetups(cvode_mem, nlinsetupsS) - ccall( - (:CVodeGetSensNumLinSolvSetups, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nlinsetupsS, - ) + ccall((:CVodeGetSensNumLinSolvSetups, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlinsetupsS) end function CVodeGetSensErrWeights(cvode_mem, eSweight) - ccall( - (:CVodeGetSensErrWeights, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{N_Vector}), - cvode_mem, - eSweight, - ) + ccall((:CVodeGetSensErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, eSweight) end function CVodeGetSensStats(cvode_mem, nfSevals, nfevalsS, nSetfails, nlinsetupsS) - ccall( - (:CVodeGetSensStats, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - nfSevals, - nfevalsS, - nSetfails, - nlinsetupsS, - ) + ccall((:CVodeGetSensStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), cvode_mem, nfSevals, nfevalsS, nSetfails, nlinsetupsS) end function CVodeGetSensNumNonlinSolvIters(cvode_mem, nSniters) - ccall( - (:CVodeGetSensNumNonlinSolvIters, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nSniters, - ) + ccall((:CVodeGetSensNumNonlinSolvIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSniters) end function CVodeGetSensNumNonlinSolvConvFails(cvode_mem, nSncfails) - ccall( - (:CVodeGetSensNumNonlinSolvConvFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nSncfails, - ) + ccall((:CVodeGetSensNumNonlinSolvConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSncfails) end function CVodeGetStgrSensNumNonlinSolvIters(cvode_mem, nSTGR1niters) - ccall( - (:CVodeGetStgrSensNumNonlinSolvIters, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nSTGR1niters, - ) + ccall((:CVodeGetStgrSensNumNonlinSolvIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSTGR1niters) end function CVodeGetStgrSensNumNonlinSolvConvFails(cvode_mem, nSTGR1ncfails) - ccall( - (:CVodeGetStgrSensNumNonlinSolvConvFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nSTGR1ncfails, - ) + ccall((:CVodeGetStgrSensNumNonlinSolvConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nSTGR1ncfails) end function CVodeGetSensNonlinSolvStats(cvode_mem, nSniters, nSncfails) - ccall( - (:CVodeGetSensNonlinSolvStats, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - nSniters, - nSncfails, - ) + ccall((:CVodeGetSensNonlinSolvStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nSniters, nSncfails) end function CVodeSensFree(cvode_mem) @@ -1165,46 +543,19 @@ function CVodeSensFree(cvode_mem) end function CVodeQuadSensInit(cvode_mem, fQS::CVQuadSensRhsFn, yQS0) - ccall( - (:CVodeQuadSensInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVQuadSensRhsFn, Ptr{N_Vector}), - cvode_mem, - fQS, - yQS0, - ) + ccall((:CVodeQuadSensInit, libsundials_cvodes), Cint, (CVODEMemPtr, CVQuadSensRhsFn, Ptr{N_Vector}), cvode_mem, fQS, yQS0) end function CVodeQuadSensReInit(cvode_mem, yQS0) - ccall( - (:CVodeQuadSensReInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{N_Vector}), - cvode_mem, - yQS0, - ) + ccall((:CVodeQuadSensReInit, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, yQS0) end function CVodeQuadSensSStolerances(cvode_mem, reltolQS::realtype, abstolQS) - ccall( - (:CVodeQuadSensSStolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Ptr{realtype}), - cvode_mem, - reltolQS, - abstolQS, - ) + ccall((:CVodeQuadSensSStolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{realtype}), cvode_mem, reltolQS, abstolQS) end function CVodeQuadSensSVtolerances(cvode_mem, reltolQS::realtype, abstolQS) - ccall( - (:CVodeQuadSensSVtolerances, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Ptr{N_Vector}), - cvode_mem, - reltolQS, - abstolQS, - ) + ccall((:CVodeQuadSensSVtolerances, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Ptr{N_Vector}), cvode_mem, reltolQS, abstolQS) end function CVodeQuadSensEEtolerances(cvode_mem) @@ -1212,13 +563,7 @@ function CVodeQuadSensEEtolerances(cvode_mem) end function CVodeSetQuadSensErrCon(cvode_mem, errconQS::Cint) - ccall( - (:CVodeSetQuadSensErrCon, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint), - cvode_mem, - errconQS, - ) + ccall((:CVodeSetQuadSensErrCon, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, errconQS) end function CVodeSetQuadSensErrCon(cvode_mem, errconQS) @@ -1226,26 +571,11 @@ function CVodeSetQuadSensErrCon(cvode_mem, errconQS) end function CVodeGetQuadSens(cvode_mem, tret, yQSout) - ccall( - (:CVodeGetQuadSens, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), - cvode_mem, - tret, - yQSout, - ) + ccall((:CVodeGetQuadSens, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Ptr{N_Vector}), cvode_mem, tret, yQSout) end function CVodeGetQuadSens1(cvode_mem, tret, is::Cint, yQSout::N_Vector) - ccall( - (:CVodeGetQuadSens1, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), - cvode_mem, - tret, - is, - yQSout, - ) + ccall((:CVodeGetQuadSens1, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{realtype}, Cint, N_Vector), cvode_mem, tret, is, yQSout) end function CVodeGetQuadSens1(cvode_mem, tret, is, yQSout) @@ -1254,15 +584,7 @@ function CVodeGetQuadSens1(cvode_mem, tret, is, yQSout) end function CVodeGetQuadSensDky(cvode_mem, t::realtype, k::Cint, dkyQS_all) - ccall( - (:CVodeGetQuadSensDky, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), - cvode_mem, - t, - k, - dkyQS_all, - ) + ccall((:CVodeGetQuadSensDky, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Ptr{N_Vector}), cvode_mem, t, k, dkyQS_all) end function CVodeGetQuadSensDky(cvode_mem, t, k, dkyQS_all) @@ -1270,68 +592,28 @@ function CVodeGetQuadSensDky(cvode_mem, t, k, dkyQS_all) end function CVodeGetQuadSensDky1(cvode_mem, t::realtype, k::Cint, is::Cint, dkyQS::N_Vector) - ccall( - (:CVodeGetQuadSensDky1, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Cint, Cint, N_Vector), - cvode_mem, - t, - k, - is, - dkyQS, - ) + ccall((:CVodeGetQuadSensDky1, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint, Cint, N_Vector), cvode_mem, t, k, is, dkyQS) end function CVodeGetQuadSensDky1(cvode_mem, t, k, is, dkyQS) __dkyQS = convert(NVector, dkyQS) - CVodeGetQuadSensDky1( - cvode_mem, - t, - convert(Cint, k), - convert(Cint, is), - convert(N_Vector, __dkyQS), - ) + CVodeGetQuadSensDky1(cvode_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dkyQS)) end function CVodeGetQuadSensNumRhsEvals(cvode_mem, nfQSevals) - ccall( - (:CVodeGetQuadSensNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfQSevals, - ) + ccall((:CVodeGetQuadSensNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfQSevals) end function CVodeGetQuadSensNumErrTestFails(cvode_mem, nQSetfails) - ccall( - (:CVodeGetQuadSensNumErrTestFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nQSetfails, - ) + ccall((:CVodeGetQuadSensNumErrTestFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nQSetfails) end function CVodeGetQuadSensErrWeights(cvode_mem, eQSweight) - ccall( - (:CVodeGetQuadSensErrWeights, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{N_Vector}), - cvode_mem, - eQSweight, - ) + ccall((:CVodeGetQuadSensErrWeights, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{N_Vector}), cvode_mem, eQSweight) end function CVodeGetQuadSensStats(cvode_mem, nfQSevals, nQSetfails) - ccall( - (:CVodeGetQuadSensStats, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - nfQSevals, - nQSetfails, - ) + ccall((:CVodeGetQuadSensStats, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, nfQSevals, nQSetfails) end function CVodeQuadSensFree(cvode_mem) @@ -1339,14 +621,7 @@ function CVodeQuadSensFree(cvode_mem) end function CVodeAdjInit(cvode_mem, steps::Clong, interp::Cint) - ccall( - (:CVodeAdjInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, Clong, Cint), - cvode_mem, - steps, - interp, - ) + ccall((:CVodeAdjInit, libsundials_cvodes), Cint, (CVODEMemPtr, Clong, Cint), cvode_mem, steps, interp) end function CVodeAdjInit(cvode_mem, steps, interp) @@ -1362,14 +637,7 @@ function CVodeAdjFree(cvode_mem) end function CVodeCreateB(cvode_mem, lmmB::Cint, which) - ccall( - (:CVodeCreateB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Ptr{Cint}), - cvode_mem, - lmmB, - which, - ) + ccall((:CVodeCreateB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{Cint}), cvode_mem, lmmB, which) end function CVodeCreateB(cvode_mem, lmmB, which) @@ -1377,16 +645,7 @@ function CVodeCreateB(cvode_mem, lmmB, which) end function CVodeInitB(cvode_mem, which::Cint, fB::CVRhsFnB, tB0::realtype, yB0::N_Vector) - ccall( - (:CVodeInitB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVRhsFnB, realtype, N_Vector), - cvode_mem, - which, - fB, - tB0, - yB0, - ) + ccall((:CVodeInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVRhsFnB, realtype, N_Vector), cvode_mem, which, fB, tB0, yB0) end function CVodeInitB(cvode_mem, which, fB, tB0, yB0) @@ -1395,16 +654,7 @@ function CVodeInitB(cvode_mem, which, fB, tB0, yB0) end function CVodeInitBS(cvode_mem, which::Cint, fBs::CVRhsFnBS, tB0::realtype, yB0::N_Vector) - ccall( - (:CVodeInitBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVRhsFnBS, realtype, N_Vector), - cvode_mem, - which, - fBs, - tB0, - yB0, - ) + ccall((:CVodeInitBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVRhsFnBS, realtype, N_Vector), cvode_mem, which, fBs, tB0, yB0) end function CVodeInitBS(cvode_mem, which, fBs, tB0, yB0) @@ -1413,15 +663,7 @@ function CVodeInitBS(cvode_mem, which, fBs, tB0, yB0) end function CVodeReInitB(cvode_mem, which::Cint, tB0::realtype, yB0::N_Vector) - ccall( - (:CVodeReInitB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype, N_Vector), - cvode_mem, - which, - tB0, - yB0, - ) + ccall((:CVodeReInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, N_Vector), cvode_mem, which, tB0, yB0) end function CVodeReInitB(cvode_mem, which, tB0, yB0) @@ -1430,15 +672,7 @@ function CVodeReInitB(cvode_mem, which, tB0, yB0) end function CVodeSStolerancesB(cvode_mem, which::Cint, reltolB::realtype, abstolB::realtype) - ccall( - (:CVodeSStolerancesB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype, realtype), - cvode_mem, - which, - reltolB, - abstolB, - ) + ccall((:CVodeSStolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, realtype), cvode_mem, which, reltolB, abstolB) end function CVodeSStolerancesB(cvode_mem, which, reltolB, abstolB) @@ -1446,37 +680,16 @@ function CVodeSStolerancesB(cvode_mem, which, reltolB, abstolB) end function CVodeSVtolerancesB(cvode_mem, which::Cint, reltolB::realtype, abstolB::N_Vector) - ccall( - (:CVodeSVtolerancesB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype, N_Vector), - cvode_mem, - which, - reltolB, - abstolB, - ) + ccall((:CVodeSVtolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, N_Vector), cvode_mem, which, reltolB, abstolB) end function CVodeSVtolerancesB(cvode_mem, which, reltolB, abstolB) __abstolB = convert(NVector, abstolB) - CVodeSVtolerancesB( - cvode_mem, - convert(Cint, which), - reltolB, - convert(N_Vector, __abstolB), - ) + CVodeSVtolerancesB(cvode_mem, convert(Cint, which), reltolB, convert(N_Vector, __abstolB)) end function CVodeQuadInitB(cvode_mem, which::Cint, fQB::CVQuadRhsFnB, yQB0::N_Vector) - ccall( - (:CVodeQuadInitB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVQuadRhsFnB, N_Vector), - cvode_mem, - which, - fQB, - yQB0, - ) + ccall((:CVodeQuadInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVQuadRhsFnB, N_Vector), cvode_mem, which, fQB, yQB0) end function CVodeQuadInitB(cvode_mem, which, fQB, yQB0) @@ -1485,15 +698,7 @@ function CVodeQuadInitB(cvode_mem, which, fQB, yQB0) end function CVodeQuadInitBS(cvode_mem, which::Cint, fQBs::CVQuadRhsFnBS, yQB0::N_Vector) - ccall( - (:CVodeQuadInitBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVQuadRhsFnBS, N_Vector), - cvode_mem, - which, - fQBs, - yQB0, - ) + ccall((:CVodeQuadInitBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVQuadRhsFnBS, N_Vector), cvode_mem, which, fQBs, yQB0) end function CVodeQuadInitBS(cvode_mem, which, fQBs, yQB0) @@ -1502,14 +707,7 @@ function CVodeQuadInitBS(cvode_mem, which, fQBs, yQB0) end function CVodeQuadReInitB(cvode_mem, which::Cint, yQB0::N_Vector) - ccall( - (:CVodeQuadReInitB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, N_Vector), - cvode_mem, - which, - yQB0, - ) + ccall((:CVodeQuadReInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, N_Vector), cvode_mem, which, yQB0) end function CVodeQuadReInitB(cvode_mem, which, yQB0) @@ -1517,89 +715,34 @@ function CVodeQuadReInitB(cvode_mem, which, yQB0) CVodeQuadReInitB(cvode_mem, convert(Cint, which), convert(N_Vector, __yQB0)) end -function CVodeQuadSStolerancesB( - cvode_mem, - which::Cint, - reltolQB::realtype, - abstolQB::realtype, -) - ccall( - (:CVodeQuadSStolerancesB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype, realtype), - cvode_mem, - which, - reltolQB, - abstolQB, - ) +function CVodeQuadSStolerancesB(cvode_mem, which::Cint, reltolQB::realtype, abstolQB::realtype) + ccall((:CVodeQuadSStolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, realtype), cvode_mem, which, reltolQB, abstolQB) end function CVodeQuadSStolerancesB(cvode_mem, which, reltolQB, abstolQB) CVodeQuadSStolerancesB(cvode_mem, convert(Cint, which), reltolQB, abstolQB) end -function CVodeQuadSVtolerancesB( - cvode_mem, - which::Cint, - reltolQB::realtype, - abstolQB::N_Vector, -) - ccall( - (:CVodeQuadSVtolerancesB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype, N_Vector), - cvode_mem, - which, - reltolQB, - abstolQB, - ) +function CVodeQuadSVtolerancesB(cvode_mem, which::Cint, reltolQB::realtype, abstolQB::N_Vector) + ccall((:CVodeQuadSVtolerancesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype, N_Vector), cvode_mem, which, reltolQB, abstolQB) end function CVodeQuadSVtolerancesB(cvode_mem, which, reltolQB, abstolQB) __abstolQB = convert(NVector, abstolQB) - CVodeQuadSVtolerancesB( - cvode_mem, - convert(Cint, which), - reltolQB, - convert(N_Vector, __abstolQB), - ) + CVodeQuadSVtolerancesB(cvode_mem, convert(Cint, which), reltolQB, convert(N_Vector, __abstolQB)) end function CVodeF(cvode_mem, tout::realtype, yout::N_Vector, tret, itask::Cint, ncheckPtr) - ccall( - (:CVodeF, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint, Ptr{Cint}), - cvode_mem, - tout, - yout, - tret, - itask, - ncheckPtr, - ) + ccall((:CVodeF, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector, Ptr{realtype}, Cint, Ptr{Cint}), cvode_mem, tout, yout, tret, itask, ncheckPtr) end function CVodeF(cvode_mem, tout, yout, tret, itask, ncheckPtr) __yout = convert(NVector, yout) - CVodeF( - cvode_mem, - tout, - convert(N_Vector, __yout), - tret, - convert(Cint, itask), - ncheckPtr, - ) + CVodeF(cvode_mem, tout, convert(N_Vector, __yout), tret, convert(Cint, itask), ncheckPtr) end function CVodeB(cvode_mem, tBout::realtype, itaskB::Cint) - ccall( - (:CVodeB, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, Cint), - cvode_mem, - tBout, - itaskB, - ) + ccall((:CVodeB, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, Cint), cvode_mem, tBout, itaskB) end function CVodeB(cvode_mem, tBout, itaskB) @@ -1611,14 +754,7 @@ function CVodeSetAdjNoSensi(cvode_mem) end function CVodeSetUserDataB(cvode_mem, which::Cint, user_dataB) - ccall( - (:CVodeSetUserDataB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Any), - cvode_mem, - which, - user_dataB, - ) + ccall((:CVodeSetUserDataB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Any), cvode_mem, which, user_dataB) end function CVodeSetUserDataB(cvode_mem, which, user_dataB) @@ -1626,14 +762,7 @@ function CVodeSetUserDataB(cvode_mem, which, user_dataB) end function CVodeSetMaxOrdB(cvode_mem, which::Cint, maxordB::Cint) - ccall( - (:CVodeSetMaxOrdB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Cint), - cvode_mem, - which, - maxordB, - ) + ccall((:CVodeSetMaxOrdB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint), cvode_mem, which, maxordB) end function CVodeSetMaxOrdB(cvode_mem, which, maxordB) @@ -1641,14 +770,7 @@ function CVodeSetMaxOrdB(cvode_mem, which, maxordB) end function CVodeSetMaxNumStepsB(cvode_mem, which::Cint, mxstepsB::Clong) - ccall( - (:CVodeSetMaxNumStepsB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Clong), - cvode_mem, - which, - mxstepsB, - ) + ccall((:CVodeSetMaxNumStepsB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Clong), cvode_mem, which, mxstepsB) end function CVodeSetMaxNumStepsB(cvode_mem, whichs, mxstepsB) @@ -1656,14 +778,7 @@ function CVodeSetMaxNumStepsB(cvode_mem, whichs, mxstepsB) end function CVodeSetStabLimDetB(cvode_mem, which::Cint, stldetB::Cint) - ccall( - (:CVodeSetStabLimDetB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Cint), - cvode_mem, - which, - stldetB, - ) + ccall((:CVodeSetStabLimDetB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint), cvode_mem, which, stldetB) end function CVodeSetStabLimDetB(cvode_mem, which, stldetB) @@ -1671,14 +786,7 @@ function CVodeSetStabLimDetB(cvode_mem, which, stldetB) end function CVodeSetInitStepB(cvode_mem, which::Cint, hinB::realtype) - ccall( - (:CVodeSetInitStepB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype), - cvode_mem, - which, - hinB, - ) + ccall((:CVodeSetInitStepB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, hinB) end function CVodeSetInitStepB(cvode_mem, which, hinB) @@ -1686,14 +794,7 @@ function CVodeSetInitStepB(cvode_mem, which, hinB) end function CVodeSetMinStepB(cvode_mem, which::Cint, hminB::realtype) - ccall( - (:CVodeSetMinStepB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype), - cvode_mem, - which, - hminB, - ) + ccall((:CVodeSetMinStepB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, hminB) end function CVodeSetMinStepB(cvode_mem, which, hminB) @@ -1701,14 +802,7 @@ function CVodeSetMinStepB(cvode_mem, which, hminB) end function CVodeSetMaxStepB(cvode_mem, which::Cint, hmaxB::realtype) - ccall( - (:CVodeSetMaxStepB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype), - cvode_mem, - which, - hmaxB, - ) + ccall((:CVodeSetMaxStepB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, hmaxB) end function CVodeSetMaxStepB(cvode_mem, which, hmaxB) @@ -1716,14 +810,7 @@ function CVodeSetMaxStepB(cvode_mem, which, hmaxB) end function CVodeSetConstraintsB(cvode_mem, which::Cint, constraintsB::N_Vector) - ccall( - (:CVodeSetConstraintsB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, N_Vector), - cvode_mem, - which, - constraintsB, - ) + ccall((:CVodeSetConstraintsB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, N_Vector), cvode_mem, which, constraintsB) end function CVodeSetConstraintsB(cvode_mem, which, constraintsB) @@ -1732,14 +819,7 @@ function CVodeSetConstraintsB(cvode_mem, which, constraintsB) end function CVodeSetQuadErrConB(cvode_mem, which::Cint, errconQB::Cint) - ccall( - (:CVodeSetQuadErrConB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Cint), - cvode_mem, - which, - errconQB, - ) + ccall((:CVodeSetQuadErrConB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Cint), cvode_mem, which, errconQB) end function CVodeSetQuadErrConB(cvode_mem, which, errconQB) @@ -1747,14 +827,7 @@ function CVodeSetQuadErrConB(cvode_mem, which, errconQB) end function CVodeSetNonlinearSolverB(cvode_mem, which::Cint, NLS::SUNNonlinearSolver) - ccall( - (:CVodeSetNonlinearSolverB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, SUNNonlinearSolver), - cvode_mem, - which, - NLS, - ) + ccall((:CVodeSetNonlinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNNonlinearSolver), cvode_mem, which, NLS) end function CVodeSetNonlinearSolverB(cvode_mem, which, NLS) @@ -1762,15 +835,7 @@ function CVodeSetNonlinearSolverB(cvode_mem, which, NLS) end function CVodeGetB(cvode_mem, which::Cint, tBret, yB::N_Vector) - ccall( - (:CVodeGetB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), - cvode_mem, - which, - tBret, - yB, - ) + ccall((:CVodeGetB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), cvode_mem, which, tBret, yB) end function CVodeGetB(cvode_mem, which, tBret, yB) @@ -1779,15 +844,7 @@ function CVodeGetB(cvode_mem, which, tBret, yB) end function CVodeGetQuadB(cvode_mem, which::Cint, tBret, qB::N_Vector) - ccall( - (:CVodeGetQuadB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), - cvode_mem, - which, - tBret, - qB, - ) + ccall((:CVodeGetQuadB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector), cvode_mem, which, tBret, qB) end function CVodeGetQuadB(cvode_mem, which, tBret, qB) @@ -1796,13 +853,7 @@ function CVodeGetQuadB(cvode_mem, which, tBret, qB) end function CVodeGetAdjCVodeBmem(cvode_mem, which::Cint) - ccall( - (:CVodeGetAdjCVodeBmem, libsundials_cvodes), - Ptr{Cvoid}, - (CVODEMemPtr, Cint), - cvode_mem, - which, - ) + ccall((:CVodeGetAdjCVodeBmem, libsundials_cvodes), Ptr{Cvoid}, (CVODEMemPtr, Cint), cvode_mem, which) end function CVodeGetAdjCVodeBmem(cvode_mem, which) @@ -1810,14 +861,7 @@ function CVodeGetAdjCVodeBmem(cvode_mem, which) end function CVodeGetAdjY(cvode_mem, t::realtype, y::N_Vector) - ccall( - (:CVodeGetAdjY, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype, N_Vector), - cvode_mem, - t, - y, - ) + ccall((:CVodeGetAdjY, libsundials_cvodes), Cint, (CVODEMemPtr, realtype, N_Vector), cvode_mem, t, y) end function CVodeGetAdjY(cvode_mem, t, y) @@ -1826,345 +870,107 @@ function CVodeGetAdjY(cvode_mem, t, y) end function CVodeGetAdjCheckPointsInfo(cvode_mem, ckpnt) - ccall( - (:CVodeGetAdjCheckPointsInfo, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{CVadjCheckPointRec}), - cvode_mem, - ckpnt, - ) + ccall((:CVodeGetAdjCheckPointsInfo, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{CVadjCheckPointRec}), cvode_mem, ckpnt) end function CVodeGetAdjDataPointHermite(cvode_mem, which::Cint, t, y::N_Vector, yd::N_Vector) - ccall( - (:CVodeGetAdjDataPointHermite, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), - cvode_mem, - which, - t, - y, - yd, - ) + ccall((:CVodeGetAdjDataPointHermite, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), cvode_mem, which, t, y, yd) end function CVodeGetAdjDataPointHermite(cvode_mem, which, t, y, yd) __y = convert(NVector, y) __yd = convert(NVector, yd) - CVodeGetAdjDataPointHermite( - cvode_mem, - convert(Cint, which), - t, - convert(N_Vector, __y), - convert(N_Vector, __yd), - ) + CVodeGetAdjDataPointHermite(cvode_mem, convert(Cint, which), t, convert(N_Vector, __y), convert(N_Vector, __yd)) end function CVodeGetAdjDataPointPolynomial(cvode_mem, which::Cint, t, order, y::N_Vector) - ccall( - (:CVodeGetAdjDataPointPolynomial, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), - cvode_mem, - which, - t, - order, - y, - ) + ccall((:CVodeGetAdjDataPointPolynomial, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), cvode_mem, which, t, order, y) end function CVodeGetAdjDataPointPolynomial(cvode_mem, which, t, order, y) __y = convert(NVector, y) - CVodeGetAdjDataPointPolynomial( - cvode_mem, - convert(Cint, which), - t, - order, - convert(N_Vector, __y), - ) + CVodeGetAdjDataPointPolynomial(cvode_mem, convert(Cint, which), t, order, convert(N_Vector, __y)) end function CVodeGetAdjCurrentCheckPoint(cvode_mem, addr) - ccall( - (:CVodeGetAdjCurrentCheckPoint, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Ptr{Cvoid}}), - cvode_mem, - addr, - ) + ccall((:CVodeGetAdjCurrentCheckPoint, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Ptr{Cvoid}}), cvode_mem, addr) end # Julia wrapper for header: cvodes_bandpre.h # Automatically generated using Clang.jl + function CVBandPrecInit(cvode_mem, N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall( - (:CVBandPrecInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, sunindextype, sunindextype, sunindextype), - cvode_mem, - N, - mu, - ml, - ) + ccall((:CVBandPrecInit, libsundials_cvodes), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype), cvode_mem, N, mu, ml) end function CVBandPrecGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVBandPrecGetWorkSpace, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVBandPrecGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVBandPrecGetNumRhsEvals(cvode_mem, nfevalsBP) - ccall( - (:CVBandPrecGetNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsBP, - ) -end - -function CVBandPrecInitB( - cvode_mem, - which::Cint, - nB::sunindextype, - muB::sunindextype, - mlB::sunindextype, -) - ccall( - (:CVBandPrecInitB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, sunindextype, sunindextype, sunindextype), - cvode_mem, - which, - nB, - muB, - mlB, - ) -end - -function CVBandPrecInitB( - cvode_mem, - which, - nB::sunindextype, - muB::sunindextype, - mlB::sunindextype, -) + ccall((:CVBandPrecGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsBP) +end + +function CVBandPrecInitB(cvode_mem, which::Cint, nB::sunindextype, muB::sunindextype, mlB::sunindextype) + ccall((:CVBandPrecInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, sunindextype, sunindextype, sunindextype), cvode_mem, which, nB, muB, mlB) +end + +function CVBandPrecInitB(cvode_mem, which, nB::sunindextype, muB::sunindextype, mlB::sunindextype) CVBandPrecInitB(cvode_mem, convert(Cint, which), nB, muB, mlB) end # Julia wrapper for header: cvodes_bbdpre.h # Automatically generated using Clang.jl -function CVBBDPrecInit( - cvode_mem, - Nlocal::sunindextype, - mudq::sunindextype, - mldq::sunindextype, - mukeep::sunindextype, - mlkeep::sunindextype, - dqrely::realtype, - gloc::CVLocalFn, - cfn::CVCommFn, -) - ccall( - (:CVBBDPrecInit, libsundials_cvodes), - Cint, - ( - CVODEMemPtr, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - CVLocalFn, - CVCommFn, - ), - cvode_mem, - Nlocal, - mudq, - mldq, - mukeep, - mlkeep, - dqrely, - gloc, - cfn, - ) -end - -function CVBBDPrecReInit( - cvode_mem, - mudq::sunindextype, - mldq::sunindextype, - dqrely::realtype, -) - ccall( - (:CVBBDPrecReInit, libsundials_cvodes), - Cint, - (CVODEMemPtr, sunindextype, sunindextype, realtype), - cvode_mem, - mudq, - mldq, - dqrely, - ) + +function CVBBDPrecInit(cvode_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dqrely::realtype, gloc::CVLocalFn, cfn::CVCommFn) + ccall((:CVBBDPrecInit, libsundials_cvodes), Cint, (CVODEMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, CVLocalFn, CVCommFn), cvode_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dqrely, gloc, cfn) +end + +function CVBBDPrecReInit(cvode_mem, mudq::sunindextype, mldq::sunindextype, dqrely::realtype) + ccall((:CVBBDPrecReInit, libsundials_cvodes), Cint, (CVODEMemPtr, sunindextype, sunindextype, realtype), cvode_mem, mudq, mldq, dqrely) end function CVBBDPrecGetWorkSpace(cvode_mem, lenrwBBDP, leniwBBDP) - ccall( - (:CVBBDPrecGetWorkSpace, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwBBDP, - leniwBBDP, - ) + ccall((:CVBBDPrecGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwBBDP, leniwBBDP) end function CVBBDPrecGetNumGfnEvals(cvode_mem, ngevalsBBDP) - ccall( - (:CVBBDPrecGetNumGfnEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - ngevalsBBDP, - ) -end - -function CVBBDPrecInitB( - cvode_mem, - which::Cint, - NlocalB::sunindextype, - mudqB::sunindextype, - mldqB::sunindextype, - mukeepB::sunindextype, - mlkeepB::sunindextype, - dqrelyB::realtype, - glocB::CVLocalFnB, - cfnB::CVCommFnB, -) - ccall( - (:CVBBDPrecInitB, libsundials_cvodes), - Cint, - ( - CVODEMemPtr, - Cint, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - CVLocalFnB, - CVCommFnB, - ), - cvode_mem, - which, - NlocalB, - mudqB, - mldqB, - mukeepB, - mlkeepB, - dqrelyB, - glocB, - cfnB, - ) -end - -function CVBBDPrecInitB( - cvode_mem, - which, - NlocalB::sunindextype, - mudqB::sunindextype, - mldqB::sunindextype, - mukeepB::sunindextype, - mlkeepB::sunindextype, - dqrelyB::realtype, - glocB::CVLocalFnB, - cfnB::CVCommFnB, -) - CVBBDPrecInitB( - cvode_mem, - convert(Cint, which), - NlocalB, - mudqB, - mldqB, - mukeepB, - mlkeepB, - dqrelyB, - glocB, - cfnB, - ) -end - -function CVBBDPrecReInitB( - cvode_mem, - which::Cint, - mudqB::sunindextype, - mldqB::sunindextype, - dqrelyB::realtype, -) - ccall( - (:CVBBDPrecReInitB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, sunindextype, sunindextype, realtype), - cvode_mem, - which, - mudqB, - mldqB, - dqrelyB, - ) -end - -function CVBBDPrecReInitB( - cvode_mem, - which, - mudqB::sunindextype, - mldqB::sunindextype, - dqrelyB::realtype, -) + ccall((:CVBBDPrecGetNumGfnEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, ngevalsBBDP) +end + +function CVBBDPrecInitB(cvode_mem, which::Cint, NlocalB::sunindextype, mudqB::sunindextype, mldqB::sunindextype, mukeepB::sunindextype, mlkeepB::sunindextype, dqrelyB::realtype, glocB::CVLocalFnB, cfnB::CVCommFnB) + ccall((:CVBBDPrecInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, CVLocalFnB, CVCommFnB), cvode_mem, which, NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dqrelyB, glocB, cfnB) +end + +function CVBBDPrecInitB(cvode_mem, which, NlocalB::sunindextype, mudqB::sunindextype, mldqB::sunindextype, mukeepB::sunindextype, mlkeepB::sunindextype, dqrelyB::realtype, glocB::CVLocalFnB, cfnB::CVCommFnB) + CVBBDPrecInitB(cvode_mem, convert(Cint, which), NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dqrelyB, glocB, cfnB) +end + +function CVBBDPrecReInitB(cvode_mem, which::Cint, mudqB::sunindextype, mldqB::sunindextype, dqrelyB::realtype) + ccall((:CVBBDPrecReInitB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, sunindextype, sunindextype, realtype), cvode_mem, which, mudqB, mldqB, dqrelyB) +end + +function CVBBDPrecReInitB(cvode_mem, which, mudqB::sunindextype, mldqB::sunindextype, dqrelyB::realtype) CVBBDPrecReInitB(cvode_mem, convert(Cint, which), mudqB, mldqB, dqrelyB) end # Julia wrapper for header: cvodes_diag.h # Automatically generated using Clang.jl + function CVDiag(cvode_mem) ccall((:CVDiag, libsundials_cvodes), Cint, (CVODEMemPtr,), cvode_mem) end function CVDiagGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVDiagGetWorkSpace, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVDiagGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVDiagGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVDiagGetNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVDiagGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVDiagGetLastFlag(cvode_mem, flag) - ccall( - (:CVDiagGetLastFlag, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVDiagGetLastFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVDiagGetReturnFlagName(flag::Clong) @@ -2175,6 +981,7 @@ function CVDiagGetReturnFlagName(flag) CVDiagGetReturnFlagName(convert(Clong, flag)) end + function CVDiagB(cvode_mem, which::Cint) ccall((:CVDiagB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint), cvode_mem, which) end @@ -2185,66 +992,29 @@ end # Julia wrapper for header: cvodes_direct.h # Automatically generated using Clang.jl + function CVDlsSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:CVDlsSetLinearSolver, libsundials_cvodes), - Cint, - (CVODEMemPtr, SUNLinearSolver, SUNMatrix), - cvode_mem, - LS, - A, - ) + ccall((:CVDlsSetLinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) end function CVDlsSetJacFn(cvode_mem, jac::CVDlsJacFn) - ccall( - (:CVDlsSetJacFn, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVDlsJacFn), - cvode_mem, - jac, - ) + ccall((:CVDlsSetJacFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVDlsJacFn), cvode_mem, jac) end function CVDlsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVDlsGetWorkSpace, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVDlsGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVDlsGetNumJacEvals(cvode_mem, njevals) - ccall( - (:CVDlsGetNumJacEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njevals, - ) + ccall((:CVDlsGetNumJacEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) end function CVDlsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVDlsGetNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVDlsGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVDlsGetLastFlag(cvode_mem, flag) - ccall( - (:CVDlsGetLastFlag, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVDlsGetLastFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVDlsGetReturnFlagName(flag::Clong) @@ -2256,15 +1026,7 @@ function CVDlsGetReturnFlagName(flag) end function CVDlsSetLinearSolverB(cvode_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:CVDlsSetLinearSolverB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), - cvode_mem, - which, - LS, - A, - ) + ccall((:CVDlsSetLinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), cvode_mem, which, LS, A) end function CVDlsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatrix) @@ -2272,14 +1034,7 @@ function CVDlsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatr end function CVDlsSetJacFnB(cvode_mem, which::Cint, jacB::CVDlsJacFnB) - ccall( - (:CVDlsSetJacFnB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVDlsJacFnB), - cvode_mem, - which, - jacB, - ) + ccall((:CVDlsSetJacFnB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVDlsJacFnB), cvode_mem, which, jacB) end function CVDlsSetJacFnB(cvode_mem, which, jacB::CVDlsJacFnB) @@ -2287,14 +1042,7 @@ function CVDlsSetJacFnB(cvode_mem, which, jacB::CVDlsJacFnB) end function CVDlsSetJacFnBS(cvode_mem, which::Cint, jacBS::CVDlsJacFnBS) - ccall( - (:CVDlsSetJacFnBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVDlsJacFnBS), - cvode_mem, - which, - jacBS, - ) + ccall((:CVDlsSetJacFnBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVDlsJacFnBS), cvode_mem, which, jacBS) end function CVDlsSetJacFnBS(cvode_mem, which, jacBS::CVDlsJacFnBS) @@ -2303,35 +1051,17 @@ end # Julia wrapper for header: cvodes_ls.h # Automatically generated using Clang.jl + function CVodeSetLinearSolver(cvode_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:CVodeSetLinearSolver, libsundials_cvodes), - Cint, - (CVODEMemPtr, SUNLinearSolver, SUNMatrix), - cvode_mem, - LS, - A, - ) + ccall((:CVodeSetLinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNLinearSolver, SUNMatrix), cvode_mem, LS, A) end function CVodeSetJacFn(cvode_mem, jac::CVLsJacFn) - ccall( - (:CVodeSetJacFn, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVLsJacFn), - cvode_mem, - jac, - ) + ccall((:CVodeSetJacFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsJacFn), cvode_mem, jac) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj::Clong) - ccall( - (:CVodeSetMaxStepsBetweenJac, libsundials_cvodes), - Cint, - (CVODEMemPtr, Clong), - cvode_mem, - msbj, - ) + ccall((:CVodeSetMaxStepsBetweenJac, libsundials_cvodes), Cint, (CVODEMemPtr, Clong), cvode_mem, msbj) end function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) @@ -2339,150 +1069,59 @@ function CVodeSetMaxStepsBetweenJac(cvode_mem, msbj) end function CVodeSetEpsLin(cvode_mem, eplifac::realtype) - ccall( - (:CVodeSetEpsLin, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - eplifac, - ) + ccall((:CVodeSetEpsLin, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) end function CVodeSetPreconditioner(cvode_mem, pset::CVLsPrecSetupFn, psolve::CVLsPrecSolveFn) - ccall( - (:CVodeSetPreconditioner, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), - cvode_mem, - pset, - psolve, - ) -end - -function CVodeSetJacTimes( - cvode_mem, - jtsetup::CVLsJacTimesSetupFn, - jtimes::CVLsJacTimesVecFn, -) - ccall( - (:CVodeSetJacTimes, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), - cvode_mem, - jtsetup, - jtimes, - ) + ccall((:CVodeSetPreconditioner, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsPrecSetupFn, CVLsPrecSolveFn), cvode_mem, pset, psolve) +end + +function CVodeSetJacTimes(cvode_mem, jtsetup::CVLsJacTimesSetupFn, jtimes::CVLsJacTimesVecFn) + ccall((:CVodeSetJacTimes, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsJacTimesSetupFn, CVLsJacTimesVecFn), cvode_mem, jtsetup, jtimes) end function CVodeSetLinSysFn(cvode_mem, linsys::CVLsLinSysFn) - ccall( - (:CVodeSetLinSysFn, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVLsLinSysFn), - cvode_mem, - linsys, - ) + ccall((:CVodeSetLinSysFn, libsundials_cvodes), Cint, (CVODEMemPtr, CVLsLinSysFn), cvode_mem, linsys) end function CVodeGetLinWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVodeGetLinWorkSpace, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVodeGetLinWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVodeGetNumJacEvals(cvode_mem, njevals) - ccall( - (:CVodeGetNumJacEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njevals, - ) + ccall((:CVodeGetNumJacEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njevals) end function CVodeGetNumPrecEvals(cvode_mem, npevals) - ccall( - (:CVodeGetNumPrecEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npevals, - ) + ccall((:CVodeGetNumPrecEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) end function CVodeGetNumPrecSolves(cvode_mem, npsolves) - ccall( - (:CVodeGetNumPrecSolves, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npsolves, - ) + ccall((:CVodeGetNumPrecSolves, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) end function CVodeGetNumLinIters(cvode_mem, nliters) - ccall( - (:CVodeGetNumLinIters, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nliters, - ) + ccall((:CVodeGetNumLinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) end function CVodeGetNumLinConvFails(cvode_mem, nlcfails) - ccall( - (:CVodeGetNumLinConvFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nlcfails, - ) + ccall((:CVodeGetNumLinConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) end function CVodeGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall( - (:CVodeGetNumJTSetupEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njtsetups, - ) + ccall((:CVodeGetNumJTSetupEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) end function CVodeGetNumJtimesEvals(cvode_mem, njvevals) - ccall( - (:CVodeGetNumJtimesEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njvevals, - ) + ccall((:CVodeGetNumJtimesEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) end function CVodeGetNumLinRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVodeGetNumLinRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVodeGetNumLinRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVodeGetLastLinFlag(cvode_mem, flag) - ccall( - (:CVodeGetLastLinFlag, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVodeGetLastLinFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVodeGetLinReturnFlagName(flag::Clong) @@ -2494,15 +1133,7 @@ function CVodeGetLinReturnFlagName(flag) end function CVodeSetLinearSolverB(cvode_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:CVodeSetLinearSolverB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), - cvode_mem, - which, - LS, - A, - ) + ccall((:CVodeSetLinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNLinearSolver, SUNMatrix), cvode_mem, which, LS, A) end function CVodeSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatrix) @@ -2510,14 +1141,7 @@ function CVodeSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver, A::SUNMatr end function CVodeSetJacFnB(cvode_mem, which::Cint, jacB::CVLsJacFnB) - ccall( - (:CVodeSetJacFnB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsJacFnB), - cvode_mem, - which, - jacB, - ) + ccall((:CVodeSetJacFnB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacFnB), cvode_mem, which, jacB) end function CVodeSetJacFnB(cvode_mem, which, jacB::CVLsJacFnB) @@ -2525,14 +1149,7 @@ function CVodeSetJacFnB(cvode_mem, which, jacB::CVLsJacFnB) end function CVodeSetJacFnBS(cvode_mem, which::Cint, jacBS::CVLsJacFnBS) - ccall( - (:CVodeSetJacFnBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsJacFnBS), - cvode_mem, - which, - jacBS, - ) + ccall((:CVodeSetJacFnBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacFnBS), cvode_mem, which, jacBS) end function CVodeSetJacFnBS(cvode_mem, which, jacBS::CVLsJacFnBS) @@ -2540,133 +1157,47 @@ function CVodeSetJacFnBS(cvode_mem, which, jacBS::CVLsJacFnBS) end function CVodeSetEpsLinB(cvode_mem, which::Cint, eplifacB::realtype) - ccall( - (:CVodeSetEpsLinB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype), - cvode_mem, - which, - eplifacB, - ) + ccall((:CVodeSetEpsLinB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, eplifacB) end function CVodeSetEpsLinB(cvode_mem, which, eplifacB::realtype) CVodeSetEpsLinB(cvode_mem, convert(Cint, which), eplifacB) end -function CVodeSetPreconditionerB( - cvode_mem, - which::Cint, - psetB::CVLsPrecSetupFnB, - psolveB::CVLsPrecSolveFnB, -) - ccall( - (:CVodeSetPreconditionerB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsPrecSetupFnB, CVLsPrecSolveFnB), - cvode_mem, - which, - psetB, - psolveB, - ) -end - -function CVodeSetPreconditionerB( - cvode_mem, - which, - psetB::CVLsPrecSetupFnB, - psolveB::CVLsPrecSolveFnB, -) +function CVodeSetPreconditionerB(cvode_mem, which::Cint, psetB::CVLsPrecSetupFnB, psolveB::CVLsPrecSolveFnB) + ccall((:CVodeSetPreconditionerB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsPrecSetupFnB, CVLsPrecSolveFnB), cvode_mem, which, psetB, psolveB) +end + +function CVodeSetPreconditionerB(cvode_mem, which, psetB::CVLsPrecSetupFnB, psolveB::CVLsPrecSolveFnB) CVodeSetPreconditionerB(cvode_mem, convert(Cint, which), psetB, psolveB) end -function CVodeSetPreconditionerBS( - cvode_mem, - which::Cint, - psetBS::CVLsPrecSetupFnBS, - psolveBS::CVLsPrecSolveFnBS, -) - ccall( - (:CVodeSetPreconditionerBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsPrecSetupFnBS, CVLsPrecSolveFnBS), - cvode_mem, - which, - psetBS, - psolveBS, - ) -end - -function CVodeSetPreconditionerBS( - cvode_mem, - which, - psetBS::CVLsPrecSetupFnBS, - psolveBS::CVLsPrecSolveFnBS, -) +function CVodeSetPreconditionerBS(cvode_mem, which::Cint, psetBS::CVLsPrecSetupFnBS, psolveBS::CVLsPrecSolveFnBS) + ccall((:CVodeSetPreconditionerBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsPrecSetupFnBS, CVLsPrecSolveFnBS), cvode_mem, which, psetBS, psolveBS) +end + +function CVodeSetPreconditionerBS(cvode_mem, which, psetBS::CVLsPrecSetupFnBS, psolveBS::CVLsPrecSolveFnBS) CVodeSetPreconditionerBS(cvode_mem, convert(Cint, which), psetBS, psolveBS) end -function CVodeSetJacTimesB( - cvode_mem, - which::Cint, - jtsetupB::CVLsJacTimesSetupFnB, - jtimesB::CVLsJacTimesVecFnB, -) - ccall( - (:CVodeSetJacTimesB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsJacTimesSetupFnB, CVLsJacTimesVecFnB), - cvode_mem, - which, - jtsetupB, - jtimesB, - ) -end - -function CVodeSetJacTimesB( - cvode_mem, - which, - jtsetupB::CVLsJacTimesSetupFnB, - jtimesB::CVLsJacTimesVecFnB, -) +function CVodeSetJacTimesB(cvode_mem, which::Cint, jtsetupB::CVLsJacTimesSetupFnB, jtimesB::CVLsJacTimesVecFnB) + ccall((:CVodeSetJacTimesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacTimesSetupFnB, CVLsJacTimesVecFnB), cvode_mem, which, jtsetupB, jtimesB) +end + +function CVodeSetJacTimesB(cvode_mem, which, jtsetupB::CVLsJacTimesSetupFnB, jtimesB::CVLsJacTimesVecFnB) CVodeSetJacTimesB(cvode_mem, convert(Cint, which), jtsetupB, jtimesB) end -function CVodeSetJacTimesBS( - cvode_mem, - which::Cint, - jtsetupBS::CVLsJacTimesSetupFnBS, - jtimesBS::CVLsJacTimesVecFnBS, -) - ccall( - (:CVodeSetJacTimesBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsJacTimesSetupFnBS, CVLsJacTimesVecFnBS), - cvode_mem, - which, - jtsetupBS, - jtimesBS, - ) -end - -function CVodeSetJacTimesBS( - cvode_mem, - which, - jtsetupBS::CVLsJacTimesSetupFnBS, - jtimesBS::CVLsJacTimesVecFnBS, -) +function CVodeSetJacTimesBS(cvode_mem, which::Cint, jtsetupBS::CVLsJacTimesSetupFnBS, jtimesBS::CVLsJacTimesVecFnBS) + ccall((:CVodeSetJacTimesBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsJacTimesSetupFnBS, CVLsJacTimesVecFnBS), cvode_mem, which, jtsetupBS, jtimesBS) +end + +function CVodeSetJacTimesBS(cvode_mem, which, jtsetupBS::CVLsJacTimesSetupFnBS, jtimesBS::CVLsJacTimesVecFnBS) CVodeSetJacTimesBS(cvode_mem, convert(Cint, which), jtsetupBS, jtimesBS) end function CVodeSetLinSysFnB(cvode_mem, which::Cint, linsys::CVLsLinSysFnB) - ccall( - (:CVodeSetLinSysFnB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsLinSysFnB), - cvode_mem, - which, - linsys, - ) + ccall((:CVodeSetLinSysFnB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsLinSysFnB), cvode_mem, which, linsys) end function CVodeSetLinSysFnB(cvode_mem, which, linsys::CVLsLinSysFnB) @@ -2674,14 +1205,7 @@ function CVodeSetLinSysFnB(cvode_mem, which, linsys::CVLsLinSysFnB) end function CVodeSetLinSysFnBS(cvode_mem, which::Cint, linsys::CVLsLinSysFnBS) - ccall( - (:CVodeSetLinSysFnBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVLsLinSysFnBS), - cvode_mem, - which, - linsys, - ) + ccall((:CVodeSetLinSysFnBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVLsLinSysFnBS), cvode_mem, which, linsys) end function CVodeSetLinSysFnBS(cvode_mem, which, linsys::CVLsLinSysFnBS) @@ -2690,145 +1214,57 @@ end # Julia wrapper for header: cvodes_spils.h # Automatically generated using Clang.jl + function CVSpilsSetLinearSolver(cvode_mem, LS::SUNLinearSolver) - ccall( - (:CVSpilsSetLinearSolver, libsundials_cvodes), - Cint, - (CVODEMemPtr, SUNLinearSolver), - cvode_mem, - LS, - ) + ccall((:CVSpilsSetLinearSolver, libsundials_cvodes), Cint, (CVODEMemPtr, SUNLinearSolver), cvode_mem, LS) end function CVSpilsSetEpsLin(cvode_mem, eplifac::realtype) - ccall( - (:CVSpilsSetEpsLin, libsundials_cvodes), - Cint, - (CVODEMemPtr, realtype), - cvode_mem, - eplifac, - ) -end - -function CVSpilsSetPreconditioner( - cvode_mem, - pset::CVSpilsPrecSetupFn, - psolve::CVSpilsPrecSolveFn, -) - ccall( - (:CVSpilsSetPreconditioner, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), - cvode_mem, - pset, - psolve, - ) -end - -function CVSpilsSetJacTimes( - cvode_mem, - jtsetup::CVSpilsJacTimesSetupFn, - jtimes::CVSpilsJacTimesVecFn, -) - ccall( - (:CVSpilsSetJacTimes, libsundials_cvodes), - Cint, - (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), - cvode_mem, - jtsetup, - jtimes, - ) + ccall((:CVSpilsSetEpsLin, libsundials_cvodes), Cint, (CVODEMemPtr, realtype), cvode_mem, eplifac) +end + +function CVSpilsSetPreconditioner(cvode_mem, pset::CVSpilsPrecSetupFn, psolve::CVSpilsPrecSolveFn) + ccall((:CVSpilsSetPreconditioner, libsundials_cvodes), Cint, (CVODEMemPtr, CVSpilsPrecSetupFn, CVSpilsPrecSolveFn), cvode_mem, pset, psolve) +end + +function CVSpilsSetJacTimes(cvode_mem, jtsetup::CVSpilsJacTimesSetupFn, jtimes::CVSpilsJacTimesVecFn) + ccall((:CVSpilsSetJacTimes, libsundials_cvodes), Cint, (CVODEMemPtr, CVSpilsJacTimesSetupFn, CVSpilsJacTimesVecFn), cvode_mem, jtsetup, jtimes) end function CVSpilsGetWorkSpace(cvode_mem, lenrwLS, leniwLS) - ccall( - (:CVSpilsGetWorkSpace, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), - cvode_mem, - lenrwLS, - leniwLS, - ) + ccall((:CVSpilsGetWorkSpace, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}, Ptr{Clong}), cvode_mem, lenrwLS, leniwLS) end function CVSpilsGetNumPrecEvals(cvode_mem, npevals) - ccall( - (:CVSpilsGetNumPrecEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npevals, - ) + ccall((:CVSpilsGetNumPrecEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npevals) end function CVSpilsGetNumPrecSolves(cvode_mem, npsolves) - ccall( - (:CVSpilsGetNumPrecSolves, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - npsolves, - ) + ccall((:CVSpilsGetNumPrecSolves, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, npsolves) end function CVSpilsGetNumLinIters(cvode_mem, nliters) - ccall( - (:CVSpilsGetNumLinIters, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nliters, - ) + ccall((:CVSpilsGetNumLinIters, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nliters) end function CVSpilsGetNumConvFails(cvode_mem, nlcfails) - ccall( - (:CVSpilsGetNumConvFails, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nlcfails, - ) + ccall((:CVSpilsGetNumConvFails, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nlcfails) end function CVSpilsGetNumJTSetupEvals(cvode_mem, njtsetups) - ccall( - (:CVSpilsGetNumJTSetupEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njtsetups, - ) + ccall((:CVSpilsGetNumJTSetupEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njtsetups) end function CVSpilsGetNumJtimesEvals(cvode_mem, njvevals) - ccall( - (:CVSpilsGetNumJtimesEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - njvevals, - ) + ccall((:CVSpilsGetNumJtimesEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, njvevals) end function CVSpilsGetNumRhsEvals(cvode_mem, nfevalsLS) - ccall( - (:CVSpilsGetNumRhsEvals, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - nfevalsLS, - ) + ccall((:CVSpilsGetNumRhsEvals, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, nfevalsLS) end function CVSpilsGetLastFlag(cvode_mem, flag) - ccall( - (:CVSpilsGetLastFlag, libsundials_cvodes), - Cint, - (CVODEMemPtr, Ptr{Clong}), - cvode_mem, - flag, - ) + ccall((:CVSpilsGetLastFlag, libsundials_cvodes), Cint, (CVODEMemPtr, Ptr{Clong}), cvode_mem, flag) end function CVSpilsGetReturnFlagName(flag) @@ -2836,14 +1272,7 @@ function CVSpilsGetReturnFlagName(flag) end function CVSpilsSetLinearSolverB(cvode_mem, which::Cint, LS::SUNLinearSolver) - ccall( - (:CVSpilsSetLinearSolverB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, SUNLinearSolver), - cvode_mem, - which, - LS, - ) + ccall((:CVSpilsSetLinearSolverB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, SUNLinearSolver), cvode_mem, which, LS) end function CVSpilsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver) @@ -2851,115 +1280,41 @@ function CVSpilsSetLinearSolverB(cvode_mem, which, LS::SUNLinearSolver) end function CVSpilsSetEpsLinB(cvode_mem, which::Cint, eplifacB::realtype) - ccall( - (:CVSpilsSetEpsLinB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, realtype), - cvode_mem, - which, - eplifacB, - ) + ccall((:CVSpilsSetEpsLinB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, realtype), cvode_mem, which, eplifacB) end function CVSpilsSetEpsLinB(cvode_mem, which, eplifacB::realtype) CVSpilsSetEpsLinB(cvode_mem, convert(Cint, which), eplifacB) end -function CVSpilsSetPreconditionerB( - cvode_mem, - which::Cint, - psetB::CVSpilsPrecSetupFnB, - psolveB::CVSpilsPrecSolveFnB, -) - ccall( - (:CVSpilsSetPreconditionerB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVSpilsPrecSetupFnB, CVSpilsPrecSolveFnB), - cvode_mem, - which, - psetB, - psolveB, - ) +function CVSpilsSetPreconditionerB(cvode_mem, which::Cint, psetB::CVSpilsPrecSetupFnB, psolveB::CVSpilsPrecSolveFnB) + ccall((:CVSpilsSetPreconditionerB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsPrecSetupFnB, CVSpilsPrecSolveFnB), cvode_mem, which, psetB, psolveB) end function CVSpilsSetPreconditionerB(cvode_mem, which, psetB, psolveB) CVSpilsSetPreconditionerB(cvode_mem, convert(Cint, which), psetB, psolveB) end -function CVSpilsSetPreconditionerBS( - cvode_mem, - which::Cint, - psetBS::CVSpilsPrecSetupFnBS, - psolveBS::CVSpilsPrecSolveFnBS, -) - ccall( - (:CVSpilsSetPreconditionerBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVSpilsPrecSetupFnBS, CVSpilsPrecSolveFnBS), - cvode_mem, - which, - psetBS, - psolveBS, - ) -end - -function CVSpilsSetPreconditionerBS( - cvode_mem, - which, - psetBS::CVSpilsPrecSetupFnBS, - psolveBS::CVSpilsPrecSolveFnBS, -) +function CVSpilsSetPreconditionerBS(cvode_mem, which::Cint, psetBS::CVSpilsPrecSetupFnBS, psolveBS::CVSpilsPrecSolveFnBS) + ccall((:CVSpilsSetPreconditionerBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsPrecSetupFnBS, CVSpilsPrecSolveFnBS), cvode_mem, which, psetBS, psolveBS) +end + +function CVSpilsSetPreconditionerBS(cvode_mem, which, psetBS::CVSpilsPrecSetupFnBS, psolveBS::CVSpilsPrecSolveFnBS) CVSpilsSetPreconditionerBS(cvode_mem, convert(Cint, which), psetBS, psolveBS) end -function CVSpilsSetJacTimesB( - cvode_mem, - which::Cint, - jtsetupB::CVSpilsJacTimesSetupFnB, - jtimesB::CVSpilsJacTimesVecFnB, -) - ccall( - (:CVSpilsSetJacTimesB, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnB, CVSpilsJacTimesVecFnB), - cvode_mem, - which, - jtsetupB, - jtimesB, - ) -end - -function CVSpilsSetJacTimesB( - cvode_mem, - which, - jtsetupB::CVSpilsJacTimesSetupFnB, - jtimesB::CVSpilsJacTimesVecFnB, -) +function CVSpilsSetJacTimesB(cvode_mem, which::Cint, jtsetupB::CVSpilsJacTimesSetupFnB, jtimesB::CVSpilsJacTimesVecFnB) + ccall((:CVSpilsSetJacTimesB, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnB, CVSpilsJacTimesVecFnB), cvode_mem, which, jtsetupB, jtimesB) +end + +function CVSpilsSetJacTimesB(cvode_mem, which, jtsetupB::CVSpilsJacTimesSetupFnB, jtimesB::CVSpilsJacTimesVecFnB) CVSpilsSetJacTimesB(cvode_mem, convert(Cint, which), jtsetupB, jtimesB) end -function CVSpilsSetJacTimesBS( - cvode_mem, - which::Cint, - jtsetupBS::CVSpilsJacTimesSetupFnBS, - jtimesBS::CVSpilsJacTimesVecFnBS, -) - ccall( - (:CVSpilsSetJacTimesBS, libsundials_cvodes), - Cint, - (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnBS, CVSpilsJacTimesVecFnBS), - cvode_mem, - which, - jtsetupBS, - jtimesBS, - ) -end - -function CVSpilsSetJacTimesBS( - cvode_mem, - which, - jtsetupBS::CVSpilsJacTimesSetupFnBS, - jtimesBS::CVSpilsJacTimesVecFnBS, -) +function CVSpilsSetJacTimesBS(cvode_mem, which::Cint, jtsetupBS::CVSpilsJacTimesSetupFnBS, jtimesBS::CVSpilsJacTimesVecFnBS) + ccall((:CVSpilsSetJacTimesBS, libsundials_cvodes), Cint, (CVODEMemPtr, Cint, CVSpilsJacTimesSetupFnBS, CVSpilsJacTimesVecFnBS), cvode_mem, which, jtsetupBS, jtimesBS) +end + +function CVSpilsSetJacTimesBS(cvode_mem, which, jtsetupBS::CVSpilsJacTimesSetupFnBS, jtimesBS::CVSpilsJacTimesVecFnBS) CVSpilsSetJacTimesBS(cvode_mem, convert(Cint, which), jtsetupBS, jtimesBS) end diff --git a/src/API/ida.jl b/src/API/ida.jl index 1d0b1640..52f33a03 100644 --- a/src/API/ida.jl +++ b/src/API/ida.jl @@ -1,21 +1,13 @@ # Julia wrapper for header: ida.h # Automatically generated using Clang.jl + function IDACreate() ccall((:IDACreate, libsundials_ida), IDAMemPtr, ()) end function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0::N_Vector, yp0::N_Vector) - ccall( - (:IDAInit, libsundials_ida), - Cint, - (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), - ida_mem, - res, - t0, - yy0, - yp0, - ) + ccall((:IDAInit, libsundials_ida), Cint, (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), ida_mem, res, t0, yy0, yp0) end function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0, yp0) @@ -25,25 +17,11 @@ function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0, yp0) end function IDASStolerances(ida_mem, reltol::realtype, abstol::realtype) - ccall( - (:IDASStolerances, libsundials_ida), - Cint, - (IDAMemPtr, realtype, realtype), - ida_mem, - reltol, - abstol, - ) + ccall((:IDASStolerances, libsundials_ida), Cint, (IDAMemPtr, realtype, realtype), ida_mem, reltol, abstol) end function IDASVtolerances(ida_mem, reltol::realtype, abstol::N_vector) - ccall( - (:IDASVtolerances, libsundials_ida), - Cint, - (IDAMemPtr, realtype, N_Vector), - ida_mem, - reltol, - abstol, - ) + ccall((:IDASVtolerances, libsundials_ida), Cint, (IDAMemPtr, realtype, N_Vector), ida_mem, reltol, abstol) end function IDASVtolerances(ida_mem, reltol::realtype, abstol) @@ -56,28 +34,16 @@ function IDAWFtolerances(ida_mem, efun::IDAEwtFn) end function IDACalcIC(ida_mem, icopt::Cint, tout1::realtype) - ccall( - (:IDACalcIC, libsundials_ida), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - icopt, - tout1, - ) + ccall((:IDACalcIC, libsundials_ida), Cint, (IDAMemPtr, Cint, realtype), ida_mem, icopt, tout1) end function IDACalcIC(ida_mem, icopt, tout1::realtype) IDACalcIC(ida_mem, convert(Cint, icopt), tout1) end + function IDASetNonlinConvCoefIC(ida_mem, epiccon::realtype) - ccall( - (:IDASetNonlinConvCoefIC, libsundials_ida), - Cint, - (IDAMemPtr, realtype), - ida_mem, - epiccon, - ) + ccall((:IDASetNonlinConvCoefIC, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, epiccon) end function IDASetMaxNumStepsIC(ida_mem, maxnh::Cint) @@ -105,13 +71,7 @@ function IDASetMaxNumItersIC(ida_mem, maxnit) end function IDASetLineSearchOffIC(ida_mem, lsoff::Cint) - ccall( - (:IDASetLineSearchOffIC, libsundials_ida), - Cint, - (IDAMemPtr, Cint), - ida_mem, - lsoff, - ) + ccall((:IDASetLineSearchOffIC, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, lsoff) end function IDASetLineSearchOffIC(ida_mem, lsoff) @@ -119,13 +79,7 @@ function IDASetLineSearchOffIC(ida_mem, lsoff) end function IDASetStepToleranceIC(ida_mem, steptol::realtype) - ccall( - (:IDASetStepToleranceIC, libsundials_ida), - Cint, - (IDAMemPtr, realtype), - ida_mem, - steptol, - ) + ccall((:IDASetStepToleranceIC, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, steptol) end function IDASetMaxBacksIC(ida_mem, maxbacks::Cint) @@ -137,14 +91,7 @@ function IDASetMaxBacksIC(ida_mem, maxbacks) end function IDASetErrHandlerFn(ida_mem, ehfun, eh_data) - ccall( - (:IDASetErrHandlerFn, libsundials_ida), - Cint, - (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), - ida_mem, - ehfun, - eh_data, - ) + ccall((:IDASetErrHandlerFn, libsundials_ida), Cint, (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), ida_mem, ehfun, eh_data) end function IDASetErrFile(ida_mem, errfp) @@ -184,23 +131,11 @@ function IDASetStopTime(ida_mem, tstop::realtype) end function IDASetNonlinConvCoef(ida_mem, epcon::realtype) - ccall( - (:IDASetNonlinConvCoef, libsundials_ida), - Cint, - (IDAMemPtr, realtype), - ida_mem, - epcon, - ) + ccall((:IDASetNonlinConvCoef, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, epcon) end function IDASetMaxErrTestFails(ida_mem, maxnef::Cint) - ccall( - (:IDASetMaxErrTestFails, libsundials_ida), - Cint, - (IDAMemPtr, Cint), - ida_mem, - maxnef, - ) + ccall((:IDASetMaxErrTestFails, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, maxnef) end function IDASetMaxErrTestFails(ida_mem, maxnef) @@ -208,17 +143,11 @@ function IDASetMaxErrTestFails(ida_mem, maxnef) end function IDASetMaxNonlinIters(ida_mem, maxcor::Cint) - ccall( - (:IDASetMaxNonlinIters, libsundials_ida), - Cint, - (IDAMemPtr, Cint), - ida_mem, - maxcor, - ) + ccall((:IDASetMaxNonlinIters, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, maxcor) end function IDASetMaxNonlinIters(ida_mem, maxcor) - IDASetMaxNonlinIters(ida_mem, convert(Cint, maxcor)) + IDASetMaxNonlinIters(ida_mem, convert(Cint,maxcor)) end function IDASetMaxConvFails(ida_mem, maxncf::Cint) @@ -230,13 +159,7 @@ function IDASetMaxConvFails(ida_mem, maxncf) end function IDASetSuppressAlg(ida_mem, suppressalg::Cint) - ccall( - (:IDASetSuppressAlg, libsundials_ida), - Cint, - (IDAMemPtr, Cint), - ida_mem, - suppressalg, - ) + ccall((:IDASetSuppressAlg, libsundials_ida), Cint, (IDAMemPtr, Cint), ida_mem, suppressalg) end function IDASetSuppressAlg(ida_mem, suppressalg) @@ -253,13 +176,7 @@ function IDASetId(ida_mem, id) end function IDASetConstraints(ida_mem, constraints::N_Vector) - ccall( - (:IDASetConstraints, libsundials_ida), - Cint, - (IDAMemPtr, N_Vector), - ida_mem, - constraints, - ) + ccall((:IDASetConstraints, libsundials_ida), Cint, (IDAMemPtr, N_Vector), ida_mem, constraints) end function IDASetConstraints(ida_mem, constraints) @@ -268,24 +185,11 @@ function IDASetConstraints(ida_mem, constraints) end function IDASetNonlinearSolver(ida_mem, NLS::SUNNonlinearSolver) - ccall( - (:IDASetNonlinearSolver, libsundials_ida), - Cint, - (IDAMemPtr, SUNNonlinearSolver), - ida_mem, - NLS, - ) + ccall((:IDASetNonlinearSolver, libsundials_ida), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) end function IDARootInit(ida_mem, nrtfn::Cint, g::IDARootFn) - ccall( - (:IDARootInit, libsundials_ida), - Cint, - (IDAMemPtr, Cint, IDARootFn), - ida_mem, - nrtfn, - g, - ) + ccall((:IDARootInit, libsundials_ida), Cint, (IDAMemPtr, Cint, IDARootFn), ida_mem, nrtfn, g) end function IDARootInit(ida_mem, nrtfn, g::IDARootFn) @@ -293,62 +197,25 @@ function IDARootInit(ida_mem, nrtfn, g::IDARootFn) end function IDASetRootDirection(ida_mem, rootdir) - ccall( - (:IDASetRootDirection, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Cint}), - ida_mem, - rootdir, - ) + ccall((:IDASetRootDirection, libsundials_ida), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootdir) end function IDASetNoInactiveRootWarn(ida_mem) ccall((:IDASetNoInactiveRootWarn, libsundials_ida), Cint, (IDAMemPtr,), ida_mem) end -function IDASolve( - ida_mem, - tout::realtype, - tret, - yret::N_Vector, - ypret::N_Vector, - itask::Cint, -) - ccall( - (:IDASolve, libsundials_ida), - Cint, - (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), - ida_mem, - tout, - tret, - yret, - ypret, - itask, - ) +function IDASolve(ida_mem, tout::realtype, tret, yret::N_Vector, ypret::N_Vector, itask::Cint) + ccall((:IDASolve, libsundials_ida), Cint, (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), ida_mem, tout, tret, yret, ypret, itask) end function IDASolve(ida_mem, tout::realtype, tret, yret, ypret, itask) __yret = convert(NVector, yret) __ypret = convert(NVector, ypret) - IDASolve( - ida_mem, - tout::realtype, - tret, - convert(N_Vector, __yret), - convert(N_Vector, __ypret), - convert(Cint, itask), - ) + IDASolve(ida_mem, tout::realtype, tret, convert(N_Vector, __yret), convert(N_Vector, __ypret), convert(Cint, itask)) end function IDAComputeY(ida_mem, ycor::N_Vector, y::N_Vector) - ccall( - (:IDAComputeY, libsundials_ida), - Cint, - (IDAMemPtr, N_Vector, N_Vector), - ida_mem, - ycor, - y, - ) + ccall((:IDAComputeY, libsundials_ida), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, y) end function IDAComputeY(ida_mem, ycor, y) @@ -358,14 +225,7 @@ function IDAComputeY(ida_mem, ycor, y) end function IDAComputeYp(ida_mem, ycor::N_Vector, yp::N_Vector) - ccall( - (:IDAComputeYp, libsundials_ida), - Cint, - (IDAMemPtr, N_Vector, N_Vector), - ida_mem, - ycor, - yp, - ) + ccall((:IDAComputeYp, libsundials_ida), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, yp) end function IDAComputeYp(ida_mem, ycor, yp) @@ -375,15 +235,7 @@ function IDAComputeYp(ida_mem, ycor, yp) end function IDAGetDky(ida_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:IDAGetDky, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint, N_Vector), - ida_mem, - t, - k, - dky, - ) + ccall((:IDAGetDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, N_Vector), ida_mem, t, k, dky) end function IDAGetDky(ida_mem, t, k, dky) @@ -391,76 +243,33 @@ function IDAGetDky(ida_mem, t, k, dky) IDAGetDky(ida_mem, t, convert(Cint, k), convert(N_Vector, __dky)) end + function IDAGetWorkSpace(ida_mem, lenrw, leniw) - ccall( - (:IDAGetWorkSpace, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrw, - leniw, - ) + ccall((:IDAGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrw, leniw) end function IDAGetNumSteps(ida_mem, nsteps) - ccall( - (:IDAGetNumSteps, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nsteps, - ) + ccall((:IDAGetNumSteps, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nsteps) end function IDAGetNumResEvals(ida_mem, nrevals) - ccall( - (:IDAGetNumResEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevals, - ) + ccall((:IDAGetNumResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevals) end function IDAGetNumLinSolvSetups(ida_mem, nlinsetups) - ccall( - (:IDAGetNumLinSolvSetups, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nlinsetups, - ) + ccall((:IDAGetNumLinSolvSetups, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlinsetups) end function IDAGetNumErrTestFails(ida_mem, netfails) - ccall( - (:IDAGetNumErrTestFails, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - netfails, - ) + ccall((:IDAGetNumErrTestFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, netfails) end function IDAGetNumBacktrackOps(ida_mem, nbacktr) - ccall( - (:IDAGetNumBacktrackOps, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nbacktr, - ) + ccall((:IDAGetNumBacktrackOps, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nbacktr) end function IDAGetConsistentIC(ida_mem, yy0_mod::N_Vector, yp0_mod::N_Vector) - ccall( - (:IDAGetConsistentIC, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector, N_Vector), - ida_mem, - yy0_mod, - yp0_mod, - ) + ccall((:IDAGetConsistentIC, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, yy0_mod, yp0_mod) end function IDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) @@ -474,103 +283,43 @@ function IDAGetLastOrder(ida_mem, klast) end function IDAGetCurrentOrder(ida_mem, kcur) - ccall( - (:IDAGetCurrentOrder, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Cint}), - ida_mem, - kcur, - ) + ccall((:IDAGetCurrentOrder, libsundials_ida), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, kcur) end function IDAGetCurrentCj(ida_mem, cj) - ccall( - (:IDAGetCurrentCj, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - cj, - ) + ccall((:IDAGetCurrentCj, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, cj) end function IDAGetCurrentY(ida_mem, ycur) - ccall( - (:IDAGetCurrentY, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{N_Vector}), - ida_mem, - ycur, - ) + ccall((:IDAGetCurrentY, libsundials_ida), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ycur) end function IDAGetCurrentYp(ida_mem, ypcur) - ccall( - (:IDAGetCurrentYp, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{N_Vector}), - ida_mem, - ypcur, - ) + ccall((:IDAGetCurrentYp, libsundials_ida), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ypcur) end function IDAGetActualInitStep(ida_mem, hinused) - ccall( - (:IDAGetActualInitStep, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - hinused, - ) + ccall((:IDAGetActualInitStep, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hinused) end function IDAGetLastStep(ida_mem, hlast) - ccall( - (:IDAGetLastStep, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - hlast, - ) + ccall((:IDAGetLastStep, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hlast) end function IDAGetCurrentStep(ida_mem, hcur) - ccall( - (:IDAGetCurrentStep, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - hcur, - ) + ccall((:IDAGetCurrentStep, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hcur) end function IDAGetCurrentTime(ida_mem, tcur) - ccall( - (:IDAGetCurrentTime, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - tcur, - ) + ccall((:IDAGetCurrentTime, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tcur) end function IDAGetTolScaleFactor(ida_mem, tolsfact) - ccall( - (:IDAGetTolScaleFactor, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - tolsfact, - ) + ccall((:IDAGetTolScaleFactor, libsundials_ida), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tolsfact) end function IDAGetErrWeights(ida_mem, eweight::N_Vector) - ccall( - (:IDAGetErrWeights, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector), - ida_mem, - eweight, - ) + ccall((:IDAGetErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, eweight) end function IDAGetErrWeights(ida_mem, eweight) @@ -579,13 +328,7 @@ function IDAGetErrWeights(ida_mem, eweight) end function IDAGetEstLocalErrors(ida_mem, ele::N_Vector) - ccall( - (:IDAGetEstLocalErrors, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector), - ida_mem, - ele, - ) + ccall((:IDAGetEstLocalErrors, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, ele) end function IDAGetEstLocalErrors(ida_mem, ele) @@ -594,97 +337,27 @@ function IDAGetEstLocalErrors(ida_mem, ele) end function IDAGetNumGEvals(ida_mem, ngevals) - ccall( - (:IDAGetNumGEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - ngevals, - ) + ccall((:IDAGetNumGEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevals) end function IDAGetRootInfo(ida_mem, rootsfound) - ccall( - (:IDAGetRootInfo, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Cint}), - ida_mem, - rootsfound, - ) -end - -function IDAGetIntegratorStats( - ida_mem, - nsteps, - nrevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, -) - ccall( - (:IDAGetIntegratorStats, libsundials_ida), - Cint, - ( - IDAMemPtr, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - ), - ida_mem, - nsteps, - nrevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, - ) + ccall((:IDAGetRootInfo, libsundials_ida), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootsfound) +end + +function IDAGetIntegratorStats(ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall((:IDAGetIntegratorStats, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) end function IDAGetNumNonlinSolvIters(ida_mem, nniters) - ccall( - (:IDAGetNumNonlinSolvIters, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nniters, - ) + ccall((:IDAGetNumNonlinSolvIters, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nniters) end function IDAGetNumNonlinSolvConvFails(ida_mem, nncfails) - ccall( - (:IDAGetNumNonlinSolvConvFails, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nncfails, - ) + ccall((:IDAGetNumNonlinSolvConvFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nncfails) end function IDAGetNonlinSolvStats(ida_mem, nniters, nncfails) - ccall( - (:IDAGetNonlinSolvStats, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - nniters, - nncfails, - ) + ccall((:IDAGetNonlinSolvStats, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nniters, nncfails) end function IDAGetReturnFlagName(flag::Clong) @@ -701,92 +374,28 @@ end # Julia wrapper for header: ida_bbdpre.h # Automatically generated using Clang.jl -function IDABBDPrecInit( - ida_mem, - Nlocal::sunindextype, - mudq::sunindextype, - mldq::sunindextype, - mukeep::sunindextype, - mlkeep::sunindextype, - dq_rel_yy::realtype, - Gres::IDABBDLocalFn, - Gcomm::IDABBDCommFn, -) - ccall( - (:IDABBDPrecInit, libsundials_ida), - Cint, - ( - IDAMemPtr, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - IDABBDLocalFn, - IDABBDCommFn, - ), - ida_mem, - Nlocal, - mudq, - mldq, - mukeep, - mlkeep, - dq_rel_yy, - Gres, - Gcomm, - ) -end - -function IDABBDPrecReInit( - ida_mem, - mudq::sunindextype, - mldq::sunindextype, - dq_rel_yy::realtype, -) - ccall( - (:IDABBDPrecReInit, libsundials_ida), - Cint, - (IDAMemPtr, sunindextype, sunindextype, realtype), - ida_mem, - mudq, - mldq, - dq_rel_yy, - ) + +function IDABBDPrecInit(ida_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dq_rel_yy::realtype, Gres::IDABBDLocalFn, Gcomm::IDABBDCommFn) + ccall((:IDABBDPrecInit, libsundials_ida), Cint, (IDAMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, IDABBDLocalFn, IDABBDCommFn), ida_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_yy, Gres, Gcomm) +end + +function IDABBDPrecReInit(ida_mem, mudq::sunindextype, mldq::sunindextype, dq_rel_yy::realtype) + ccall((:IDABBDPrecReInit, libsundials_ida), Cint, (IDAMemPtr, sunindextype, sunindextype, realtype), ida_mem, mudq, mldq, dq_rel_yy) end function IDABBDPrecGetWorkSpace(ida_mem, lenrwBBDP, leniwBBDP) - ccall( - (:IDABBDPrecGetWorkSpace, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwBBDP, - leniwBBDP, - ) + ccall((:IDABBDPrecGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwBBDP, leniwBBDP) end function IDABBDPrecGetNumGfnEvals(ida_mem, ngevalsBBDP) - ccall( - (:IDABBDPrecGetNumGfnEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - ngevalsBBDP, - ) + ccall((:IDABBDPrecGetNumGfnEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevalsBBDP) end # Julia wrapper for header: ida_direct.h # Automatically generated using Clang.jl + function IDADlsSetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:IDADlsSetLinearSolver, libsundials_idas), - Cint, - (IDAMemPtr, SUNLinearSolver, SUNMatrix), - ida_mem, - LS, - A, - ) + ccall((:IDADlsSetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) end function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) @@ -794,44 +403,19 @@ function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) end function IDADlsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall( - (:IDADlsGetWorkSpace, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwLS, - leniwLS, - ) + ccall((:IDADlsGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) end function IDADlsGetNumJacEvals(ida_mem, njevals) - ccall( - (:IDADlsGetNumJacEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njevals, - ) + ccall((:IDADlsGetNumJacEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) end function IDADlsGetNumResEvals(ida_mem, nrevalsLS) - ccall( - (:IDADlsGetNumResEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevalsLS, - ) + ccall((:IDADlsGetNumResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) end function IDADlsGetLastFlag(ida_mem, flag) - ccall( - (:IDADlsGetLastFlag, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - flag, - ) + ccall((:IDADlsGetLastFlag, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) end function IDADlsGetReturnFlagName(flag) @@ -840,15 +424,9 @@ end # Julia wrapper for header: ida_ls.h # Automatically generated using Clang.jl + function IDASetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:IDASetLinearSolver, libsundials_ida), - Cint, - (IDAMemPtr, SUNLinearSolver, SUNMatrix), - ida_mem, - LS, - A, - ) + ccall((:IDASetLinearSolver, libsundials_ida), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) end function IDASetJacFn(ida_mem, jac::IDADlsJacFn) @@ -856,25 +434,11 @@ function IDASetJacFn(ida_mem, jac::IDADlsJacFn) end function IDASetPreconditioner(ida_mem, pset::IDALsPrecSetupFn, psolve::IDALsPrecSolveFn) - ccall( - (:IDASetPreconditioner, libsundials_ida), - Cint, - (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), - ida_mem, - pset, - psolve, - ) + ccall((:IDASetPreconditioner, libsundials_ida), Cint, (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), ida_mem, pset, psolve) end function IDASetJacTimes(ida_mem, jtsetup::IDALsJacTimesSetupFn, jtimes::IDALsJacTimesVecFn) - ccall( - (:IDASetJacTimes, libsundials_ida), - Cint, - (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), - ida_mem, - jtsetup, - jtimes, - ) + ccall((:IDASetJacTimes, libsundials_ida), Cint, (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), ida_mem, jtsetup, jtimes) end function IDASetEpsLin(ida_mem, eplifac::realtype) @@ -882,114 +446,47 @@ function IDASetEpsLin(ida_mem, eplifac::realtype) end function IDASetIncrementFactor(ida_mem, dqincfac::realtype) - ccall( - (:IDASetIncrementFactor, libsundials_ida), - Cint, - (IDAMemPtr, realtype), - ida_mem, - dqincfac, - ) + ccall((:IDASetIncrementFactor, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) end function IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall( - (:IDAGetLinWorkSpace, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwLS, - leniwLS, - ) + ccall((:IDAGetLinWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) end function IDAGetNumJacEvals(ida_mem, njevals) - ccall( - (:IDAGetNumJacEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njevals, - ) + ccall((:IDAGetNumJacEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) end function IDAGetNumPrecEvals(ida_mem, npevals) - ccall( - (:IDAGetNumPrecEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npevals, - ) + ccall((:IDAGetNumPrecEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) end function IDAGetNumPrecSolves(ida_mem, npsolves) - ccall( - (:IDAGetNumPrecSolves, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npsolves, - ) + ccall((:IDAGetNumPrecSolves, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) end function IDAGetNumLinIters(ida_mem, nliters) - ccall( - (:IDAGetNumLinIters, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nliters, - ) + ccall((:IDAGetNumLinIters, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) end function IDAGetNumLinConvFails(ida_mem, nlcfails) - ccall( - (:IDAGetNumLinConvFails, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nlcfails, - ) + ccall((:IDAGetNumLinConvFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) end function IDAGetNumJTSetupEvals(ida_mem, njtsetups) - ccall( - (:IDAGetNumJTSetupEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njtsetups, - ) + ccall((:IDAGetNumJTSetupEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) end function IDAGetNumJtimesEvals(ida_mem, njvevals) - ccall( - (:IDAGetNumJtimesEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njvevals, - ) + ccall((:IDAGetNumJtimesEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) end function IDAGetNumLinResEvals(ida_mem, nrevalsLS) - ccall( - (:IDAGetNumLinResEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevalsLS, - ) + ccall((:IDAGetNumLinResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) end function IDAGetLastLinFlag(ida_mem, flag) - ccall( - (:IDAGetLastLinFlag, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - flag, - ) + ccall((:IDAGetLastLinFlag, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) end function IDAGetLinReturnFlagName(flag::Clong) @@ -997,161 +494,67 @@ function IDAGetLinReturnFlagName(flag::Clong) end function IDAGetLinReturnFlagName(flag) - IDAGetLinReturnFlagName(convert(Clong, flag)) + IDAGetLinReturnFlagName(convert(Clong,flag)) end # Julia wrapper for header: ida_spils.h # Automatically generated using Clang.jl + function IDASpilsSetLinearSolver(ida_mem, LS::SUNLinearSolver) - ccall( - (:IDASpilsSetLinearSolver, libsundials_ida), - Cint, - (IDAMemPtr, SUNLinearSolver), - ida_mem, - LS, - ) -end - -function IDASpilsSetPreconditioner( - ida_mem, - pset::IDASpilsPrecSetupFn, - psolve::IDASpilsPrecSolveFn, -) - ccall( - (:IDASpilsSetPreconditioner, libsundials_ida), - Cint, - (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), - ida_mem, - pset, - psolve, - ) -end - -function IDASpilsSetJacTimes( - ida_mem, - jtsetup::IDASpilsJacTimesSetupFn, - jtimes::IDASpilsJacTimesVecFn, -) - ccall( - (:IDASpilsSetJacTimes, libsundials_ida), - Cint, - (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), - ida_mem, - jtsetup, - jtimes, - ) + ccall((:IDASpilsSetLinearSolver, libsundials_ida), Cint, (IDAMemPtr, SUNLinearSolver), ida_mem, LS) +end + +function IDASpilsSetPreconditioner(ida_mem, pset::IDASpilsPrecSetupFn, psolve::IDASpilsPrecSolveFn) + ccall((:IDASpilsSetPreconditioner, libsundials_ida), Cint, (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), ida_mem, pset, psolve) +end + +function IDASpilsSetJacTimes(ida_mem, jtsetup::IDASpilsJacTimesSetupFn, jtimes::IDASpilsJacTimesVecFn) + ccall((:IDASpilsSetJacTimes, libsundials_ida), Cint, (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), ida_mem, jtsetup, jtimes) end function IDASpilsSetEpsLin(ida_mem, eplifac::realtype) - ccall( - (:IDASpilsSetEpsLin, libsundials_ida), - Cint, - (IDAMemPtr, realtype), - ida_mem, - eplifac, - ) + ccall((:IDASpilsSetEpsLin, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, eplifac) end function IDASpilsSetIncrementFactor(ida_mem, dqincfac::realtype) - ccall( - (:IDASpilsSetIncrementFactor, libsundials_ida), - Cint, - (IDAMemPtr, realtype), - ida_mem, - dqincfac, - ) + ccall((:IDASpilsSetIncrementFactor, libsundials_ida), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) end function IDASpilsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall( - (:IDASpilsGetWorkSpace, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwLS, - leniwLS, - ) + ccall((:IDASpilsGetWorkSpace, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) end function IDASpilsGetNumPrecEvals(ida_mem, npevals) - ccall( - (:IDASpilsGetNumPrecEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npevals, - ) + ccall((:IDASpilsGetNumPrecEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) end function IDASpilsGetNumPrecSolves(ida_mem, npsolves) - ccall( - (:IDASpilsGetNumPrecSolves, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npsolves, - ) + ccall((:IDASpilsGetNumPrecSolves, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) end function IDASpilsGetNumLinIters(ida_mem, nliters) - ccall( - (:IDASpilsGetNumLinIters, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nliters, - ) + ccall((:IDASpilsGetNumLinIters, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) end function IDASpilsGetNumConvFails(ida_mem, nlcfails) - ccall( - (:IDASpilsGetNumConvFails, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nlcfails, - ) + ccall((:IDASpilsGetNumConvFails, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) end function IDASpilsGetNumJTSetupEvals(ida_mem, njtsetups) - ccall( - (:IDASpilsGetNumJTSetupEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njtsetups, - ) + ccall((:IDASpilsGetNumJTSetupEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) end function IDASpilsGetNumJtimesEvals(ida_mem, njvevals) - ccall( - (:IDASpilsGetNumJtimesEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njvevals, - ) + ccall((:IDASpilsGetNumJtimesEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) end function IDASpilsGetNumResEvals(ida_mem, nrevalsLS) - ccall( - (:IDASpilsGetNumResEvals, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevalsLS, - ) + ccall((:IDASpilsGetNumResEvals, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) end function IDASpilsGetLastFlag(ida_mem, flag) - ccall( - (:IDASpilsGetLastFlag, libsundials_ida), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - flag, - ) + ccall((:IDASpilsGetLastFlag, libsundials_ida), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) end function IDASpilsGetReturnFlagName(flag::Clong) diff --git a/src/API/idas.jl b/src/API/idas.jl index b4267fe3..752e0168 100644 --- a/src/API/idas.jl +++ b/src/API/idas.jl @@ -1,45 +1,23 @@ # Julia wrapper for header: idas.h # Automatically generated using Clang.jl + function IDACreate() ccall((:IDACreate, libsundials_idas), IDAMemPtr, ()) end function IDAInit(ida_mem, res::IDAResFn, t0::realtype, yy0::N_Vector, yp0::N_Vector) - ccall( - (:IDAInit, libsundials_idas), - Cint, - (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), - ida_mem, - res, - t0, - yy0, - yp0, - ) + ccall((:IDAInit, libsundials_idas), Cint, (IDAMemPtr, IDAResFn, realtype, N_Vector, N_Vector), ida_mem, res, t0, yy0, yp0) end function IDAInit(ida_mem, res, t0::realtype, yy0, yp0) __yy0 = convert(NVector, yy0) __yp0 = convert(NVector, yp0) - IDAInit( - ida_mem, - IDAResFn_wrapper(res), - t0, - convert(N_Vector, __yy0), - convert(N_Vector, __yp0), - ) + IDAInit(ida_mem, IDAResFn_wrapper(res), t0, convert(N_Vector, __yy0), convert(N_Vector, __yp0)) end function IDAReInit(ida_mem, t0::realtype, yy0::N_Vector, yp0::N_Vector) - ccall( - (:IDAReInit, libsundials_idas), - Cint, - (IDAMemPtr, realtype, N_Vector, N_Vector), - ida_mem, - t0, - yy0, - yp0, - ) + ccall((:IDAReInit, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector, N_Vector), ida_mem, t0, yy0, yp0) end function IDAReInit(ida_mem, t0, yy0, yp0) @@ -49,25 +27,11 @@ function IDAReInit(ida_mem, t0, yy0, yp0) end function IDASStolerances(ida_mem, reltol::realtype, abstol::realtype) - ccall( - (:IDASStolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, realtype), - ida_mem, - reltol, - abstol, - ) + ccall((:IDASStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, realtype), ida_mem, reltol, abstol) end function IDASVtolerances(ida_mem, reltol::realtype, abstol::N_Vector) - ccall( - (:IDASVtolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, N_Vector), - ida_mem, - reltol, - abstol, - ) + ccall((:IDASVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector), ida_mem, reltol, abstol) end function IDASVtolerances(ida_mem, reltol, abstol) @@ -80,14 +44,7 @@ function IDAWFtolerances(ida_mem, efun::IDAEwtFn) end function IDACalcIC(ida_mem, icopt::Cint, tout1::realtype) - ccall( - (:IDACalcIC, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - icopt, - tout1, - ) + ccall((:IDACalcIC, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, icopt, tout1) end function IDACalcIC(ida_mem, icopt, tout1) @@ -95,13 +52,7 @@ function IDACalcIC(ida_mem, icopt, tout1) end function IDASetNonlinConvCoefIC(ida_mem, epiccon::realtype) - ccall( - (:IDASetNonlinConvCoefIC, libsundials_idas), - Cint, - (IDAMemPtr, realtype), - ida_mem, - epiccon, - ) + ccall((:IDASetNonlinConvCoefIC, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, epiccon) end function IDASetMaxNumStepsIC(ida_mem, maxnh::Cint) @@ -121,13 +72,7 @@ function IDASetMaxNumJacsIC(ida_mem, maxnj) end function IDASetMaxNumItersIC(ida_mem, maxnit::Cint) - ccall( - (:IDASetMaxNumItersIC, libsundials_idas), - Cint, - (IDAMemPtr, Cint), - ida_mem, - maxnit, - ) + ccall((:IDASetMaxNumItersIC, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxnit) end function IDASetMaxNumItersIC(ida_mem, maxnit) @@ -135,13 +80,7 @@ function IDASetMaxNumItersIC(ida_mem, maxnit) end function IDASetLineSearchOffIC(ida_mem, lsoff::Cint) - ccall( - (:IDASetLineSearchOffIC, libsundials_idas), - Cint, - (IDAMemPtr, Cint), - ida_mem, - lsoff, - ) + ccall((:IDASetLineSearchOffIC, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, lsoff) end function IDASetLineSearchOffIC(ida_mem, lsoff) @@ -149,13 +88,7 @@ function IDASetLineSearchOffIC(ida_mem, lsoff) end function IDASetStepToleranceIC(ida_mem, steptol::realtype) - ccall( - (:IDASetStepToleranceIC, libsundials_idas), - Cint, - (IDAMemPtr, realtype), - ida_mem, - steptol, - ) + ccall((:IDASetStepToleranceIC, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, steptol) end function IDASetMaxBacksIC(ida_mem, maxbacks::Cint) @@ -167,14 +100,7 @@ function IDASetMaxBacksIC(ida_mem, maxbacks) end function IDASetErrHandlerFn(ida_mem, ehfun::IDAErrHandlerFn, eh_data) - ccall( - (:IDASetErrHandlerFn, libsundials_idas), - Cint, - (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), - ida_mem, - ehfun, - eh_data, - ) + ccall((:IDASetErrHandlerFn, libsundials_idas), Cint, (IDAMemPtr, IDAErrHandlerFn, Ptr{Cvoid}), ida_mem, ehfun, eh_data) end function IDASetErrFile(ida_mem, errfp) @@ -194,13 +120,7 @@ function IDASetMaxOrd(ida_mem, maxord) end function IDASetMaxNumSteps(ida_mem, mxsteps::Clong) - ccall( - (:IDASetMaxNumSteps, libsundials_idas), - Cint, - (IDAMemPtr, Clong), - ida_mem, - mxsteps, - ) + ccall((:IDASetMaxNumSteps, libsundials_idas), Cint, (IDAMemPtr, Clong), ida_mem, mxsteps) end function IDASetMaxNumSteps(ida_mem, mxsteps) @@ -220,23 +140,11 @@ function IDASetStopTime(ida_mem, tstop::realtype) end function IDASetNonlinConvCoef(ida_mem, epcon::realtype) - ccall( - (:IDASetNonlinConvCoef, libsundials_idas), - Cint, - (IDAMemPtr, realtype), - ida_mem, - epcon, - ) + ccall((:IDASetNonlinConvCoef, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, epcon) end function IDASetMaxErrTestFails(ida_mem, maxnef::Cint) - ccall( - (:IDASetMaxErrTestFails, libsundials_idas), - Cint, - (IDAMemPtr, Cint), - ida_mem, - maxnef, - ) + ccall((:IDASetMaxErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxnef) end function IDASetMaxErrTestFails(ida_mem, maxnef) @@ -244,13 +152,7 @@ function IDASetMaxErrTestFails(ida_mem, maxnef) end function IDASetMaxNonlinIters(ida_mem, maxcor::Cint) - ccall( - (:IDASetMaxNonlinIters, libsundials_idas), - Cint, - (IDAMemPtr, Cint), - ida_mem, - maxcor, - ) + ccall((:IDASetMaxNonlinIters, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxcor) end function IDASetMaxNonlinIters(ida_mem, maxcor) @@ -266,13 +168,7 @@ function IDASetMaxConvFails(ida_mem, maxncf) end function IDASetSuppressAlg(ida_mem, suppressalg::Cint) - ccall( - (:IDASetSuppressAlg, libsundials_idas), - Cint, - (IDAMemPtr, Cint), - ida_mem, - suppressalg, - ) + ccall((:IDASetSuppressAlg, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, suppressalg) end function IDASetSuppressAlg(ida_mem, suppressalg) @@ -289,13 +185,7 @@ function IDASetId(ida_mem, id) end function IDASetConstraints(ida_mem, constraints::N_Vector) - ccall( - (:IDASetConstraints, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector), - ida_mem, - constraints, - ) + ccall((:IDASetConstraints, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, constraints) end function IDASetConstraints(ida_mem, constraints) @@ -304,24 +194,11 @@ function IDASetConstraints(ida_mem, constraints) end function IDASetNonlinearSolver(ida_mem, NLS::SUNNonlinearSolver) - ccall( - (:IDASetNonlinearSolver, libsundials_idas), - Cint, - (IDAMemPtr, SUNNonlinearSolver), - ida_mem, - NLS, - ) + ccall((:IDASetNonlinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) end function IDARootInit(ida_mem, nrtfn::Cint, g::IDARootFn) - ccall( - (:IDARootInit, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDARootFn), - ida_mem, - nrtfn, - g, - ) + ccall((:IDARootInit, libsundials_idas), Cint, (IDAMemPtr, Cint, IDARootFn), ida_mem, nrtfn, g) end function IDARootInit(ida_mem, nrtfn, g) @@ -329,62 +206,25 @@ function IDARootInit(ida_mem, nrtfn, g) end function IDASetRootDirection(ida_mem, rootdir) - ccall( - (:IDASetRootDirection, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Cint}), - ida_mem, - rootdir, - ) + ccall((:IDASetRootDirection, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootdir) end function IDASetNoInactiveRootWarn(ida_mem) ccall((:IDASetNoInactiveRootWarn, libsundials_idas), Cint, (IDAMemPtr,), ida_mem) end -function IDASolve( - ida_mem, - tout::realtype, - tret, - yret::N_Vector, - ypret::N_Vector, - itask::Cint, -) - ccall( - (:IDASolve, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), - ida_mem, - tout, - tret, - yret, - ypret, - itask, - ) +function IDASolve(ida_mem, tout::realtype, tret, yret::N_Vector, ypret::N_Vector, itask::Cint) + ccall((:IDASolve, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint), ida_mem, tout, tret, yret, ypret, itask) end function IDASolve(ida_mem, tout, tret, yret, ypret, itask) __yret = convert(NVector, yret) __ypret = convert(NVector, ypret) - IDASolve( - ida_mem, - tout, - tret, - convert(N_Vector, __yret), - convert(N_Vector, __ypret), - convert(Cint, itask), - ) + IDASolve(ida_mem, tout, tret, convert(N_Vector, __yret), convert(N_Vector, __ypret), convert(Cint, itask)) end function IDAComputeY(ida_mem, ycor::N_Vector, y::N_Vector) - ccall( - (:IDAComputeY, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector, N_Vector), - ida_mem, - ycor, - y, - ) + ccall((:IDAComputeY, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, y) end function IDAComputeY(ida_mem, ycor, y) @@ -394,14 +234,7 @@ function IDAComputeY(ida_mem, ycor, y) end function IDAComputeYp(ida_mem, ycor::N_Vector, y::N_Vector) - ccall( - (:IDAComputeYp, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector, N_Vector), - ida_mem, - ycor, - yp, - ) + ccall((:IDAComputeYp, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, ycor, yp) end function IDAComputeYp(ida_mem, ycor, yp) @@ -411,37 +244,15 @@ function IDAComputeYp(ida_mem, ycor, yp) end function IDAComputeYSens(ida_mem, ycor, yyS) - ccall( - (:IDAComputeYSens, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), - ida_mem, - ycor, - yyS, - ) + ccall((:IDAComputeYSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, ycor, yyS) end function IDAComputeYpSens(ida_mem, ycor, ypS) - ccall( - (:IDAComputeYpSens, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), - ida_mem, - ycor, - ypS, - ) + ccall((:IDAComputeYpSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, ycor, ypS) end function IDAGetDky(ida_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:IDAGetDky, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint, N_Vector), - ida_mem, - t, - k, - dky, - ) + ccall((:IDAGetDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, N_Vector), ida_mem, t, k, dky) end function IDAGetDky(ida_mem, t, k, dky) @@ -450,75 +261,31 @@ function IDAGetDky(ida_mem, t, k, dky) end function IDAGetWorkSpace(ida_mem, lenrw, leniw) - ccall( - (:IDAGetWorkSpace, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrw, - leniw, - ) + ccall((:IDAGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrw, leniw) end function IDAGetNumSteps(ida_mem, nsteps) - ccall( - (:IDAGetNumSteps, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nsteps, - ) + ccall((:IDAGetNumSteps, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nsteps) end function IDAGetNumResEvals(ida_mem, nrevals) - ccall( - (:IDAGetNumResEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevals, - ) + ccall((:IDAGetNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevals) end function IDAGetNumLinSolvSetups(ida_mem, nlinsetups) - ccall( - (:IDAGetNumLinSolvSetups, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nlinsetups, - ) + ccall((:IDAGetNumLinSolvSetups, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlinsetups) end function IDAGetNumErrTestFails(ida_mem, netfails) - ccall( - (:IDAGetNumErrTestFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - netfails, - ) + ccall((:IDAGetNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, netfails) end function IDAGetNumBacktrackOps(ida_mem, nbacktr) - ccall( - (:IDAGetNumBacktrackOps, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nbacktr, - ) + ccall((:IDAGetNumBacktrackOps, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nbacktr) end function IDAGetConsistentIC(ida_mem, yy0_mod::N_Vector, yp0_mod::N_Vector) - ccall( - (:IDAGetConsistentIC, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector, N_Vector), - ida_mem, - yy0_mod, - yp0_mod, - ) + ccall((:IDAGetConsistentIC, libsundials_idas), Cint, (IDAMemPtr, N_Vector, N_Vector), ida_mem, yy0_mod, yp0_mod) end function IDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) @@ -528,133 +295,55 @@ function IDAGetConsistentIC(ida_mem, yy0_mod, yp0_mod) end function IDAGetLastOrder(ida_mem, klast) - ccall( - (:IDAGetLastOrder, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Cint}), - ida_mem, - klast, - ) + ccall((:IDAGetLastOrder, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, klast) end function IDAGetCurrentOrder(ida_mem, kcur) - ccall( - (:IDAGetCurrentOrder, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Cint}), - ida_mem, - kcur, - ) + ccall((:IDAGetCurrentOrder, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, kcur) end function IDAGetCurrentCj(ida_mem, cj) - ccall( - (:IDAGetCurrentCj, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - cj, - ) + ccall((:IDAGetCurrentCj, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, cj) end function IDAGetCurrentY(ida_mem, ycur) - ccall( - (:IDAGetCurrentY, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{N_Vector}), - ida_mem, - ycur, - ) + ccall((:IDAGetCurrentY, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ycur) end function IDAGetCurrentYSens(ida_mem, yS) - ccall( - (:IDAGetCurrentYSens, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Ptr{N_Vector}}), - ida_mem, - yS, - ) + ccall((:IDAGetCurrentYSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{Ptr{N_Vector}}), ida_mem, yS) end function IDAGetCurrentYp(ida_mem, ypcur) - ccall( - (:IDAGetCurrentYp, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{N_Vector}), - ida_mem, - ypcur, - ) + ccall((:IDAGetCurrentYp, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, ypcur) end function IDAGetCurrentYpSens(ida_mem, ypS) - ccall( - (:IDAGetCurrentYpSens, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Ptr{N_Vector}}), - ida_mem, - ypS, - ) + ccall((:IDAGetCurrentYpSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{Ptr{N_Vector}}), ida_mem, ypS) end function IDAGetActualInitStep(ida_mem, hinused) - ccall( - (:IDAGetActualInitStep, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - hinused, - ) + ccall((:IDAGetActualInitStep, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hinused) end function IDAGetLastStep(ida_mem, hlast) - ccall( - (:IDAGetLastStep, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - hlast, - ) + ccall((:IDAGetLastStep, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hlast) end function IDAGetCurrentStep(ida_mem, hcur) - ccall( - (:IDAGetCurrentStep, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - hcur, - ) + ccall((:IDAGetCurrentStep, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, hcur) end function IDAGetCurrentTime(ida_mem, tcur) - ccall( - (:IDAGetCurrentTime, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - tcur, - ) + ccall((:IDAGetCurrentTime, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tcur) end function IDAGetTolScaleFactor(ida_mem, tolsfact) - ccall( - (:IDAGetTolScaleFactor, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}), - ida_mem, - tolsfact, - ) + ccall((:IDAGetTolScaleFactor, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}), ida_mem, tolsfact) end function IDAGetErrWeights(ida_mem, eweight::N_Vector) - ccall( - (:IDAGetErrWeights, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector), - ida_mem, - eweight, - ) + ccall((:IDAGetErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, eweight) end function IDAGetErrWeights(ida_mem, eweight) @@ -663,13 +352,7 @@ function IDAGetErrWeights(ida_mem, eweight) end function IDAGetEstLocalErrors(ida_mem, ele::N_Vector) - ccall( - (:IDAGetEstLocalErrors, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector), - ida_mem, - ele, - ) + ccall((:IDAGetEstLocalErrors, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, ele) end function IDAGetEstLocalErrors(ida_mem, ele) @@ -678,97 +361,27 @@ function IDAGetEstLocalErrors(ida_mem, ele) end function IDAGetNumGEvals(ida_mem, ngevals) - ccall( - (:IDAGetNumGEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - ngevals, - ) + ccall((:IDAGetNumGEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevals) end function IDAGetRootInfo(ida_mem, rootsfound) - ccall( - (:IDAGetRootInfo, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Cint}), - ida_mem, - rootsfound, - ) -end - -function IDAGetIntegratorStats( - ida_mem, - nsteps, - nrevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, -) - ccall( - (:IDAGetIntegratorStats, libsundials_idas), - Cint, - ( - IDAMemPtr, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Clong}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - Ptr{realtype}, - ), - ida_mem, - nsteps, - nrevals, - nlinsetups, - netfails, - qlast, - qcur, - hinused, - hlast, - hcur, - tcur, - ) + ccall((:IDAGetRootInfo, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, rootsfound) +end + +function IDAGetIntegratorStats(ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) + ccall((:IDAGetIntegratorStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Cint}, Ptr{Cint}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}, Ptr{realtype}), ida_mem, nsteps, nrevals, nlinsetups, netfails, qlast, qcur, hinused, hlast, hcur, tcur) end function IDAGetNumNonlinSolvIters(ida_mem, nniters) - ccall( - (:IDAGetNumNonlinSolvIters, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nniters, - ) + ccall((:IDAGetNumNonlinSolvIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nniters) end function IDAGetNumNonlinSolvConvFails(ida_mem, nncfails) - ccall( - (:IDAGetNumNonlinSolvConvFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nncfails, - ) + ccall((:IDAGetNumNonlinSolvConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nncfails) end function IDAGetNonlinSolvStats(ida_mem, nniters, nncfails) - ccall( - (:IDAGetNonlinSolvStats, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - nniters, - nncfails, - ) + ccall((:IDAGetNonlinSolvStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nniters, nncfails) end function IDAGetReturnFlagName(flag::Clong) @@ -784,14 +397,7 @@ function IDAFree(ida_mem) end function IDAQuadInit(ida_mem, rhsQ::IDAQuadRhsFn, yQ0::N_Vector) - ccall( - (:IDAQuadInit, libsundials_idas), - Cint, - (IDAMemPtr, IDAQuadRhsFn, N_Vector), - ida_mem, - rhsQ, - yQ0, - ) + ccall((:IDAQuadInit, libsundials_idas), Cint, (IDAMemPtr, IDAQuadRhsFn, N_Vector), ida_mem, rhsQ, yQ0) end function IDAQuadInit(ida_mem, rhsQ, yQ0) @@ -809,25 +415,11 @@ function IDAQuadReInit(ida_mem, yQ0) end function IDAQuadSStolerances(ida_mem, reltolQ::realtype, abstolQ::realtype) - ccall( - (:IDAQuadSStolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, realtype), - ida_mem, - reltolQ, - abstolQ, - ) + ccall((:IDAQuadSStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, realtype), ida_mem, reltolQ, abstolQ) end function IDAQuadSVtolerances(ida_mem, reltolQ::realtype, abstolQ::N_Vector) - ccall( - (:IDAQuadSVtolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, N_Vector), - ida_mem, - reltolQ, - abstolQ, - ) + ccall((:IDAQuadSVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector), ida_mem, reltolQ, abstolQ) end function IDAQuadSVtolerances(ida_mem, reltolQ, abstolQ) @@ -844,14 +436,7 @@ function IDASetQuadErrCon(ida_mem, errconQ) end function IDAGetQuad(ida_mem, t, yQout::N_Vector) - ccall( - (:IDAGetQuad, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}, N_Vector), - ida_mem, - t, - yQout, - ) + ccall((:IDAGetQuad, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, N_Vector), ida_mem, t, yQout) end function IDAGetQuad(ida_mem, t, yQout) @@ -860,15 +445,7 @@ function IDAGetQuad(ida_mem, t, yQout) end function IDAGetQuadDky(ida_mem, t::realtype, k::Cint, dky::N_Vector) - ccall( - (:IDAGetQuadDky, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint, N_Vector), - ida_mem, - t, - k, - dky, - ) + ccall((:IDAGetQuadDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, N_Vector), ida_mem, t, k, dky) end function IDAGetQuadDky(ida_mem, t, k, dky) @@ -877,33 +454,15 @@ function IDAGetQuadDky(ida_mem, t, k, dky) end function IDAGetQuadNumRhsEvals(ida_mem, nrhsQevals) - ccall( - (:IDAGetQuadNumRhsEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrhsQevals, - ) + ccall((:IDAGetQuadNumRhsEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrhsQevals) end function IDAGetQuadNumErrTestFails(ida_mem, nQetfails) - ccall( - (:IDAGetQuadNumErrTestFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nQetfails, - ) + ccall((:IDAGetQuadNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nQetfails) end function IDAGetQuadErrWeights(ida_mem, eQweight::N_Vector) - ccall( - (:IDAGetQuadErrWeights, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector), - ida_mem, - eQweight, - ) + ccall((:IDAGetQuadErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector), ida_mem, eQweight) end function IDAGetQuadErrWeights(ida_mem, eQweight) @@ -912,32 +471,15 @@ function IDAGetQuadErrWeights(ida_mem, eQweight) end function IDAGetQuadStats(ida_mem, nrhsQevals, nQetfails) - ccall( - (:IDAGetQuadStats, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - nrhsQevals, - nQetfails, - ) + ccall((:IDAGetQuadStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nrhsQevals, nQetfails) end function IDAQuadFree(ida_mem) ccall((:IDAQuadFree, libsundials_idas), Cvoid, (IDAMemPtr,), ida_mem) end -function IDASensInit(ida_mem, Ns::Cint, ism::Cint, resS::IDASensResFn, yS0, ypS0) - ccall( - (:IDASensInit, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Cint, IDASensResFn, Ptr{N_Vector}, Ptr{N_Vector}), - ida_mem, - Ns, - ism, - resS, - yS0, - ypS0, - ) +function IDASensInit(ida_mem,Ns::Cint, ism::Cint, resS::IDASensResFn, yS0, ypS0) + ccall((:IDASensInit, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint, IDASensResFn, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, Ns, ism, resS, yS0, ypS0) end function IDASensInit(ida_mem, Ns, ism, resS, yS0, ypS0) @@ -945,15 +487,7 @@ function IDASensInit(ida_mem, Ns, ism, resS, yS0, ypS0) end function IDASensReInit(ida_mem, ism::Cint, yS0, ypS0) - ccall( - (:IDASensReInit, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Ptr{N_Vector}, Ptr{N_Vector}), - ida_mem, - ism, - yS0, - ypS0, - ) + ccall((:IDASensReInit, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, ism, yS0, ypS0) end function IDASensReInit(ida_mem, ism, yS0, ypS0) @@ -961,25 +495,11 @@ function IDASensReInit(ida_mem, ism, yS0, ypS0) end function IDASensSStolerances(ida_mem, reltolS::realtype, abstolS) - ccall( - (:IDASensSStolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Ptr{realtype}), - ida_mem, - reltolS, - abstolS, - ) + ccall((:IDASensSStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}), ida_mem, reltolS, abstolS) end function IDASensSVtolerances(ida_mem, reltolS::realtype, abstolS) - ccall( - (:IDASensSVtolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Ptr{N_Vector}), - ida_mem, - reltolS, - abstolS, - ) + ccall((:IDASensSVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{N_Vector}), ida_mem, reltolS, abstolS) end function IDASensEEtolerances(ida_mem) @@ -987,25 +507,11 @@ function IDASensEEtolerances(ida_mem) end function IDAGetSensConsistentIC(ida_mem, yyS0, ypS0) - ccall( - (:IDAGetSensConsistentIC, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), - ida_mem, - yyS0, - ypS0, - ) + ccall((:IDAGetSensConsistentIC, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, yyS0, ypS0) end function IDASetSensDQMethod(ida_mem, DQtype::Cint, DQrhomax::realtype) - ccall( - (:IDASetSensDQMethod, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - DQtype, - DQrhomax, - ) + ccall((:IDASetSensDQMethod, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, DQtype, DQrhomax) end function IDASetSensDQMethod(ida_mem, DQtype, DQrhomax) @@ -1021,13 +527,7 @@ function IDASetSensErrCon(ida_mem, errconS) end function IDASetSensMaxNonlinIters(ida_mem, maxcorS::Cint) - ccall( - (:IDASetSensMaxNonlinIters, libsundials_idas), - Cint, - (IDAMemPtr, Cint), - ida_mem, - maxcorS, - ) + ccall((:IDASetSensMaxNonlinIters, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, maxcorS) end function IDASetSensMaxNonlinIters(ida_mem, maxcorS) @@ -1035,35 +535,15 @@ function IDASetSensMaxNonlinIters(ida_mem, maxcorS) end function IDASetSensParams(ida_mem, p, pbar, plist) - ccall( - (:IDASetSensParams, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), - ida_mem, - p, - pbar, - plist, - ) + ccall((:IDASetSensParams, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Ptr{realtype}, Ptr{Cint}), ida_mem, p, pbar, plist) end function IDASetNonlinearSolverSensSim(ida_mem, NLS::SUNNonlinearSolver) - ccall( - (:IDASetNonlinearSolverSensSim, libsundials_idas), - Cint, - (IDAMemPtr, SUNNonlinearSolver), - ida_mem, - NLS, - ) + ccall((:IDASetNonlinearSolverSensSim, libsundials_idas), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) end function IDASetNonlinearSolverSensStg(ida_mem, NLS::SUNNonlinearSolver) - ccall( - (:IDASetNonlinearSolverSensStg, libsundials_idas), - Cint, - (IDAMemPtr, SUNNonlinearSolver), - ida_mem, - NLS, - ) + ccall((:IDASetNonlinearSolverSensStg, libsundials_idas), Cint, (IDAMemPtr, SUNNonlinearSolver), ida_mem, NLS) end function IDASensToggleOff(ida_mem) @@ -1071,26 +551,11 @@ function IDASensToggleOff(ida_mem) end function IDAGetSens(ida_mem, tret, yySout) - ccall( - (:IDAGetSens, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), - ida_mem, - tret, - yySout, - ) + ccall((:IDAGetSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), ida_mem, tret, yySout) end function IDAGetSens1(ida_mem, tret, is::Cint, yySret::N_Vector) - ccall( - (:IDAGetSens1, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), - ida_mem, - tret, - is, - yySret, - ) + ccall((:IDAGetSens1, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), ida_mem, tret, is, yySret) end function IDAGetSens1(ida_mem, tret, is, yySret) @@ -1099,15 +564,7 @@ function IDAGetSens1(ida_mem, tret, is, yySret) end function IDAGetSensDky(ida_mem, t::realtype, k::Cint, dkyS) - ccall( - (:IDAGetSensDky, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), - ida_mem, - t, - k, - dkyS, - ) + ccall((:IDAGetSensDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), ida_mem, t, k, dkyS) end function IDAGetSensDky(ida_mem, t, k, dkyS) @@ -1115,121 +572,48 @@ function IDAGetSensDky(ida_mem, t, k, dkyS) end function IDAGetSensDky1(ida_mem, t::realtype, k::Cint, is::Cint, dkyS::N_Vector) - ccall( - (:IDAGetSensDky1, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint, Cint, N_Vector), - ida_mem, - t, - k, - is, - dkyS, - ) + ccall((:IDAGetSensDky1, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Cint, N_Vector), ida_mem, t, k, is, dkyS) end function IDAGetSensDky1(ida_mem, t, k, is, dkyS) __dkyS = convert(NVector, dkyS) - IDAGetSensDky1( - ida_mem, - t, - convert(Cint, k), - convert(Cint, is), - convert(N_Vector, __dkyS), - ) + IDAGetSensDky1(ida_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dkyS)) end function IDAGetSensNumResEvals(ida_mem, nresSevals) - ccall( - (:IDAGetSensNumResEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nresSevals, - ) + ccall((:IDAGetSensNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nresSevals) end function IDAGetNumResEvalsSens(ida_mem, nresevalsS) - ccall( - (:IDAGetNumResEvalsSens, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nresevalsS, - ) + ccall((:IDAGetNumResEvalsSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nresevalsS) end function IDAGetSensNumErrTestFails(ida_mem, nSetfails) - ccall( - (:IDAGetSensNumErrTestFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nSetfails, - ) + ccall((:IDAGetSensNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nSetfails) end function IDAGetSensNumLinSolvSetups(ida_mem, nlinsetupsS) - ccall( - (:IDAGetSensNumLinSolvSetups, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nlinsetupsS, - ) + ccall((:IDAGetSensNumLinSolvSetups, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlinsetupsS) end function IDAGetSensErrWeights(ida_mem, eSweight::N_Vector_S) - ccall( - (:IDAGetSensErrWeights, libsundials_idas), - Cint, - (IDAMemPtr, N_Vector_S), - ida_mem, - eSweight, - ) + ccall((:IDAGetSensErrWeights, libsundials_idas), Cint, (IDAMemPtr, N_Vector_S), ida_mem, eSweight) end function IDAGetSensStats(ida_mem, nresSevals, nresevalsS, nSetfails, nlinsetupsS) - ccall( - (:IDAGetSensStats, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), - ida_mem, - nresSevals, - nresevalsS, - nSetfails, - nlinsetupsS, - ) + ccall((:IDAGetSensStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}, Ptr{Clong}), ida_mem, nresSevals, nresevalsS, nSetfails, nlinsetupsS) end function IDAGetSensNumNonlinSolvIters(ida_mem, nSniters) - ccall( - (:IDAGetSensNumNonlinSolvIters, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nSniters, - ) + ccall((:IDAGetSensNumNonlinSolvIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nSniters) end function IDAGetSensNumNonlinSolvConvFails(ida_mem, nSncfails) - ccall( - (:IDAGetSensNumNonlinSolvConvFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nSncfails, - ) + ccall((:IDAGetSensNumNonlinSolvConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nSncfails) end function IDAGetSensNonlinSolvStats(ida_mem, nSniters, nSncfails) - ccall( - (:IDAGetSensNonlinSolvStats, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - nSniters, - nSncfails, - ) + ccall((:IDAGetSensNonlinSolvStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nSniters, nSncfails) end function IDASensFree(ida_mem) @@ -1237,46 +621,19 @@ function IDASensFree(ida_mem) end function IDAQuadSensInit(ida_mem, resQS::IDAQuadSensRhsFn, yQS0) - ccall( - (:IDAQuadSensInit, libsundials_idas), - Cint, - (IDAMemPtr, IDAQuadSensRhsFn, Ptr{N_Vector}), - ida_mem, - resQS, - yQS0, - ) + ccall((:IDAQuadSensInit, libsundials_idas), Cint, (IDAMemPtr, IDAQuadSensRhsFn, Ptr{N_Vector}), ida_mem, resQS, yQS0) end function IDAQuadSensReInit(ida_mem, yQS0) - ccall( - (:IDAQuadSensReInit, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{N_Vector}), - ida_mem, - yQS0, - ) + ccall((:IDAQuadSensReInit, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, yQS0) end function IDAQuadSensSStolerances(ida_mem, reltolQS::realtype, abstolQS) - ccall( - (:IDAQuadSensSStolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Ptr{realtype}), - ida_mem, - reltolQS, - abstolQS, - ) + ccall((:IDAQuadSensSStolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}), ida_mem, reltolQS, abstolQS) end function IDAQuadSensSVtolerances(ida_mem, reltolQS::realtype, abstolQS) - ccall( - (:IDAQuadSensSVtolerances, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Ptr{N_Vector}), - ida_mem, - reltolQS, - abstolQS, - ) + ccall((:IDAQuadSensSVtolerances, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{N_Vector}), ida_mem, reltolQS, abstolQS) end function IDAQuadSensEEtolerances(ida_mem) @@ -1284,13 +641,7 @@ function IDAQuadSensEEtolerances(ida_mem) end function IDASetQuadSensErrCon(ida_mem, errconQS::Cint) - ccall( - (:IDASetQuadSensErrCon, libsundials_idas), - Cint, - (IDAMemPtr, Cint), - ida_mem, - errconQS, - ) + ccall((:IDASetQuadSensErrCon, libsundials_idas), Cint, (IDAMemPtr, Cint), ida_mem, errconQS) end function IDASetQuadSensErrCon(ida_mem, errconQS) @@ -1298,26 +649,11 @@ function IDASetQuadSensErrCon(ida_mem, errconQS) end function IDAGetQuadSens(ida_mem, tret, yyQSout) - ccall( - (:IDAGetQuadSens, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), - ida_mem, - tret, - yyQSout, - ) + ccall((:IDAGetQuadSens, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Ptr{N_Vector}), ida_mem, tret, yyQSout) end function IDAGetQuadSens1(ida_mem, tret, is::Cint, yyQSret::N_Vector) - ccall( - (:IDAGetQuadSens1, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), - ida_mem, - tret, - is, - yyQSret, - ) + ccall((:IDAGetQuadSens1, libsundials_idas), Cint, (IDAMemPtr, Ptr{realtype}, Cint, N_Vector), ida_mem, tret, is, yyQSret) end function IDAGetQuadSens1(ida_mem, tret, is, yyQSret) @@ -1326,15 +662,7 @@ function IDAGetQuadSens1(ida_mem, tret, is, yyQSret) end function IDAGetQuadSensDky(ida_mem, t::realtype, k::Cint, dkyQS) - ccall( - (:IDAGetQuadSensDky, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), - ida_mem, - t, - k, - dkyQS, - ) + ccall((:IDAGetQuadSensDky, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Ptr{N_Vector}), ida_mem, t, k, dkyQS) end function IDAGetQuadSensDky(ida_mem, t, k, dkyQS) @@ -1342,68 +670,28 @@ function IDAGetQuadSensDky(ida_mem, t, k, dkyQS) end function IDAGetQuadSensDky1(ida_mem, t::realtype, k::Cint, is::Cint, dkyQS::N_Vector) - ccall( - (:IDAGetQuadSensDky1, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint, Cint, N_Vector), - ida_mem, - t, - k, - is, - dkyQS, - ) + ccall((:IDAGetQuadSensDky1, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint, Cint, N_Vector), ida_mem, t, k, is, dkyQS) end function IDAGetQuadSensDky1(ida_mem, t, k, is, dkyQS) __dkyQS = convert(NVector, dkyQS) - IDAGetQuadSensDky1( - ida_mem, - t, - convert(Cint, k), - convert(Cint, is), - convert(N_Vector, __dkyQS), - ) + IDAGetQuadSensDky1(ida_mem, t, convert(Cint, k), convert(Cint, is), convert(N_Vector, __dkyQS)) end function IDAGetQuadSensNumRhsEvals(ida_mem, nrhsQSevals) - ccall( - (:IDAGetQuadSensNumRhsEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrhsQSevals, - ) + ccall((:IDAGetQuadSensNumRhsEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrhsQSevals) end function IDAGetQuadSensNumErrTestFails(ida_mem, nQSetfails) - ccall( - (:IDAGetQuadSensNumErrTestFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nQSetfails, - ) + ccall((:IDAGetQuadSensNumErrTestFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nQSetfails) end function IDAGetQuadSensErrWeights(ida_mem, eQSweight) - ccall( - (:IDAGetQuadSensErrWeights, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{N_Vector}), - ida_mem, - eQSweight, - ) + ccall((:IDAGetQuadSensErrWeights, libsundials_idas), Cint, (IDAMemPtr, Ptr{N_Vector}), ida_mem, eQSweight) end function IDAGetQuadSensStats(ida_mem, nrhsQSevals, nQSetfails) - ccall( - (:IDAGetQuadSensStats, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - nrhsQSevals, - nQSetfails, - ) + ccall((:IDAGetQuadSensStats, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, nrhsQSevals, nQSetfails) end function IDAQuadSensFree(ida_mem) @@ -1411,14 +699,7 @@ function IDAQuadSensFree(ida_mem) end function IDAAdjInit(ida_mem, steps::Clong, interp::Cint) - ccall( - (:IDAAdjInit, libsundials_idas), - Cint, - (IDAMemPtr, Clong, Cint), - ida_mem, - steps, - interp, - ) + ccall((:IDAAdjInit, libsundials_idas), Cint, (IDAMemPtr, Clong, Cint), ida_mem, steps, interp) end function IDAAdjInit(ida_mem, steps, interp) @@ -1437,109 +718,38 @@ function IDACreateB(ida_mem, which) ccall((:IDACreateB, libsundials_idas), Cint, (IDAMemPtr, Ptr{Cint}), ida_mem, which) end -function IDAInitB( - ida_mem, - which::Cint, - resB::IDAResFnB, - tB0::realtype, - yyB0::N_Vector, - ypB0::N_Vector, -) - ccall( - (:IDAInitB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDAResFnB, realtype, N_Vector, N_Vector), - ida_mem, - which, - resB, - tB0, - yyB0, - ypB0, - ) +function IDAInitB(ida_mem, which::Cint, resB::IDAResFnB, tB0::realtype, yyB0::N_Vector, ypB0::N_Vector) + ccall((:IDAInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAResFnB, realtype, N_Vector, N_Vector), ida_mem, which, resB, tB0, yyB0, ypB0) end function IDAInitB(ida_mem, which, resB, tB0, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAInitB( - ida_mem, - convert(Cint, which), - resB, - tB0, - convert(N_Vector, __yyB0), - convert(N_Vector, __ypB0), - ) -end - -function IDAInitBS( - ida_mem, - which::Cint, - resS::IDAResFnBS, - tB0::realtype, - yyB0::N_Vector, - ypB0::N_Vector, -) - ccall( - (:IDAInitBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDAResFnBS, realtype, N_Vector, N_Vector), - ida_mem, - which, - resS, - tB0, - yyB0, - ypB0, - ) + IDAInitB(ida_mem, convert(Cint, which), resB, tB0, convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) +end + +function IDAInitBS(ida_mem, which::Cint, resS::IDAResFnBS, tB0::realtype, yyB0::N_Vector, ypB0::N_Vector) + ccall((:IDAInitBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAResFnBS, realtype, N_Vector, N_Vector), ida_mem, which, resS, tB0, yyB0, ypB0) end function IDAInitBS(ida_mem, which, resS, tB0, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAInitBS( - ida_mem, - convert(Cint, which), - resS, - tB0, - convert(N_Vector, __yyB0), - convert(N_Vector, __ypB0), - ) + IDAInitBS(ida_mem, convert(Cint, which), resS, tB0, convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) end function IDAReInitB(ida_mem, which::Cint, tB0::realtype, yyB0::N_Vector, ypB0::N_Vector) - ccall( - (:IDAReInitB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), - ida_mem, - which, - tB0, - yyB0, - ypB0, - ) + ccall((:IDAReInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), ida_mem, which, tB0, yyB0, ypB0) end function IDAReInitB(ida_mem, which, tB0, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAReInitB( - ida_mem, - convert(Cint, which), - tB0, - convert(N_Vector, __yyB0), - convert(N_Vector, __ypB0), - ) + IDAReInitB(ida_mem, convert(Cint, which), tB0, convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) end function IDASStolerancesB(ida_mem, which::Cint, relTolB::realtype, absTolB::realtype) - ccall( - (:IDASStolerancesB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype, realtype), - ida_mem, - which, - relTolB, - absTolB, - ) + ccall((:IDASStolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, realtype), ida_mem, which, relTolB, absTolB) end function IDASStolerancesB(ida_mem, which, relTolB, absTolB) @@ -1547,15 +757,7 @@ function IDASStolerancesB(ida_mem, which, relTolB, absTolB) end function IDASVtolerancesB(ida_mem, which::Cint, relTolB::realtype, absTolB::N_Vector) - ccall( - (:IDASVtolerancesB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype, N_Vector), - ida_mem, - which, - relTolB, - absTolB, - ) + ccall((:IDASVtolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector), ida_mem, which, relTolB, absTolB) end function IDASVtolerancesB(ida_mem, which, relTolB, absTolB) @@ -1564,15 +766,7 @@ function IDASVtolerancesB(ida_mem, which, relTolB, absTolB) end function IDAQuadInitB(ida_mem, which::Cint, rhsQB::IDAQuadRhsFnB, yQB0::N_Vector) - ccall( - (:IDAQuadInitB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDAQuadRhsFnB, N_Vector), - ida_mem, - which, - rhsQB, - yQB0, - ) + ccall((:IDAQuadInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAQuadRhsFnB, N_Vector), ida_mem, which, rhsQB, yQB0) end function IDAQuadInitB(ida_mem, which, rhsQB, yQB0) @@ -1581,15 +775,7 @@ function IDAQuadInitB(ida_mem, which, rhsQB, yQB0) end function IDAQuadInitBS(ida_mem, which::Cint, rhsQS::IDAQuadRhsFnBS, yQB0::N_Vector) - ccall( - (:IDAQuadInitBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDAQuadRhsFnBS, N_Vector), - ida_mem, - which, - rhsQS, - yQB0, - ) + ccall((:IDAQuadInitBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDAQuadRhsFnBS, N_Vector), ida_mem, which, rhsQS, yQB0) end function IDAQuadInitBS(ida_mem, which, rhsQS, yQB0) @@ -1598,14 +784,7 @@ function IDAQuadInitBS(ida_mem, which, rhsQS, yQB0) end function IDAQuadReInitB(ida_mem, which::Cint, yQB0::N_Vector) - ccall( - (:IDAQuadReInitB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, N_Vector), - ida_mem, - which, - yQB0, - ) + ccall((:IDAQuadReInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector), ida_mem, which, yQB0) end function IDAQuadReInitB(ida_mem, which, yQB0) @@ -1614,15 +793,7 @@ function IDAQuadReInitB(ida_mem, which, yQB0) end function IDAQuadSStolerancesB(ida_mem, which::Cint, reltolQB::realtype, abstolQB::realtype) - ccall( - (:IDAQuadSStolerancesB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype, realtype), - ida_mem, - which, - reltolQB, - abstolQB, - ) + ccall((:IDAQuadSStolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, realtype), ida_mem, which, reltolQB, abstolQB) end function IDAQuadSStolerancesB(ida_mem, which, reltolQB, abstolQB) @@ -1630,135 +801,46 @@ function IDAQuadSStolerancesB(ida_mem, which, reltolQB, abstolQB) end function IDAQuadSVtolerancesB(ida_mem, which::Cint, reltolQB::realtype, abstolQB::N_Vector) - ccall( - (:IDAQuadSVtolerancesB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype, N_Vector), - ida_mem, - which, - reltolQB, - abstolQB, - ) + ccall((:IDAQuadSVtolerancesB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector), ida_mem, which, reltolQB, abstolQB) end function IDAQuadSVtolerancesB(ida_mem, which, reltolQB, abstolQB) __abstolQB = convert(NVector, abstolQB) - IDAQuadSVtolerancesB( - ida_mem, - convert(Cint, which), - reltolQB, - convert(N_Vector, __abstolQB), - ) + IDAQuadSVtolerancesB(ida_mem, convert(Cint, which), reltolQB, convert(N_Vector, __abstolQB)) end function IDACalcICB(ida_mem, which::Cint, tout1::realtype, yy0::N_Vector, yp0::N_Vector) - ccall( - (:IDACalcICB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), - ida_mem, - which, - tout1, - yy0, - yp0, - ) + ccall((:IDACalcICB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector, N_Vector), ida_mem, which, tout1, yy0, yp0) end function IDACalcICB(ida_mem, which, tout1, yy0, yp0) __yy0 = convert(NVector, yy0) __yp0 = convert(NVector, yp0) - IDACalcICB( - ida_mem, - convert(Cint, which), - tout1, - convert(N_Vector, __yy0), - convert(N_Vector, __yp0), - ) -end - -function IDACalcICBS( - ida_mem, - which::Cint, - tout1::realtype, - yy0::N_Vector, - yp0::N_Vector, - yyS0, - ypS0, -) - ccall( - (:IDACalcICBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype, N_Vector, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), - ida_mem, - which, - tout1, - yy0, - yp0, - yyS0, - ypS0, - ) + IDACalcICB(ida_mem, convert(Cint, which), tout1, convert(N_Vector, __yy0), convert(N_Vector, __yp0)) +end + +function IDACalcICBS(ida_mem, which::Cint, tout1::realtype, yy0::N_Vector, yp0::N_Vector, yyS0, ypS0) + ccall((:IDACalcICBS, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype, N_Vector, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), ida_mem, which, tout1, yy0, yp0, yyS0, ypS0) end function IDACalcICBS(ida_mem, which, tout1, yy0, yp0, yyS0, ypS0) __yy0 = convert(NVector, yy0) __yp0 = convert(NVector, yp0) - IDACalcICBS( - ida_mem, - convert(Cint, which), - tout1, - convert(N_Vector, __yy0), - convert(N_Vector, __yp0), - yyS0, - ypS0, - ) -end - -function IDASolveF( - ida_mem, - tout::realtype, - tret, - yret::N_Vector, - ypret::N_Vector, - itask::Cint, - ncheckPtr, -) - ccall( - (:IDASolveF, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint, Ptr{Cint}), - ida_mem, - tout, - tret, - yret, - ypret, - itask, - ncheckPtr, - ) + IDACalcICBS(ida_mem, convert(Cint, which), tout1, convert(N_Vector, __yy0), convert(N_Vector, __yp0), yyS0, ypS0) +end + +function IDASolveF(ida_mem, tout::realtype, tret, yret::N_Vector, ypret::N_Vector, itask::Cint, ncheckPtr) + ccall((:IDASolveF, libsundials_idas), Cint, (IDAMemPtr, realtype, Ptr{realtype}, N_Vector, N_Vector, Cint, Ptr{Cint}), ida_mem, tout, tret, yret, ypret, itask, ncheckPtr) end function IDASolveF(ida_mem, tout, tret, yret, ypret, itask, ncheckPtr) __yret = convert(NVector, yret) __ypret = convert(NVector, ypret) - IDASolveF( - ida_mem, - tout, - tret, - convert(N_Vector, __yret), - convert(N_Vector, __ypret), - convert(Cint, itask), - ncheckPtr, - ) + IDASolveF(ida_mem, tout, tret, convert(N_Vector, __yret), convert(N_Vector, __ypret), convert(Cint, itask), ncheckPtr) end function IDASolveB(ida_mem, tBout::realtype, itaskB::Cint) - ccall( - (:IDASolveB, libsundials_idas), - Cint, - (IDAMemPtr, realtype, Cint), - ida_mem, - tBout, - itaskB, - ) + ccall((:IDASolveB, libsundials_idas), Cint, (IDAMemPtr, realtype, Cint), ida_mem, tBout, itaskB) end function IDASolveB(ida_mem, tBout, itaskB) @@ -1770,14 +852,7 @@ function IDAAdjSetNoSensi(ida_mem) end function IDASetUserDataB(ida_mem, which::Cint, user_dataB) - ccall( - (:IDASetUserDataB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Any), - ida_mem, - which, - user_dataB, - ) + ccall((:IDASetUserDataB, libsundials_idas), Cint, (IDAMemPtr, Cint, Any), ida_mem, which, user_dataB) end function IDASetUserDataB(ida_mem, which, user_dataB) @@ -1785,14 +860,7 @@ function IDASetUserDataB(ida_mem, which, user_dataB) end function IDASetMaxOrdB(ida_mem, which::Cint, maxordB::Cint) - ccall( - (:IDASetMaxOrdB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Cint), - ida_mem, - which, - maxordB, - ) + ccall((:IDASetMaxOrdB, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint), ida_mem, which, maxordB) end function IDASetMaxOrdB(ida_mem, which, maxordB) @@ -1800,14 +868,7 @@ function IDASetMaxOrdB(ida_mem, which, maxordB) end function IDASetMaxNumStepsB(ida_mem, which::Cint, mxstepsB::Clong) - ccall( - (:IDASetMaxNumStepsB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Clong), - ida_mem, - which, - mxstepsB, - ) + ccall((:IDASetMaxNumStepsB, libsundials_idas), Cint, (IDAMemPtr, Cint, Clong), ida_mem, which, mxstepsB) end function IDASetMaxNumStepsB(ida_mem, which, mxstepsB) @@ -1815,14 +876,7 @@ function IDASetMaxNumStepsB(ida_mem, which, mxstepsB) end function IDASetInitStepB(ida_mem, which::Cint, hinB::realtype) - ccall( - (:IDASetInitStepB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - which, - hinB, - ) + ccall((:IDASetInitStepB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, hinB) end function IDASetInitStepB(ida_mem, which, hinB) @@ -1830,14 +884,7 @@ function IDASetInitStepB(ida_mem, which, hinB) end function IDASetMaxStepB(ida_mem, which::Cint, hmaxB::realtype) - ccall( - (:IDASetMaxStepB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - which, - hmaxB, - ) + ccall((:IDASetMaxStepB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, hmaxB) end function IDASetMaxStepB(ida_mem, which, hmaxB) @@ -1845,14 +892,7 @@ function IDASetMaxStepB(ida_mem, which, hmaxB) end function IDASetSuppressAlgB(ida_mem, which::Cint, suppressalgB::Cint) - ccall( - (:IDASetSuppressAlgB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Cint), - ida_mem, - which, - suppressalgB, - ) + ccall((:IDASetSuppressAlgB, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint), ida_mem, which, suppressalgB) end function IDASetSuppressAlgB(ida_mem, which, suppressalgB) @@ -1860,14 +900,7 @@ function IDASetSuppressAlgB(ida_mem, which, suppressalgB) end function IDASetIdB(ida_mem, which::Cint, idB::N_Vector) - ccall( - (:IDASetIdB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, N_Vector), - ida_mem, - which, - idB, - ) + ccall((:IDASetIdB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector), ida_mem, which, idB) end function IDASetIdB(ida_mem, which, idB) @@ -1876,14 +909,7 @@ function IDASetIdB(ida_mem, which, idB) end function IDASetConstraintsB(ida_mem, which::Cint, constraintsB::N_Vector) - ccall( - (:IDASetConstraintsB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, N_Vector), - ida_mem, - which, - constraintsB, - ) + ccall((:IDASetConstraintsB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector), ida_mem, which, constraintsB) end function IDASetConstraintsB(ida_mem, which, constraintsB) @@ -1892,14 +918,7 @@ function IDASetConstraintsB(ida_mem, which, constraintsB) end function IDASetQuadErrConB(ida_mem, which::Cint, errconQB::Cint) - ccall( - (:IDASetQuadErrConB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Cint), - ida_mem, - which, - errconQB, - ) + ccall((:IDASetQuadErrConB, libsundials_idas), Cint, (IDAMemPtr, Cint, Cint), ida_mem, which, errconQB) end function IDASetQuadErrConB(ida_mem, which, errconQB) @@ -1907,14 +926,7 @@ function IDASetQuadErrConB(ida_mem, which, errconQB) end function IDASetNonlinearSolverB(ida_mem, which::Cint, NLS::SUNNonlinearSolver) - ccall( - (:IDASetNonlinearSolverB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, SUNNonlinearSolver), - ida_mem, - which, - NLS, - ) + ccall((:IDASetNonlinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNNonlinearSolver), ida_mem, which, NLS) end function IDASetNonlinearSolverB(ida_mem, which, NLS) @@ -1922,40 +934,17 @@ function IDASetNonlinearSolverB(ida_mem, which, NLS) end function IDAGetB(ida_mem, which::Cint, tret, yy::N_Vector, yp::N_Vector) - ccall( - (:IDAGetB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), - ida_mem, - which, - tret, - yy, - yp, - ) + ccall((:IDAGetB, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), ida_mem, which, tret, yy, yp) end function IDAGetB(ida_mem, which, tret, yy, yp) __yy = convert(NVector, yy) __yp = convert(NVector, yp) - IDAGetB( - ida_mem, - convert(Cint, which), - tret, - convert(N_Vector, __yy), - convert(N_Vector, __yp), - ) + IDAGetB(ida_mem, convert(Cint, which), tret, convert(N_Vector, __yy), convert(N_Vector, __yp)) end function IDAGetQuadB(ida_mem, which::Cint, tret, qB::N_Vector) - ccall( - (:IDAGetQuadB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Ptr{realtype}, N_Vector), - ida_mem, - which, - tret, - qB, - ) + ccall((:IDAGetQuadB, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, N_Vector), ida_mem, which, tret, qB) end function IDAGetQuadB(ida_mem, which, tret, qB) @@ -1964,52 +953,25 @@ function IDAGetQuadB(ida_mem, which, tret, qB) end function IDAGetAdjIDABmem(ida_mem, which::Cint) - ccall( - (:IDAGetAdjIDABmem, libsundials_idas), - Ptr{Cvoid}, - (IDAMemPtr, Cint), - ida_mem, - which, - ) + ccall((:IDAGetAdjIDABmem, libsundials_idas), Ptr{Cvoid}, (IDAMemPtr, Cint), ida_mem, which) end function IDAGetAdjIDABmem(ida_mem, which) IDAGetAdjIDABmem(ida_mem, convert(Cint, which)) end -function IDAGetConsistentICB(ida_mem, which::Cint, yyB0::N_Vector, ypB0::N_Vector) - ccall( - (:IDAGetConsistentICB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, N_Vector, N_Vector), - ida_mem, - which, - yyB0, - ypB0, - ) +function IDAGetConsistentICB(ida_mem, which::Cint, yyB0::N_Vector, ypB0::N_Vector) + ccall((:IDAGetConsistentICB, libsundials_idas), Cint, (IDAMemPtr, Cint, N_Vector, N_Vector), ida_mem, which, yyB0, ypB0) end function IDAGetConsistentICB(ida_mem, which, yyB0, ypB0) __yyB0 = convert(NVector, yyB0) __ypB0 = convert(NVector, ypB0) - IDAGetConsistentICB( - ida_mem, - convert(Cint, which), - convert(N_Vector, __yyB0), - convert(N_Vector, __ypB0), - ) + IDAGetConsistentICB(ida_mem, convert(Cint, which), convert(N_Vector, __yyB0), convert(N_Vector, __ypB0)) end function IDAGetAdjY(ida_mem, t::realtype, yy::N_Vector, yp::N_Vector) - ccall( - (:IDAGetAdjY, libsundials_idas), - Cint, - (IDAMemPtr, realtype, N_Vector, N_Vector), - ida_mem, - t, - yy, - yp, - ) + ccall((:IDAGetAdjY, libsundials_idas), Cint, (IDAMemPtr, realtype, N_Vector, N_Vector), ida_mem, t, yy, yp) end function IDAGetAdjY(ida_mem, t, yy, yp) @@ -2019,234 +981,61 @@ function IDAGetAdjY(ida_mem, t, yy, yp) end function IDAGetAdjCheckPointsInfo(ida_mem, ckpnt) - ccall( - (:IDAGetAdjCheckPointsInfo, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{IDAadjCheckPointRec}), - ida_mem, - ckpnt, - ) + ccall((:IDAGetAdjCheckPointsInfo, libsundials_idas), Cint, (IDAMemPtr, Ptr{IDAadjCheckPointRec}), ida_mem, ckpnt) end function IDAGetAdjDataPointHermite(ida_mem, which::Cint, t, yy::N_Vector, yd::N_Vector) - ccall( - (:IDAGetAdjDataPointHermite, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), - ida_mem, - which, - t, - yy, - yd, - ) + ccall((:IDAGetAdjDataPointHermite, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, N_Vector, N_Vector), ida_mem, which, t, yy, yd) end function IDAGetAdjDataPointHermite(ida_mem, which, t, yy, yd) __yy = convert(NVector, yy) __yd = convert(NVector, yd) - IDAGetAdjDataPointHermite( - ida_mem, - convert(Cint, which), - t, - convert(N_Vector, __yy), - convert(N_Vector, __yd), - ) + IDAGetAdjDataPointHermite(ida_mem, convert(Cint, which), t, convert(N_Vector, __yy), convert(N_Vector, __yd)) end function IDAGetAdjDataPointPolynomial(ida_mem, which::Cint, t, order, y::N_Vector) - ccall( - (:IDAGetAdjDataPointPolynomial, libsundials_idas), - Cint, - (IDAMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), - ida_mem, - which, - t, - order, - y, - ) + ccall((:IDAGetAdjDataPointPolynomial, libsundials_idas), Cint, (IDAMemPtr, Cint, Ptr{realtype}, Ptr{Cint}, N_Vector), ida_mem, which, t, order, y) end function IDAGetAdjDataPointPolynomial(ida_mem, which, t, order, y) __y = convert(NVector, y) - IDAGetAdjDataPointPolynomial( - ida_mem, - convert(Cint, which), - t, - order, - convert(N_Vector, __y), - ) + IDAGetAdjDataPointPolynomial(ida_mem, convert(Cint, which), t, order, convert(N_Vector, __y)) end function IDAGetAdjCurrentCheckPoint(ida_mem, addr) - ccall( - (:IDAGetAdjCurrentCheckPoint, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Ptr{Cvoid}}), - ida_mem, - addr, - ) + ccall((:IDAGetAdjCurrentCheckPoint, libsundials_idas), Cint, (IDAMemPtr, Ptr{Ptr{Cvoid}}), ida_mem, addr) end # Julia wrapper for header: idas_bbdpre.h # Automatically generated using Clang.jl -function IDABBDPrecInit( - ida_mem, - Nlocal::sunindextype, - mudq::sunindextype, - mldq::sunindextype, - mukeep::sunindextype, - mlkeep::sunindextype, - dq_rel_yy::realtype, - Gres::IDABBDLocalFn, - Gcomm::IDABBDCommFn, -) - ccall( - (:IDABBDPrecInit, libsundials_idas), - Cint, - ( - IDAMemPtr, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - IDABBDLocalFn, - IDABBDCommFn, - ), - ida_mem, - Nlocal, - mudq, - mldq, - mukeep, - mlkeep, - dq_rel_yy, - Gres, - Gcomm, - ) -end - -function IDABBDPrecReInit( - ida_mem, - mudq::sunindextype, - mldq::sunindextype, - dq_rel_yy::realtype, -) - ccall( - (:IDABBDPrecReInit, libsundials_idas), - Cint, - (IDAMemPtr, sunindextype, sunindextype, realtype), - ida_mem, - mudq, - mldq, - dq_rel_yy, - ) + +function IDABBDPrecInit(ida_mem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dq_rel_yy::realtype, Gres::IDABBDLocalFn, Gcomm::IDABBDCommFn) + ccall((:IDABBDPrecInit, libsundials_idas), Cint, (IDAMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, IDABBDLocalFn, IDABBDCommFn), ida_mem, Nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_yy, Gres, Gcomm) +end + +function IDABBDPrecReInit(ida_mem, mudq::sunindextype, mldq::sunindextype, dq_rel_yy::realtype) + ccall((:IDABBDPrecReInit, libsundials_idas), Cint, (IDAMemPtr, sunindextype, sunindextype, realtype), ida_mem, mudq, mldq, dq_rel_yy) end function IDABBDPrecGetWorkSpace(ida_mem, lenrwBBDP, leniwBBDP) - ccall( - (:IDABBDPrecGetWorkSpace, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwBBDP, - leniwBBDP, - ) + ccall((:IDABBDPrecGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwBBDP, leniwBBDP) end function IDABBDPrecGetNumGfnEvals(ida_mem, ngevalsBBDP) - ccall( - (:IDABBDPrecGetNumGfnEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - ngevalsBBDP, - ) -end - -function IDABBDPrecInitB( - ida_mem, - which::Cint, - NlocalB::sunindextype, - mudqB::sunindextype, - mldqB::sunindextype, - mukeepB::sunindextype, - mlkeepB::sunindextype, - dq_rel_yyB::realtype, - GresB::IDABBDLocalFnB, - GcommB::IDABBDCommFnB, -) - ccall( - (:IDABBDPrecInitB, libsundials_idas), - Cint, - ( - IDAMemPtr, - Cint, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - IDABBDLocalFnB, - IDABBDCommFnB, - ), - ida_mem, - which, - NlocalB, - mudqB, - mldqB, - mukeepB, - mlkeepB, - dq_rel_yyB, - GresB, - GcommB, - ) -end - -function IDABBDPrecInitB( - ida_mem, - which, - NlocalB, - mudqB, - mldqB, - mukeepB, - mlkeepB, - dq_rel_yyB, - GresB, - GcommB, -) - IDABBDPrecInitB( - ida_mem, - convert(Cint, which), - NlocalB, - mudqB, - mldqB, - mukeepB, - mlkeepB, - dq_rel_yyB, - GresB, - GcommB, - ) -end - -function IDABBDPrecReInitB( - ida_mem, - which::Cint, - mudqB::sunindextype, - mldqB::sunindextype, - dq_rel_yyB::realtype, -) - ccall( - (:IDABBDPrecReInitB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, sunindextype, sunindextype, realtype), - ida_mem, - which, - mudqB, - mldqB, - dq_rel_yyB, - ) + ccall((:IDABBDPrecGetNumGfnEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, ngevalsBBDP) +end + +function IDABBDPrecInitB(ida_mem, which::Cint, NlocalB::sunindextype, mudqB::sunindextype, mldqB::sunindextype, mukeepB::sunindextype, mlkeepB::sunindextype, dq_rel_yyB::realtype, GresB::IDABBDLocalFnB, GcommB::IDABBDCommFnB) + ccall((:IDABBDPrecInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, IDABBDLocalFnB, IDABBDCommFnB), ida_mem, which, NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dq_rel_yyB, GresB, GcommB) +end + +function IDABBDPrecInitB(ida_mem, which, NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dq_rel_yyB, GresB, GcommB) + IDABBDPrecInitB(ida_mem, convert(Cint, which), NlocalB, mudqB, mldqB, mukeepB, mlkeepB, dq_rel_yyB, GresB, GcommB) +end + +function IDABBDPrecReInitB(ida_mem, which::Cint, mudqB::sunindextype, mldqB::sunindextype, dq_rel_yyB::realtype) + ccall((:IDABBDPrecReInitB, libsundials_idas), Cint, (IDAMemPtr, Cint, sunindextype, sunindextype, realtype), ida_mem, which, mudqB, mldqB, dq_rel_yyB) end function IDABBDPrecReInitB(ida_mem, which, mudqB, mldqB, dq_rel_yyB) @@ -2255,15 +1044,9 @@ end # Julia wrapper for header: idas_direct.h # Automatically generated using Clang.jl + function IDADlsSetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:IDADlsSetLinearSolver, libsundials_idas), - Cint, - (IDAMemPtr, SUNLinearSolver, SUNMatrix), - ida_mem, - LS, - A, - ) + ccall((:IDADlsSetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) end function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) @@ -2271,44 +1054,19 @@ function IDADlsSetJacFn(ida_mem, jac::IDADlsJacFn) end function IDADlsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall( - (:IDADlsGetWorkSpace, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwLS, - leniwLS, - ) + ccall((:IDADlsGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) end function IDADlsGetNumJacEvals(ida_mem, njevals) - ccall( - (:IDADlsGetNumJacEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njevals, - ) + ccall((:IDADlsGetNumJacEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) end function IDADlsGetNumResEvals(ida_mem, nrevalsLS) - ccall( - (:IDADlsGetNumResEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevalsLS, - ) + ccall((:IDADlsGetNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) end function IDADlsGetLastFlag(ida_mem, flag) - ccall( - (:IDADlsGetLastFlag, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - flag, - ) + ccall((:IDADlsGetLastFlag, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) end function IDADlsGetReturnFlagName(flag::Clong) @@ -2320,15 +1078,7 @@ function IDADlsGetReturnFlagName(flag) end function IDADlsSetLinearSolverB(ida_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:IDADlsSetLinearSolverB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), - ida_mem, - which, - LS, - A, - ) + ccall((:IDADlsSetLinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), ida_mem, which, LS, A) end function IDADlsSetLinearSolverB(ida_mem, which, LS, A) @@ -2336,14 +1086,7 @@ function IDADlsSetLinearSolverB(ida_mem, which, LS, A) end function IDADlsSetJacFnB(ida_mem, which::Cint, jacB::IDADlsJacFnB) - ccall( - (:IDADlsSetJacFnB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDADlsJacFnB), - ida_mem, - which, - jacB, - ) + ccall((:IDADlsSetJacFnB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDADlsJacFnB), ida_mem, which, jacB) end function IDADlsSetJacFnB(ida_mem, which, jacB) @@ -2351,14 +1094,7 @@ function IDADlsSetJacFnB(ida_mem, which, jacB) end function IDADlsSetJacFnBS(ida_mem, which::Cint, jacBS::IDADlsJacFnBS) - ccall( - (:IDADlsSetJacFnBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDADlsJacFnBS), - ida_mem, - which, - jacBS, - ) + ccall((:IDADlsSetJacFnBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDADlsJacFnBS), ida_mem, which, jacBS) end function IDADlsSetJacFnBS(ida_mem, which, jacBS) @@ -2367,15 +1103,9 @@ end # Julia wrapper for header: idas_ls.h # Automatically generated using Clang.jl + function IDASetLinearSolver(ida_mem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:IDASetLinearSolver, libsundials_idas), - Cint, - (IDAMemPtr, SUNLinearSolver, SUNMatrix), - ida_mem, - LS, - A, - ) + ccall((:IDASetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver, SUNMatrix), ida_mem, LS, A) end function IDASetJacFn(ida_mem, jac::IDALsJacFn) @@ -2383,25 +1113,11 @@ function IDASetJacFn(ida_mem, jac::IDALsJacFn) end function IDASetPreconditioner(ida_mem, pset::IDALsPrecSetupFn, psolve::IDALsPrecSolveFn) - ccall( - (:IDASetPreconditioner, libsundials_idas), - Cint, - (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), - ida_mem, - pset, - psolve, - ) + ccall((:IDASetPreconditioner, libsundials_idas), Cint, (IDAMemPtr, IDALsPrecSetupFn, IDALsPrecSolveFn), ida_mem, pset, psolve) end function IDASetJacTimes(ida_mem, jtsetup::IDALsJacTimesSetupFn, jtimes::IDALsJacTimesVecFn) - ccall( - (:IDASetJacTimes, libsundials_idas), - Cint, - (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), - ida_mem, - jtsetup, - jtimes, - ) + ccall((:IDASetJacTimes, libsundials_idas), Cint, (IDAMemPtr, IDALsJacTimesSetupFn, IDALsJacTimesVecFn), ida_mem, jtsetup, jtimes) end function IDASetEpsLin(ida_mem, eplifac::realtype) @@ -2409,114 +1125,47 @@ function IDASetEpsLin(ida_mem, eplifac::realtype) end function IDASetIncrementFactor(ida_mem, dqincfac::realtype) - ccall( - (:IDASetIncrementFactor, libsundials_idas), - Cint, - (IDAMemPtr, realtype), - ida_mem, - dqincfac, - ) + ccall((:IDASetIncrementFactor, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) end function IDAGetLinWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall( - (:IDAGetLinWorkSpace, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwLS, - leniwLS, - ) + ccall((:IDAGetLinWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) end function IDAGetNumJacEvals(ida_mem, njevals) - ccall( - (:IDAGetNumJacEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njevals, - ) + ccall((:IDAGetNumJacEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njevals) end function IDAGetNumPrecEvals(ida_mem, npevals) - ccall( - (:IDAGetNumPrecEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npevals, - ) + ccall((:IDAGetNumPrecEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) end function IDAGetNumPrecSolves(ida_mem, npsolves) - ccall( - (:IDAGetNumPrecSolves, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npsolves, - ) + ccall((:IDAGetNumPrecSolves, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) end function IDAGetNumLinIters(ida_mem, nliters) - ccall( - (:IDAGetNumLinIters, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nliters, - ) + ccall((:IDAGetNumLinIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) end function IDAGetNumLinConvFails(ida_mem, nlcfails) - ccall( - (:IDAGetNumLinConvFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nlcfails, - ) + ccall((:IDAGetNumLinConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) end function IDAGetNumJTSetupEvals(ida_mem, njtsetups) - ccall( - (:IDAGetNumJTSetupEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njtsetups, - ) + ccall((:IDAGetNumJTSetupEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) end function IDAGetNumJtimesEvals(ida_mem, njvevals) - ccall( - (:IDAGetNumJtimesEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njvevals, - ) + ccall((:IDAGetNumJtimesEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) end function IDAGetNumLinResEvals(ida_mem, nrevalsLS) - ccall( - (:IDAGetNumLinResEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevalsLS, - ) + ccall((:IDAGetNumLinResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) end function IDAGetLastLinFlag(ida_mem, flag) - ccall( - (:IDAGetLastLinFlag, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - flag, - ) + ccall((:IDAGetLastLinFlag, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) end function IDAGetLinReturnFlagName(flag::Cint) @@ -2528,15 +1177,7 @@ function IDAGetLinReturnFlagName(flag) end function IDASetLinearSolverB(ida_mem, which::Cint, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:IDASetLinearSolverB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), - ida_mem, - which, - LS, - A, - ) + ccall((:IDASetLinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNLinearSolver, SUNMatrix), ida_mem, which, LS, A) end function IDASetLinearSolverB(ida_mem, which, LS, A) @@ -2544,14 +1185,7 @@ function IDASetLinearSolverB(ida_mem, which, LS, A) end function IDASetJacFnB(ida_mem, which::Cint, jacB::IDALsJacFnB) - ccall( - (:IDASetJacFnB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDALsJacFnB), - ida_mem, - which, - jacB, - ) + ccall((:IDASetJacFnB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacFnB), ida_mem, which, jacB) end function IDASetJacFnB(ida_mem, which, jacB) @@ -2559,14 +1193,7 @@ function IDASetJacFnB(ida_mem, which, jacB) end function IDASetJacFnBS(ida_mem, which::Cint, jacBS::IDALsJacFnBS) - ccall( - (:IDASetJacFnBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDALsJacFnBS), - ida_mem, - which, - jacBS, - ) + ccall((:IDASetJacFnBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacFnBS), ida_mem, which, jacBS) end function IDASetJacFnBS(ida_mem, which, jacBS) @@ -2574,14 +1201,7 @@ function IDASetJacFnBS(ida_mem, which, jacBS) end function IDASetEpsLinB(ida_mem, which::Cint, eplifacB::realtype) - ccall( - (:IDASetEpsLinB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - which, - eplifacB, - ) + ccall((:IDASetEpsLinB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, eplifacB) end function IDASetEpsLinB(ida_mem, which, eplifacB) @@ -2589,98 +1209,39 @@ function IDASetEpsLinB(ida_mem, which, eplifacB) end function IDASetIncrementFactorB(ida_mem, which::Cint, dqincfacB::realtype) - ccall( - (:IDASetIncrementFactorB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - which, - dqincfacB, - ) + ccall((:IDASetIncrementFactorB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, dqincfacB) end function IDASetIncrementFactorB(ida_mem, which, dqincfacB) IDASetIncrementFactorB(ida_mem, convert(Cint, which), dqincfacB) end -function IDASetPreconditionerB( - ida_mem, - which::Cint, - psetB::IDALsPrecSetupFnB, - psolveB::IDALsPrecSolveFnB, -) - ccall( - (:IDASetPreconditionerB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDALsPrecSetupFnB, IDALsPrecSolveFnB), - ida_mem, - which, - psetB, - psolveB, - ) +function IDASetPreconditionerB(ida_mem, which::Cint, psetB::IDALsPrecSetupFnB, psolveB::IDALsPrecSolveFnB) + ccall((:IDASetPreconditionerB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsPrecSetupFnB, IDALsPrecSolveFnB), ida_mem, which, psetB, psolveB) end function IDASetPreconditionerB(ida_mem, which, psetB, psolveB) IDASetPreconditionerB(ida_mem, convert(Cint, which), psetB, psolveB) end -function IDASetPreconditionerBS( - ida_mem, - which::Cint, - psetBS::IDALsPrecSetupFnBS, - psolveBS::IDALsPrecSolveFnBS, -) - ccall( - (:IDASetPreconditionerBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDALsPrecSetupFnBS, IDALsPrecSolveFnBS), - ida_mem, - which, - psetBS, - psolveBS, - ) +function IDASetPreconditionerBS(ida_mem, which::Cint, psetBS::IDALsPrecSetupFnBS, psolveBS::IDALsPrecSolveFnBS) + ccall((:IDASetPreconditionerBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsPrecSetupFnBS, IDALsPrecSolveFnBS), ida_mem, which, psetBS, psolveBS) end function IDASetPreconditionerBS(ida_mem, which, psetBS, psolveBS) IDASetPreconditionerBS(ida_mem, convert(Cint, which), psetBS, psolveBS) end -function IDASetJacTimesB( - ida_mem, - which::Cint, - jtsetupB::IDALsJacTimesSetupFnB, - jtimesB::IDALsJacTimesVecFnB, -) - ccall( - (:IDASetJacTimesB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDALsJacTimesSetupFnB, IDALsJacTimesVecFnB), - ida_mem, - which, - jtsetupB, - jtimesB, - ) +function IDASetJacTimesB(ida_mem, which::Cint, jtsetupB::IDALsJacTimesSetupFnB, jtimesB::IDALsJacTimesVecFnB) + ccall((:IDASetJacTimesB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacTimesSetupFnB, IDALsJacTimesVecFnB), ida_mem, which, jtsetupB, jtimesB) end function IDASetJacTimesB(ida_mem, which, jtsetupB, jtimesB) IDASetJacTimesB(ida_mem, convert(Cint, which), jtsetupB, jtimesB) end -function IDASetJacTimesBS( - ida_mem, - which::Cint, - jtsetupBS::IDALsJacTimesSetupFnBS, - jtimesBS::IDALsJacTimesVecFnBS, -) - ccall( - (:IDASetJacTimesBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDALsJacTimesSetupFnBS, IDALsJacTimesVecFnBS), - ida_mem, - which, - jtsetupBS, - jtimesBS, - ) +function IDASetJacTimesBS(ida_mem, which::Cint, jtsetupBS::IDALsJacTimesSetupFnBS, jtimesBS::IDALsJacTimesVecFnBS) + ccall((:IDASetJacTimesBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDALsJacTimesSetupFnBS, IDALsJacTimesVecFnBS), ida_mem, which, jtsetupBS, jtimesBS) end function IDASetJacTimesBS(ida_mem, which, jtsetupBS, jtimesBS) @@ -2689,155 +1250,61 @@ end # Julia wrapper for header: idas_spils.h # Automatically generated using Clang.jl + function IDASpilsSetLinearSolver(ida_mem, LS::SUNLinearSolver) - ccall( - (:IDASpilsSetLinearSolver, libsundials_idas), - Cint, - (IDAMemPtr, SUNLinearSolver), - ida_mem, - LS, - ) -end - -function IDASpilsSetPreconditioner( - ida_mem, - pset::IDASpilsPrecSetupFn, - psolve::IDASpilsPrecSolveFn, -) - ccall( - (:IDASpilsSetPreconditioner, libsundials_idas), - Cint, - (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), - ida_mem, - pset, - psolve, - ) -end - -function IDASpilsSetJacTimes( - ida_mem, - jtsetup::IDASpilsJacTimesSetupFn, - jtimes::IDASpilsJacTimesVecFn, -) - ccall( - (:IDASpilsSetJacTimes, libsundials_idas), - Cint, - (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), - ida_mem, - jtsetup, - jtimes, - ) + ccall((:IDASpilsSetLinearSolver, libsundials_idas), Cint, (IDAMemPtr, SUNLinearSolver), ida_mem, LS) +end + +function IDASpilsSetPreconditioner(ida_mem, pset::IDASpilsPrecSetupFn, psolve::IDASpilsPrecSolveFn) + ccall((:IDASpilsSetPreconditioner, libsundials_idas), Cint, (IDAMemPtr, IDASpilsPrecSetupFn, IDASpilsPrecSolveFn), ida_mem, pset, psolve) +end + +function IDASpilsSetJacTimes(ida_mem, jtsetup::IDASpilsJacTimesSetupFn, jtimes::IDASpilsJacTimesVecFn) + ccall((:IDASpilsSetJacTimes, libsundials_idas), Cint, (IDAMemPtr, IDASpilsJacTimesSetupFn, IDASpilsJacTimesVecFn), ida_mem, jtsetup, jtimes) end function IDASpilsSetEpsLin(ida_mem, eplifac::realtype) - ccall( - (:IDASpilsSetEpsLin, libsundials_idas), - Cint, - (IDAMemPtr, realtype), - ida_mem, - eplifac, - ) + ccall((:IDASpilsSetEpsLin, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, eplifac) end function IDASpilsSetIncrementFactor(ida_mem, dqincfac::realtype) - ccall( - (:IDASpilsSetIncrementFactor, libsundials_idas), - Cint, - (IDAMemPtr, realtype), - ida_mem, - dqincfac, - ) + ccall((:IDASpilsSetIncrementFactor, libsundials_idas), Cint, (IDAMemPtr, realtype), ida_mem, dqincfac) end function IDASpilsGetWorkSpace(ida_mem, lenrwLS, leniwLS) - ccall( - (:IDASpilsGetWorkSpace, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), - ida_mem, - lenrwLS, - leniwLS, - ) + ccall((:IDASpilsGetWorkSpace, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}, Ptr{Clong}), ida_mem, lenrwLS, leniwLS) end function IDASpilsGetNumPrecEvals(ida_mem, npevals) - ccall( - (:IDASpilsGetNumPrecEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npevals, - ) + ccall((:IDASpilsGetNumPrecEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npevals) end function IDASpilsGetNumPrecSolves(ida_mem, npsolves) - ccall( - (:IDASpilsGetNumPrecSolves, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - npsolves, - ) + ccall((:IDASpilsGetNumPrecSolves, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, npsolves) end function IDASpilsGetNumLinIters(ida_mem, nliters) - ccall( - (:IDASpilsGetNumLinIters, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nliters, - ) + ccall((:IDASpilsGetNumLinIters, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nliters) end function IDASpilsGetNumConvFails(ida_mem, nlcfails) - ccall( - (:IDASpilsGetNumConvFails, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nlcfails, - ) + ccall((:IDASpilsGetNumConvFails, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nlcfails) end function IDASpilsGetNumJTSetupEvals(ida_mem, njtsetups) - ccall( - (:IDASpilsGetNumJTSetupEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njtsetups, - ) + ccall((:IDASpilsGetNumJTSetupEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njtsetups) end function IDASpilsGetNumJtimesEvals(ida_mem, njvevals) - ccall( - (:IDASpilsGetNumJtimesEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - njvevals, - ) + ccall((:IDASpilsGetNumJtimesEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, njvevals) end function IDASpilsGetNumResEvals(ida_mem, nrevalsLS) - ccall( - (:IDASpilsGetNumResEvals, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - nrevalsLS, - ) + ccall((:IDASpilsGetNumResEvals, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, nrevalsLS) end function IDASpilsGetLastFlag(ida_mem, flag) - ccall( - (:IDASpilsGetLastFlag, libsundials_idas), - Cint, - (IDAMemPtr, Ptr{Clong}), - ida_mem, - flag, - ) + ccall((:IDASpilsGetLastFlag, libsundials_idas), Cint, (IDAMemPtr, Ptr{Clong}), ida_mem, flag) end function IDASpilsGetReturnFlagName(flag::Clong) @@ -2849,14 +1316,7 @@ function IDASpilsGetReturnFlagName(flag) end function IDASpilsSetLinearSolverB(ida_mem, which::Cint, LS::SUNLinearSolver) - ccall( - (:IDASpilsSetLinearSolverB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, SUNLinearSolver), - ida_mem, - which, - LS, - ) + ccall((:IDASpilsSetLinearSolverB, libsundials_idas), Cint, (IDAMemPtr, Cint, SUNLinearSolver), ida_mem, which, LS) end function IDASpilsSetLinearSolverB(ida_mem, which, LS) @@ -2864,14 +1324,7 @@ function IDASpilsSetLinearSolverB(ida_mem, which, LS) end function IDASpilsSetEpsLinB(ida_mem, which::Cint, eplifacB::realtype) - ccall( - (:IDASpilsSetEpsLinB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - which, - eplifacB, - ) + ccall((:IDASpilsSetEpsLinB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, eplifacB) end function IDASpilsSetEpsLinB(ida_mem, which, eplifacB) @@ -2879,98 +1332,39 @@ function IDASpilsSetEpsLinB(ida_mem, which, eplifacB) end function IDASpilsSetIncrementFactorB(ida_mem, which::Cint, dqincfacB::realtype) - ccall( - (:IDASpilsSetIncrementFactorB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, realtype), - ida_mem, - which, - dqincfacB, - ) + ccall((:IDASpilsSetIncrementFactorB, libsundials_idas), Cint, (IDAMemPtr, Cint, realtype), ida_mem, which, dqincfacB) end function IDASpilsSetIncrementFactorB(ida_mem, which, dqincfacB) IDASpilsSetIncrementFactorB(ida_mem, convert(Cint, which), dqincfacB) end -function IDASpilsSetPreconditionerB( - ida_mem, - which::Cint, - psetB::IDASpilsPrecSetupFnB, - psolveB::IDASpilsPrecSolveFnB, -) - ccall( - (:IDASpilsSetPreconditionerB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDASpilsPrecSetupFnB, IDASpilsPrecSolveFnB), - ida_mem, - which, - psetB, - psolveB, - ) +function IDASpilsSetPreconditionerB(ida_mem, which::Cint, psetB::IDASpilsPrecSetupFnB, psolveB::IDASpilsPrecSolveFnB) + ccall((:IDASpilsSetPreconditionerB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsPrecSetupFnB, IDASpilsPrecSolveFnB), ida_mem, which, psetB, psolveB) end function IDASpilsSetPreconditionerB(ida_mem, which, psetB, psolveB) IDASpilsSetPreconditionerB(ida_mem, convert(Cint, which), psetB, psolveB) end -function IDASpilsSetPreconditionerBS( - ida_mem, - which::Cint, - psetBS::IDASpilsPrecSetupFnBS, - psolveBS::IDASpilsPrecSolveFnBS, -) - ccall( - (:IDASpilsSetPreconditionerBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDASpilsPrecSetupFnBS, IDASpilsPrecSolveFnBS), - ida_mem, - which, - psetBS, - psolveBS, - ) +function IDASpilsSetPreconditionerBS(ida_mem, which::Cint, psetBS::IDASpilsPrecSetupFnBS, psolveBS::IDASpilsPrecSolveFnBS) + ccall((:IDASpilsSetPreconditionerBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsPrecSetupFnBS, IDASpilsPrecSolveFnBS), ida_mem, which, psetBS, psolveBS) end function IDASpilsSetPreconditionerBS(ida_mem, which, psetBS, psolveBS) IDASpilsSetPreconditionerBS(ida_mem, convert(Cint, which), psetBS, psolveBS) end -function IDASpilsSetJacTimesB( - ida_mem, - which::Cint, - jtsetupB::IDASpilsJacTimesSetupFnB, - jtimesB::IDASpilsJacTimesVecFnB, -) - ccall( - (:IDASpilsSetJacTimesB, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnB, IDASpilsJacTimesVecFnB), - ida_mem, - which, - jtsetupB, - jtimesB, - ) +function IDASpilsSetJacTimesB(ida_mem, which::Cint, jtsetupB::IDASpilsJacTimesSetupFnB, jtimesB::IDASpilsJacTimesVecFnB) + ccall((:IDASpilsSetJacTimesB, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnB, IDASpilsJacTimesVecFnB), ida_mem, which, jtsetupB, jtimesB) end function IDASpilsSetJacTimesB(ida_mem, which, jtsetupB, jtimesB) IDASpilsSetJacTimesB(ida_mem, convert(Cint, which), jtsetupB, jtimesB) end -function IDASpilsSetJacTimesBS( - ida_mem, - which::Cint, - jtsetupBS::IDASpilsJacTimesSetupFnBS, - jtimesBS::IDASpilsJacTimesVecFnBS, -) - ccall( - (:IDASpilsSetJacTimesBS, libsundials_idas), - Cint, - (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnBS, IDASpilsJacTimesVecFnBS), - ida_mem, - which, - jtsetupBS, - jtimesBS, - ) +function IDASpilsSetJacTimesBS(ida_mem, which::Cint, jtsetupBS::IDASpilsJacTimesSetupFnBS, jtimesBS::IDASpilsJacTimesVecFnBS) + ccall((:IDASpilsSetJacTimesBS, libsundials_idas), Cint, (IDAMemPtr, Cint, IDASpilsJacTimesSetupFnBS, IDASpilsJacTimesVecFnBS), ida_mem, which, jtsetupBS, jtimesBS) end function IDASpilsSetJacTimesBS(ida_mem, which, jtsetupBS, jtimesBS) diff --git a/src/API/kinsol.jl b/src/API/kinsol.jl index b37852e7..38042865 100644 --- a/src/API/kinsol.jl +++ b/src/API/kinsol.jl @@ -1,19 +1,13 @@ # Julia wrapper for header: kinsol.h # Automatically generated using Clang.jl + function KINCreate() ccall((:KINCreate, libsundials_kinsol), KINMemPtr, ()) end function KINInit(kinmem, func::KINSysFn, tmpl::N_Vector) - ccall( - (:KINInit, libsundials_kinsol), - Cint, - (KINMemPtr, KINSysFn, N_Vector), - kinmem, - func, - tmpl, - ) + ccall((:KINInit, libsundials_kinsol), Cint, (KINMemPtr, KINSysFn, N_Vector), kinmem, func, tmpl) end function KINInit(kinmem, func, tmpl) @@ -22,40 +16,18 @@ function KINInit(kinmem, func, tmpl) end function KINSol(kinmem, uu::N_Vector, strategy::Cint, u_scale::N_Vector, f_scale::N_Vector) - ccall( - (:KINSol, libsundials_kinsol), - Cint, - (KINMemPtr, N_Vector, Cint, N_Vector, N_Vector), - kinmem, - uu, - strategy, - u_scale, - f_scale, - ) + ccall((:KINSol, libsundials_kinsol), Cint, (KINMemPtr, N_Vector, Cint, N_Vector, N_Vector), kinmem, uu, strategy, u_scale, f_scale) end function KINSol(kinmem, uu, strategy, u_scale, f_scale) __uu = convert(NVector, uu) __u_scale = convert(NVector, u_scale) __f_scale = convert(NVector, f_scale) - KINSol( - kinmem, - convert(N_Vector, __uu), - convert(Cint, strategy), - convert(N_Vector, __u_scale), - convert(N_Vector, __f_scale), - ) + KINSol(kinmem, convert(N_Vector, __uu), convert(Cint, strategy), convert(N_Vector, __u_scale), convert(N_Vector, __f_scale)) end function KINSetErrHandlerFn(kinmem, ehfun::KINErrHandlerFn, eh_data) - ccall( - (:KINSetErrHandlerFn, libsundials_kinsol), - Cint, - (KINMemPtr, KINErrHandlerFn, Ptr{Cvoid}), - kinmem, - ehfun, - eh_data, - ) + ccall((:KINSetErrHandlerFn, libsundials_kinsol), Cint, (KINMemPtr, KINErrHandlerFn, Ptr{Cvoid}), kinmem, ehfun, eh_data) end function KINSetErrFile(kinmem, errfp) @@ -63,24 +35,11 @@ function KINSetErrFile(kinmem, errfp) end function KINSetInfoHandlerFn(kinmem, ihfun::KINInfoHandlerFn, ih_data) - ccall( - (:KINSetInfoHandlerFn, libsundials_kinsol), - Cint, - (KINMemPtr, KINInfoHandlerFn, Ptr{Cvoid}), - kinmem, - ihfun, - ih_data, - ) + ccall((:KINSetInfoHandlerFn, libsundials_kinsol), Cint, (KINMemPtr, KINInfoHandlerFn, Ptr{Cvoid}), kinmem, ihfun, ih_data) end function KINSetInfoFile(kinmem, infofp) - ccall( - (:KINSetInfoFile, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{FILE}), - kinmem, - infofp, - ) + ccall((:KINSetInfoFile, libsundials_kinsol), Cint, (KINMemPtr, Ptr{FILE}), kinmem, infofp) end function KINSetUserData(kinmem, user_data) @@ -88,13 +47,7 @@ function KINSetUserData(kinmem, user_data) end function KINSetPrintLevel(kinmemm, printfl::Cint) - ccall( - (:KINSetPrintLevel, libsundials_kinsol), - Cint, - (KINMemPtr, Cint), - kinmemm, - printfl, - ) + ccall((:KINSetPrintLevel, libsundials_kinsol), Cint, (KINMemPtr, Cint), kinmemm, printfl) end function KINSetPrintLevel(kinmemm, printfl) @@ -114,13 +67,7 @@ function KINSetDampingAA(kinmem, beta::realtype) end function KINSetNumMaxIters(kinmem, mxiter::Clong) - ccall( - (:KINSetNumMaxIters, libsundials_kinsol), - Cint, - (KINMemPtr, Clong), - kinmem, - mxiter, - ) + ccall((:KINSetNumMaxIters, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, mxiter) end function KINSetNumMaxIters(kinmem, mxiter) @@ -128,13 +75,7 @@ function KINSetNumMaxIters(kinmem, mxiter) end function KINSetNoInitSetup(kinmem, noInitSetup::Cint) - ccall( - (:KINSetNoInitSetup, libsundials_kinsol), - Cint, - (KINMemPtr, Cint), - kinmem, - noInitSetup, - ) + ccall((:KINSetNoInitSetup, libsundials_kinsol), Cint, (KINMemPtr, Cint), kinmem, noInitSetup) end function KINSetNoInitSetup(kinmem, noInitSetup) @@ -142,13 +83,7 @@ function KINSetNoInitSetup(kinmem, noInitSetup) end function KINSetNoResMon(kinmem, noNNIResMon::Cint) - ccall( - (:KINSetNoResMon, libsundials_kinsol), - Cint, - (KINMemPtr, Cint), - kinmem, - noNNIResMon, - ) + ccall((:KINSetNoResMon, libsundials_kinsol), Cint, (KINMemPtr, Cint), kinmem, noNNIResMon) end function KINSetNoResMon(kinmem, noNNIResMon) @@ -156,13 +91,7 @@ function KINSetNoResMon(kinmem, noNNIResMon) end function KINSetMaxSetupCalls(kinmem, msbset::Clong) - ccall( - (:KINSetMaxSetupCalls, libsundials_kinsol), - Cint, - (KINMemPtr, Clong), - kinmem, - msbset, - ) + ccall((:KINSetMaxSetupCalls, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, msbset) end function KINSetMaxSetupCalls(kinmem, msbset) @@ -170,13 +99,7 @@ function KINSetMaxSetupCalls(kinmem, msbset) end function KINSetMaxSubSetupCalls(kinmem, msbsetsub::Clong) - ccall( - (:KINSetMaxSubSetupCalls, libsundials_kinsol), - Cint, - (KINMemPtr, Clong), - kinmem, - msbsetsub, - ) + ccall((:KINSetMaxSubSetupCalls, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, msbsetsub) end function KINSetMaxSubSetupCalls(kinmem, msbsetsub) @@ -192,45 +115,19 @@ function KINSetEtaForm(kinmem, etachoice) end function KINSetEtaConstValue(kinmem, eta::realtype) - ccall( - (:KINSetEtaConstValue, libsundials_kinsol), - Cint, - (KINMemPtr, realtype), - kinmem, - eta, - ) + ccall((:KINSetEtaConstValue, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, eta) end function KINSetEtaParams(kinmem, egamma::realtype, ealpha::realtype) - ccall( - (:KINSetEtaParams, libsundials_kinsol), - Cint, - (KINMemPtr, realtype, realtype), - kinmem, - egamma, - ealpha, - ) + ccall((:KINSetEtaParams, libsundials_kinsol), Cint, (KINMemPtr, realtype, realtype), kinmem, egamma, ealpha) end function KINSetResMonParams(kinmem, omegamin::realtype, omegamax::realtype) - ccall( - (:KINSetResMonParams, libsundials_kinsol), - Cint, - (KINMemPtr, realtype, realtype), - kinmem, - omegamin, - omegamax, - ) + ccall((:KINSetResMonParams, libsundials_kinsol), Cint, (KINMemPtr, realtype, realtype), kinmem, omegamin, omegamax) end function KINSetResMonConstValue(kinmem, omegaconst::realtype) - ccall( - (:KINSetResMonConstValue, libsundials_kinsol), - Cint, - (KINMemPtr, realtype), - kinmem, - omegaconst, - ) + ccall((:KINSetResMonConstValue, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, omegaconst) end function KINSetNoMinEps(kinmem, noMinEps::Cint) @@ -242,23 +139,11 @@ function KINSetNoMinEps(kinmem, noMinEps) end function KINSetMaxNewtonStep(kinmem, mxnewtstep::realtype) - ccall( - (:KINSetMaxNewtonStep, libsundials_kinsol), - Cint, - (KINMemPtr, realtype), - kinmem, - mxnewtstep, - ) + ccall((:KINSetMaxNewtonStep, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, mxnewtstep) end function KINSetMaxBetaFails(kinmem, mxnbcf::Clong) - ccall( - (:KINSetMaxBetaFails, libsundials_kinsol), - Cint, - (KINMemPtr, Clong), - kinmem, - mxnbcf, - ) + ccall((:KINSetMaxBetaFails, libsundials_kinsol), Cint, (KINMemPtr, Clong), kinmem, mxnbcf) end function KINSetMaxBetaFails(kinmem, mxnbcf) @@ -266,43 +151,19 @@ function KINSetMaxBetaFails(kinmem, mxnbcf) end function KINSetRelErrFunc(kinmem, relfunc::realtype) - ccall( - (:KINSetRelErrFunc, libsundials_kinsol), - Cint, - (KINMemPtr, realtype), - kinmem, - relfunc, - ) + ccall((:KINSetRelErrFunc, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, relfunc) end function KINSetFuncNormTol(kinmem, fnormtol::realtype) - ccall( - (:KINSetFuncNormTol, libsundials_kinsol), - Cint, - (KINMemPtr, realtype), - kinmem, - fnormtol, - ) + ccall((:KINSetFuncNormTol, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, fnormtol) end function KINSetScaledStepTol(kinmem, scsteptol::realtype) - ccall( - (:KINSetScaledStepTol, libsundials_kinsol), - Cint, - (KINMemPtr, realtype), - kinmem, - scsteptol, - ) + ccall((:KINSetScaledStepTol, libsundials_kinsol), Cint, (KINMemPtr, realtype), kinmem, scsteptol) end function KINSetConstraints(kinmem, constraints::N_Vector) - ccall( - (:KINSetConstraints, libsundials_kinsol), - Cint, - (KINMemPtr, N_Vector), - kinmem, - constraints, - ) + ccall((:KINSetConstraints, libsundials_kinsol), Cint, (KINMemPtr, N_Vector), kinmem, constraints) end function KINSetConstraints(kinmem, constraints) @@ -315,74 +176,31 @@ function KINSetSysFunc(kinmem, func::KINSysFn) end function KINGetWorkSpace(kinmem, lenrw, leniw) - ccall( - (:KINGetWorkSpace, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}, Ptr{Clong}), - kinmem, - lenrw, - leniw, - ) + ccall((:KINGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrw, leniw) end function KINGetNumNonlinSolvIters(kinmem, nniters) - ccall( - (:KINGetNumNonlinSolvIters, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nniters, - ) + ccall((:KINGetNumNonlinSolvIters, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nniters) end function KINGetNumFuncEvals(kinmem, nfevals) - ccall( - (:KINGetNumFuncEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nfevals, - ) + ccall((:KINGetNumFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) end function KINGetNumBetaCondFails(kinmem, nbcfails) - ccall( - (:KINGetNumBetaCondFails, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nbcfails, - ) + ccall((:KINGetNumBetaCondFails, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nbcfails) end function KINGetNumBacktrackOps(kinmem, nbacktr) - ccall( - (:KINGetNumBacktrackOps, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nbacktr, - ) + ccall((:KINGetNumBacktrackOps, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nbacktr) end function KINGetFuncNorm(kinmem, fnorm) - ccall( - (:KINGetFuncNorm, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{realtype}), - kinmem, - fnorm, - ) + ccall((:KINGetFuncNorm, libsundials_kinsol), Cint, (KINMemPtr, Ptr{realtype}), kinmem, fnorm) end function KINGetStepLength(kinmem, steplength) - ccall( - (:KINGetStepLength, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{realtype}), - kinmem, - steplength, - ) + ccall((:KINGetStepLength, libsundials_kinsol), Cint, (KINMemPtr, Ptr{realtype}), kinmem, steplength) end function KINGetReturnFlagName(flag::Clong) @@ -399,126 +217,44 @@ end # Julia wrapper for header: kinsol_bbdpre.h # Automatically generated using Clang.jl -function KINBBDPrecInit( - kinmem, - Nlocal::sunindextype, - mudq::sunindextype, - mldq::sunindextype, - mukeep::sunindextype, - mlkeep::sunindextype, - dq_rel_uu::realtype, - gloc::KINBBDLocalFn, - gcomm::KINBBDCommFn, -) - ccall( - (:KINBBDPrecInit, libsundials_kinsol), - Cint, - ( - KINMemPtr, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - sunindextype, - realtype, - KINBBDLocalFn, - KINBBDCommFn, - ), - kinmem, - Nlocal, - mudq, - mldq, - mukeep, - mlkeep, - dq_rel_uu, - gloc, - gcomm, - ) + +function KINBBDPrecInit(kinmem, Nlocal::sunindextype, mudq::sunindextype, mldq::sunindextype, mukeep::sunindextype, mlkeep::sunindextype, dq_rel_uu::realtype, gloc::KINBBDLocalFn, gcomm::KINBBDCommFn) + ccall((:KINBBDPrecInit, libsundials_kinsol), Cint, (KINMemPtr, sunindextype, sunindextype, sunindextype, sunindextype, sunindextype, realtype, KINBBDLocalFn, KINBBDCommFn), kinmem, Nlocal, mudq, mldq, mukeep, mlkeep, dq_rel_uu, gloc, gcomm) end function KINBBDPrecGetWorkSpace(kinmem, lenrwBBDP, leniwBBDP) - ccall( - (:KINBBDPrecGetWorkSpace, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}, Ptr{Clong}), - kinmem, - lenrwBBDP, - leniwBBDP, - ) + ccall((:KINBBDPrecGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrwBBDP, leniwBBDP) end function KINBBDPrecGetNumGfnEvals(kinmem, ngevalsBBDP) - ccall( - (:KINBBDPrecGetNumGfnEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - ngevalsBBDP, - ) + ccall((:KINBBDPrecGetNumGfnEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, ngevalsBBDP) end # Julia wrapper for header: kinsol_direct.h # Automatically generated using Clang.jl + function KINDlsSetLinearSolver(kinmem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:KINDlsSetLinearSolver, libsundials_kinsol), - Cint, - (KINMemPtr, SUNLinearSolver, SUNMatrix), - kinmem, - LS, - A, - ) + ccall((:KINDlsSetLinearSolver, libsundials_kinsol), Cint, (KINMemPtr, SUNLinearSolver, SUNMatrix), kinmem, LS, A) end function KINDlsSetJacFn(kinmem, jac::KINDlsJacFn) - ccall( - (:KINDlsSetJacFn, libsundials_kinsol), - Cint, - (KINMemPtr, KINDlsJacFn), - kinmem, - jac, - ) + ccall((:KINDlsSetJacFn, libsundials_kinsol), Cint, (KINMemPtr, KINDlsJacFn), kinmem, jac) end function KINDlsGetWorkSpace(kinmem, lenrw, leniw) - ccall( - (:KINDlsGetWorkSpace, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}, Ptr{Clong}), - kinmem, - lenrw, - leniw, - ) + ccall((:KINDlsGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrw, leniw) end function KINDlsGetNumJacEvals(kinmem, njevals) - ccall( - (:KINDlsGetNumJacEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - njevals, - ) + ccall((:KINDlsGetNumJacEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njevals) end function KINDlsGetNumFuncEvals(kinmem, nfevals) - ccall( - (:KINDlsGetNumFuncEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nfevals, - ) + ccall((:KINDlsGetNumFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) end function KINDlsGetLastFlag(kinmem, flag) - ccall( - (:KINDlsGetLastFlag, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - flag, - ) + ccall((:KINDlsGetLastFlag, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, flag) end function KINDlsGetReturnFlagName(flag::Clong) @@ -531,15 +267,9 @@ end # Julia wrapper for header: kinsol_ls.h # Automatically generated using Clang.jl + function KINSetLinearSolver(kinmem, LS::SUNLinearSolver, A::SUNMatrix) - ccall( - (:KINSetLinearSolver, libsundials_kinsol), - Cint, - (KINMemPtr, SUNLinearSolver, SUNMatrix), - kinmem, - LS, - A, - ) + ccall((:KINSetLinearSolver, libsundials_kinsol), Cint, (KINMemPtr, SUNLinearSolver, SUNMatrix), kinmem, LS, A) end function KINSetJacFn(kinmem, jac::KINLsJacFn) @@ -547,115 +277,47 @@ function KINSetJacFn(kinmem, jac::KINLsJacFn) end function KINSetPreconditioner(kinmem, psetup::KINLsPrecSetupFn, psolve::KINLsPrecSolveFn) - ccall( - (:KINSetPreconditioner, libsundials_kinsol), - Cint, - (KINMemPtr, KINLsPrecSetupFn, KINLsPrecSolveFn), - kinmem, - psetup, - psolve, - ) + ccall((:KINSetPreconditioner, libsundials_kinsol), Cint, (KINMemPtr, KINLsPrecSetupFn, KINLsPrecSolveFn), kinmem, psetup, psolve) end function KINSetJacTimesVecFn(kinmem, jtv::KINLsJacTimesVecFn) - ccall( - (:KINSetJacTimesVecFn, libsundials_kinsol), - Cint, - (KINMemPtr, KINLsJacTimesVecFn), - kinmem, - jtv, - ) + ccall((:KINSetJacTimesVecFn, libsundials_kinsol), Cint, (KINMemPtr, KINLsJacTimesVecFn), kinmem, jtv) end function KINGetLinWorkSpace(kinmem, lenrwLS, leniwLS) - ccall( - (:KINGetLinWorkSpace, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}, Ptr{Clong}), - kinmem, - lenrwLS, - leniwLS, - ) + ccall((:KINGetLinWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrwLS, leniwLS) end function KINGetNumJacEvals(kinmem, njevals) - ccall( - (:KINGetNumJacEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - njevals, - ) + ccall((:KINGetNumJacEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njevals) end function KINGetNumLinFuncEvals(kinmem, nfevals) - ccall( - (:KINGetNumLinFuncEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nfevals, - ) + ccall((:KINGetNumLinFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) end function KINGetNumPrecEvals(kinmem, npevals) - ccall( - (:KINGetNumPrecEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - npevals, - ) + ccall((:KINGetNumPrecEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npevals) end function KINGetNumPrecSolves(kinmem, npsolves) - ccall( - (:KINGetNumPrecSolves, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - npsolves, - ) + ccall((:KINGetNumPrecSolves, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npsolves) end function KINGetNumLinIters(kinmem, nliters) - ccall( - (:KINGetNumLinIters, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nliters, - ) + ccall((:KINGetNumLinIters, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nliters) end function KINGetNumLinConvFails(kinmem, nlcfails) - ccall( - (:KINGetNumLinConvFails, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nlcfails, - ) + ccall((:KINGetNumLinConvFails, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nlcfails) end function KINGetNumJtimesEvals(kinmem, njvevals) - ccall( - (:KINGetNumJtimesEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - njvevals, - ) + ccall((:KINGetNumJtimesEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njvevals) end function KINGetLastLinFlag(kinmem, flag) - ccall( - (:KINGetLastLinFlag, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - flag, - ) + ccall((:KINGetLastLinFlag, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, flag) end function KINGetLinReturnFlagName(flag::Clong) @@ -668,120 +330,49 @@ end # Julia wrapper for header: kinsol_spils.h # Automatically generated using Clang.jl + function KINSpilsSetLinearSolver(kinmem, LS::SUNLinearSolver) - ccall( - (:KINSpilsSetLinearSolver, libsundials_kinsol), - Cint, - (KINMemPtr, SUNLinearSolver), - kinmem, - LS, - ) -end - -function KINSpilsSetPreconditioner( - kinmem, - psetup::KINSpilsPrecSetupFn, - psolve::KINSpilsPrecSolveFn, -) - ccall( - (:KINSpilsSetPreconditioner, libsundials_kinsol), - Cint, - (KINMemPtr, KINSpilsPrecSetupFn, KINSpilsPrecSolveFn), - kinmem, - psetup, - psolve, - ) + ccall((:KINSpilsSetLinearSolver, libsundials_kinsol), Cint, (KINMemPtr, SUNLinearSolver), kinmem, LS) +end + +function KINSpilsSetPreconditioner(kinmem, psetup::KINSpilsPrecSetupFn, psolve::KINSpilsPrecSolveFn) + ccall((:KINSpilsSetPreconditioner, libsundials_kinsol), Cint, (KINMemPtr, KINSpilsPrecSetupFn, KINSpilsPrecSolveFn), kinmem, psetup, psolve) end function KINSpilsSetJacTimesVecFn(kinmem, jtv::KINSpilsJacTimesVecFn) - ccall( - (:KINSpilsSetJacTimesVecFn, libsundials_kinsol), - Cint, - (KINMemPtr, KINSpilsJacTimesVecFn), - kinmem, - jtv, - ) + ccall((:KINSpilsSetJacTimesVecFn, libsundials_kinsol), Cint, (KINMemPtr, KINSpilsJacTimesVecFn), kinmem, jtv) end function KINSpilsGetWorkSpace(kinmem, lenrwLS, leniwLS) - ccall( - (:KINSpilsGetWorkSpace, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}, Ptr{Clong}), - kinmem, - lenrwLS, - leniwLS, - ) + ccall((:KINSpilsGetWorkSpace, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}, Ptr{Clong}), kinmem, lenrwLS, leniwLS) end function KINSpilsGetNumPrecEvals(kinmem, npevals) - ccall( - (:KINSpilsGetNumPrecEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - npevals, - ) + ccall((:KINSpilsGetNumPrecEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npevals) end function KINSpilsGetNumPrecSolves(kinmem, npsolves) - ccall( - (:KINSpilsGetNumPrecSolves, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - npsolves, - ) + ccall((:KINSpilsGetNumPrecSolves, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, npsolves) end function KINSpilsGetNumLinIters(kinmem, nliters) - ccall( - (:KINSpilsGetNumLinIters, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nliters, - ) + ccall((:KINSpilsGetNumLinIters, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nliters) end function KINSpilsGetNumConvFails(kinmem, nlcfails) - ccall( - (:KINSpilsGetNumConvFails, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nlcfails, - ) + ccall((:KINSpilsGetNumConvFails, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nlcfails) end function KINSpilsGetNumJtimesEvals(kinmem, njvevals) - ccall( - (:KINSpilsGetNumJtimesEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - njvevals, - ) + ccall((:KINSpilsGetNumJtimesEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, njvevals) end function KINSpilsGetNumFuncEvals(kinmem, nfevals) - ccall( - (:KINSpilsGetNumFuncEvals, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - nfevals, - ) + ccall((:KINSpilsGetNumFuncEvals, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, nfevals) end function KINSpilsGetLastFlag(kinmem, flag) - ccall( - (:KINSpilsGetLastFlag, libsundials_kinsol), - Cint, - (KINMemPtr, Ptr{Clong}), - kinmem, - flag, - ) + ccall((:KINSpilsGetLastFlag, libsundials_kinsol), Cint, (KINMemPtr, Ptr{Clong}), kinmem, flag) end function KINSpilsGetReturnFlagName(flag::Clong) diff --git a/src/API/libsundials.jl b/src/API/libsundials.jl index a77ff706..a096cd52 100644 --- a/src/API/libsundials.jl +++ b/src/API/libsundials.jl @@ -19,14 +19,9 @@ # Julia wrapper for header: sundials_futils.h # Automatically generated using Clang.jl + function SUNDIALSFileOpen(filename, modes) - ccall( - (:SUNDIALSFileOpen, libsundials_sundials), - Ptr{FILE}, - (Cstring, Cstring), - filename, - modes, - ) + ccall((:SUNDIALSFileOpen, libsundials_sundials), Ptr{FILE}, (Cstring, Cstring), filename, modes) end function SUNDIALSFileClose(fp) @@ -41,6 +36,7 @@ end # Julia wrapper for header: sundials_linearsolver.h # Automatically generated using Clang.jl + function SUNLinSolNewEmpty() ccall((:SUNLinSolNewEmpty, libsundials_sundials), SUNLinearSolver, ()) end @@ -50,55 +46,23 @@ function SUNLinSolFreeEmpty(S::SUNLinearSolver) end function SUNLinSolGetType(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType, libsundials_sundials), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType, libsundials_sundials), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID, libsundials_sundials), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID, libsundials_sundials), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolSetATimes(S, A_data, ATimes::ATimesFn) - ccall( - (:SUNLinSolSetATimes, libsundials_sundials), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), - S, - A_data, - ATimes, - ) + ccall((:SUNLinSolSetATimes, libsundials_sundials), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) end function SUNLinSolSetPreconditioner(S, P_data, Pset::PSetupFn, Psol::PSolveFn) - ccall( - (:SUNLinSolSetPreconditioner, libsundials_sundials), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), - S, - P_data, - Pset, - Psol, - ) + ccall((:SUNLinSolSetPreconditioner, libsundials_sundials), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) end function SUNLinSolSetScalingVectors(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall( - (:SUNLinSolSetScalingVectors, libsundials_sundials), - Cint, - (SUNLinearSolver, N_Vector, N_Vector), - S, - s1, - s2, - ) + ccall((:SUNLinSolSetScalingVectors, libsundials_sundials), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) end function SUNLinSolSetScalingVectors(S, s1, s2) @@ -115,23 +79,8 @@ function SUNLinSolSetup(S::SUNLinearSolver, A::SUNMatrix) ccall((:SUNLinSolSetup, libsundials_sundials), Cint, (SUNLinearSolver, SUNMatrix), S, A) end -function SUNLinSolSolve( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve, libsundials_sundials), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) +function SUNLinSolSolve(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve, libsundials_sundials), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve(S, A, x, b, tol) @@ -157,14 +106,7 @@ function SUNLinSolLastFlag(S::SUNLinearSolver) end function SUNLinSolSpace(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace, libsundials_sundials), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace, libsundials_sundials), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree(S::SUNLinearSolver) @@ -173,6 +115,7 @@ end # Julia wrapper for header: sundials_math.h # Automatically generated using Clang.jl + function SUNRpowerI(base::realtype, exponent::Cint) ccall((:SUNRpowerI, libsundials_sundials), realtype, (realtype, Cint), base, exponent) end @@ -182,13 +125,7 @@ function SUNRpowerI(base::realtype, exponent) end function SUNRpowerR(base::realtype, exponent::Cint) - ccall( - (:SUNRpowerR, libsundials_sundials), - realtype, - (realtype, realtype), - base, - exponent, - ) + ccall((:SUNRpowerR, libsundials_sundials), realtype, (realtype, realtype), base, exponent) end function SUNRpowerR(base::realtype, exponent) @@ -197,6 +134,7 @@ end # Julia wrapper for header: sundials_matrix.h # Automatically generated using Clang.jl + function SUNMatNewEmpty() ccall((:SUNMatNewEmpty, libsundials_sundials), SUNMatrix, ()) end @@ -230,14 +168,7 @@ function SUNMatCopy(A::SUNMatrix, B::SUNMatrix) end function SUNMatScaleAdd(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall( - (:SUNMatScaleAdd, libsundials_sundials), - Cint, - (realtype, SUNMatrix, SUNMatrix), - c, - A, - B, - ) + ccall((:SUNMatScaleAdd, libsundials_sundials), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) end function SUNMatScaleAddI(c::realtype, A::SUNMatrix) @@ -249,14 +180,7 @@ function SUNMatMatvecSetup(A::SUNMatrix) end function SUNMatMatvec(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall( - (:SUNMatMatvec, libsundials_sundials), - Cint, - (SUNMatrix, N_Vector, N_Vector), - A, - x, - y, - ) + ccall((:SUNMatMatvec, libsundials_sundials), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) end function SUNMatMatvec(A, x, y) @@ -266,14 +190,7 @@ function SUNMatMatvec(A, x, y) end function SUNMatSpace(A::SUNMatrix, lenrw, leniw) - ccall( - (:SUNMatSpace, libsundials_sundials), - Cint, - (SUNMatrix, Ptr{Clong}, Ptr{Clong}), - A, - lenrw, - leniw, - ) + ccall((:SUNMatSpace, libsundials_sundials), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) end # Julia wrapper for header: sundials_mpi_types.h # Automatically generated using Clang.jl @@ -281,6 +198,7 @@ end # Julia wrapper for header: sundials_nonlinearsolver.h # Automatically generated using Clang.jl + function SUNNonlinSolNewEmpty() ccall((:SUNNonlinSolNewEmpty, libsundials_sundials), SUNNonlinearSolver, ()) end @@ -290,12 +208,7 @@ function SUNNonlinSolFreeEmpty(NLS::SUNNonlinearSolver) end function SUNNonlinSolGetType(NLS::SUNNonlinearSolver) - ccall( - (:SUNNonlinSolGetType, libsundials_sundials), - SUNNonlinearSolver_Type, - (SUNNonlinearSolver,), - NLS, - ) + ccall((:SUNNonlinSolGetType, libsundials_sundials), SUNNonlinearSolver_Type, (SUNNonlinearSolver,), NLS) end function SUNNonlinSolInitialize(NLS::SUNNonlinearSolver) @@ -303,14 +216,7 @@ function SUNNonlinSolInitialize(NLS::SUNNonlinearSolver) end function SUNNonlinSolSetup(NLS::SUNNonlinearSolver, y::N_Vector, mem) - ccall( - (:SUNNonlinSolSetup, libsundials_sundials), - Cint, - (SUNNonlinearSolver, N_Vector, Ptr{Cvoid}), - NLS, - y, - mem, - ) + ccall((:SUNNonlinSolSetup, libsundials_sundials), Cint, (SUNNonlinearSolver, N_Vector, Ptr{Cvoid}), NLS, y, mem) end function SUNNonlinSolSetup(NLS, y, mem) @@ -318,42 +224,15 @@ function SUNNonlinSolSetup(NLS, y, mem) SUNNonlinSolSetup(NLS, convert(N_Vector, __y), mem) end -function SUNNonlinSolSolve( - NLS::SUNNonlinearSolver, - y0::N_Vector, - y::N_Vector, - w::N_Vector, - tol::realtype, - callLSetup::Cint, - mem, -) - ccall( - (:SUNNonlinSolSolve, libsundials_sundials), - Cint, - (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), - NLS, - y0, - y, - w, - tol, - callLSetup, - mem, - ) +function SUNNonlinSolSolve(NLS::SUNNonlinearSolver, y0::N_Vector, y::N_Vector, w::N_Vector, tol::realtype, callLSetup::Cint, mem) + ccall((:SUNNonlinSolSolve, libsundials_sundials), Cint, (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), NLS, y0, y, w, tol, callLSetup, mem) end function SUNNonlinSolSolve(NLS, y0, y, w, tol, callLSetup, mem) __y0 = convert(NVector, y0) __y = convert(NVector, y) __w = convert(NVector, w) - SUNNonlinSolSolve( - NLS, - convert(N_Vector, __y0), - convert(N_Vector, __y), - convert(N_Vector, __w), - tol, - convert(Cint, callLSetup), - mem, - ) + SUNNonlinSolSolve(NLS, convert(N_Vector, __y0), convert(N_Vector, __y), convert(N_Vector, __w), tol, convert(Cint, callLSetup), mem) end function SUNNonlinSolFree(NLS::SUNNonlinearSolver) @@ -361,58 +240,23 @@ function SUNNonlinSolFree(NLS::SUNNonlinearSolver) end function SUNNonlinSolSetSysFn(NLS::SUNNonlinearSolver, SysFn::SUNNonlinSolSysFn) - ccall( - (:SUNNonlinSolSetSysFn, libsundials_sundials), - Cint, - (SUNNonlinearSolver, SUNNonlinSolSysFn), - NLS, - SysFn, - ) + ccall((:SUNNonlinSolSetSysFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolSysFn), NLS, SysFn) end function SUNNonlinSolSetLSetupFn(NLS::SUNNonlinearSolver, SetupFn::SUNNonlinSolLSetupFn) - ccall( - (:SUNNonlinSolSetLSetupFn, libsundials_sundials), - Cint, - (SUNNonlinearSolver, SUNNonlinSolLSetupFn), - NLS, - SetupFn, - ) + ccall((:SUNNonlinSolSetLSetupFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolLSetupFn), NLS, SetupFn) end function SUNNonlinSolSetLSolveFn(NLS::SUNNonlinearSolver, SolveFn::SUNNonlinSolLSolveFn) - ccall( - (:SUNNonlinSolSetLSolveFn, libsundials_sundials), - Cint, - (SUNNonlinearSolver, SUNNonlinSolLSolveFn), - NLS, - SolveFn, - ) -end - -function SUNNonlinSolSetConvTestFn( - NLS::SUNNonlinearSolver, - CTestFn::SUNNonlinSolConvTestFn, - ctest_data, -) - ccall( - (:SUNNonlinSolSetConvTestFn, libsundials_sundials), - Cint, - (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), - NLS, - CTestFn, - ctest_data, - ) + ccall((:SUNNonlinSolSetLSolveFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolLSolveFn), NLS, SolveFn) +end + +function SUNNonlinSolSetConvTestFn(NLS::SUNNonlinearSolver, CTestFn::SUNNonlinSolConvTestFn, ctest_data) + ccall((:SUNNonlinSolSetConvTestFn, libsundials_sundials), Cint, (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), NLS, CTestFn, ctest_data) end function SUNNonlinSolSetMaxIters(NLS::SUNNonlinearSolver, maxiters::Cint) - ccall( - (:SUNNonlinSolSetMaxIters, libsundials_sundials), - Cint, - (SUNNonlinearSolver, Cint), - NLS, - maxiters, - ) + ccall((:SUNNonlinSolSetMaxIters, libsundials_sundials), Cint, (SUNNonlinearSolver, Cint), NLS, maxiters) end function SUNNonlinSolSetMaxIters(NLS, maxiters) @@ -420,37 +264,20 @@ function SUNNonlinSolSetMaxIters(NLS, maxiters) end function SUNNonlinSolGetNumIters(NLS::SUNNonlinearSolver, niters) - ccall( - (:SUNNonlinSolGetNumIters, libsundials_sundials), - Cint, - (SUNNonlinearSolver, Ptr{Clong}), - NLS, - niters, - ) + ccall((:SUNNonlinSolGetNumIters, libsundials_sundials), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, niters) end function SUNNonlinSolGetCurIter(NLS::SUNNonlinearSolver, iter) - ccall( - (:SUNNonlinSolGetCurIter, libsundials_sundials), - Cint, - (SUNNonlinearSolver, Ptr{Cint}), - NLS, - iter, - ) + ccall((:SUNNonlinSolGetCurIter, libsundials_sundials), Cint, (SUNNonlinearSolver, Ptr{Cint}), NLS, iter) end function SUNNonlinSolGetNumConvFails(NLS::SUNNonlinearSolver, nconvfails) - ccall( - (:SUNNonlinSolGetNumConvFails, libsundials_sundials), - Cint, - (SUNNonlinearSolver, Ptr{Clong}), - NLS, - nconvfails, - ) + ccall((:SUNNonlinSolGetNumConvFails, libsundials_sundials), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, nconvfails) end # Julia wrapper for header: sundials_nvector.h # Automatically generated using Clang.jl + function N_VNewEmpty() ccall((:N_VNewEmpty, libsundials_sundials), N_Vector, ()) end @@ -511,14 +338,7 @@ function N_VDestroy(v) end function N_VSpace(v::N_Vector, lrw, liw) - ccall( - (:N_VSpace, libsundials_sundials), - Cvoid, - (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), - v, - lrw, - liw, - ) + ccall((:N_VSpace, libsundials_sundials), Cvoid, (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), v, lrw, liw) end function N_VSpace(v, lrw, liw) @@ -536,13 +356,7 @@ function N_VGetArrayPointer(v) end function N_VSetArrayPointer(v_data, v::N_Vector) - ccall( - (:N_VSetArrayPointer, libsundials_sundials), - Cvoid, - (Ptr{realtype}, N_Vector), - v_data, - v, - ) + ccall((:N_VSetArrayPointer, libsundials_sundials), Cvoid, (Ptr{realtype}, N_Vector), v_data, v) end function N_VSetArrayPointer(v_data, v) @@ -569,29 +383,14 @@ function N_VGetLength(v) end function N_VLinearSum(a::realtype, x::N_Vector, b::realtype, y::N_Vector, z::N_Vector) - ccall( - (:N_VLinearSum, libsundials_sundials), - Cvoid, - (realtype, N_Vector, realtype, N_Vector, N_Vector), - a, - x, - b, - y, - z, - ) + ccall((:N_VLinearSum, libsundials_sundials), Cvoid, (realtype, N_Vector, realtype, N_Vector, N_Vector), a, x, b, y, z) end function N_VLinearSum(a, x, b, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VLinearSum( - a, - convert(N_Vector, __x), - b, - convert(N_Vector, __y), - convert(N_Vector, __z), - ) + N_VLinearSum(a, convert(N_Vector, __x), b, convert(N_Vector, __y), convert(N_Vector, __z)) end function N_VConst(c::realtype, z::N_Vector) @@ -656,14 +455,7 @@ function N_VInv(x, z) end function N_VAddConst(x::N_Vector, b::realtype, z::N_Vector) - ccall( - (:N_VAddConst, libsundials_sundials), - Cvoid, - (N_Vector, realtype, N_Vector), - x, - b, - z, - ) + ccall((:N_VAddConst, libsundials_sundials), Cvoid, (N_Vector, realtype, N_Vector), x, b, z) end function N_VAddConst(x, b, z) @@ -702,14 +494,7 @@ function N_VWrmsNorm(x, w) end function N_VWrmsNormMask(x::N_Vector, w::N_Vector, id::N_Vector) - ccall( - (:N_VWrmsNormMask, libsundials_sundials), - realtype, - (N_Vector, N_Vector, N_Vector), - x, - w, - id, - ) + ccall((:N_VWrmsNormMask, libsundials_sundials), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) end function N_VWrmsNormMask(x, w, id) @@ -748,14 +533,7 @@ function N_VL1Norm(x) end function N_VCompare(c::realtype, x::N_Vector, z::N_Vector) - ccall( - (:N_VCompare, libsundials_sundials), - Cvoid, - (realtype, N_Vector, N_Vector), - c, - x, - z, - ) + ccall((:N_VCompare, libsundials_sundials), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) end function N_VCompare(c, x, z) @@ -775,14 +553,7 @@ function N_VInvTest(x, z) end function N_VConstrMask(c::N_Vector, x::N_Vector, m::N_Vector) - ccall( - (:N_VConstrMask, libsundials_sundials), - Cint, - (N_Vector, N_Vector, N_Vector), - c, - x, - m, - ) + ccall((:N_VConstrMask, libsundials_sundials), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) end function N_VConstrMask(c, x, m) @@ -793,13 +564,7 @@ function N_VConstrMask(c, x, m) end function N_VMinQuotient(num::N_Vector, denom::N_Vector) - ccall( - (:N_VMinQuotient, libsundials_sundials), - realtype, - (N_Vector, N_Vector), - num, - denom, - ) + ccall((:N_VMinQuotient, libsundials_sundials), realtype, (N_Vector, N_Vector), num, denom) end function N_VMinQuotient(num, denom) @@ -809,15 +574,7 @@ function N_VMinQuotient(num, denom) end function N_VLinearCombination(nvec::Cint, c, X, z) - ccall( - (:N_VLinearCombination, libsundials_sundials), - Cint, - (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), - nvec, - c, - X, - z, - ) + ccall((:N_VLinearCombination, libsundials_sundials), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), nvec, c, X, z) end function N_VLinearCombination(nvec, c, X, z) @@ -825,16 +582,7 @@ function N_VLinearCombination(nvec, c, X, z) end function N_VScaleAddMulti(nvec::Cint, a, x::N_Vector, Y, Z) - ccall( - (:N_VScaleAddMulti, libsundials_sundials), - Cint, - (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - a, - x, - Y, - Z, - ) + ccall((:N_VScaleAddMulti, libsundials_sundials), Cint, (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, x, Y, Z) end function N_VScaleAddMulti(nvec, a, x, Y, Z) @@ -843,15 +591,7 @@ function N_VScaleAddMulti(nvec, a, x, Y, Z) end function N_VDotProdMulti(nvec::Cint, x::N_Vector, Y, dotprods) - ccall( - (:N_VDotProdMulti, libsundials_sundials), - Cint, - (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), - nvec, - x, - Y, - dotprods, - ) + ccall((:N_VDotProdMulti, libsundials_sundials), Cint, (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), nvec, x, Y, dotprods) end function N_VDotProdMulti(nvec, x, Y, dotprods) @@ -860,17 +600,7 @@ function N_VDotProdMulti(nvec, x, Y, dotprods) end function N_VLinearSumVectorArray(nvec::Cint, a::realtype, X, b::realtype, Y, Z) - ccall( - (:N_VLinearSumVectorArray, libsundials_sundials), - Cint, - (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - a, - X, - b, - Y, - Z, - ) + ccall((:N_VLinearSumVectorArray, libsundials_sundials), Cint, (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, X, b, Y, Z) end function N_VLinearSumVectorArray(nvec, a, X, b, Y, Z) @@ -878,15 +608,7 @@ function N_VLinearSumVectorArray(nvec, a, X, b, Y, Z) end function N_VScaleVectorArray(nvec::Cint, c, X, Z) - ccall( - (:N_VScaleVectorArray, libsundials_sundials), - Cint, - (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - c, - X, - Z, - ) + ccall((:N_VScaleVectorArray, libsundials_sundials), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), nvec, c, X, Z) end function N_VScaleVectorArray(nvec, c, X, Z) @@ -894,14 +616,7 @@ function N_VScaleVectorArray(nvec, c, X, Z) end function N_VConstVectorArray(nvec::Cint, c::realtype, Z) - ccall( - (:N_VConstVectorArray, libsundials_sundials), - Cint, - (Cint, realtype, Ptr{N_Vector}), - nvec, - c, - Z, - ) + ccall((:N_VConstVectorArray, libsundials_sundials), Cint, (Cint, realtype, Ptr{N_Vector}), nvec, c, Z) end function N_VConstVectorArray(nvec, c, Z) @@ -909,15 +624,7 @@ function N_VConstVectorArray(nvec, c, Z) end function N_VWrmsNormVectorArray(nvec::Cint, X, W, nrm) - ccall( - (:N_VWrmsNormVectorArray, libsundials_sundials), - Cint, - (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), - nvec, - X, - W, - nrm, - ) + ccall((:N_VWrmsNormVectorArray, libsundials_sundials), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), nvec, X, W, nrm) end function N_VWrmsNormVectorArray(nvec, X, W, nrm) @@ -925,16 +632,7 @@ function N_VWrmsNormVectorArray(nvec, X, W, nrm) end function N_VWrmsNormMaskVectorArray(nvec::Cint, X, W, id::N_Vector, nrm) - ccall( - (:N_VWrmsNormMaskVectorArray, libsundials_sundials), - Cint, - (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), - nvec, - X, - W, - id, - nrm, - ) + ccall((:N_VWrmsNormMaskVectorArray, libsundials_sundials), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), nvec, X, W, id, nrm) end function N_VWrmsNormMaskVectorArray(nvec, X, W, id, nrm) @@ -943,17 +641,7 @@ function N_VWrmsNormMaskVectorArray(nvec, X, W, id, nrm) end function N_VScaleAddMultiVectorArray(nvec::Cint, nsum::Cint, a, X, Y, Z) - ccall( - (:N_VScaleAddMultiVectorArray, libsundials_sundials), - Cint, - (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), - nvec, - nsum, - a, - X, - Y, - Z, - ) + ccall((:N_VScaleAddMultiVectorArray, libsundials_sundials), Cint, (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), nvec, nsum, a, X, Y, Z) end function N_VScaleAddMultiVectorArray(nvec, nsum, a, X, Y, Z) @@ -961,16 +649,7 @@ function N_VScaleAddMultiVectorArray(nvec, nsum, a, X, Y, Z) end function N_VLinearCombinationVectorArray(nvec::Cint, nsum::Cint, c, X, Z) - ccall( - (:N_VLinearCombinationVectorArray, libsundials_sundials), - Cint, - (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), - nvec, - nsum, - c, - X, - Z, - ) + ccall((:N_VLinearCombinationVectorArray, libsundials_sundials), Cint, (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), nvec, nsum, c, X, Z) end function N_VLinearCombinationVectorArray(nvec, nsum, c, X, Z) @@ -1025,25 +704,14 @@ function N_VWSqrSumLocal(x, w) end function N_VWSqrSumMaskLocal(x::N_Vector, w::N_Vector, id::N_Vector) - ccall( - (:N_VWSqrSumMaskLocal, libsundials_sundials), - realtype, - (N_Vector, N_Vector, N_Vector), - x, - w, - id, - ) + ccall((:N_VWSqrSumMaskLocal, libsundials_sundials), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) end function N_VWSqrSumMaskLocal(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWSqrSumMaskLocal( - convert(N_Vector, __x), - convert(N_Vector, __w), - convert(N_Vector, __id), - ) + N_VWSqrSumMaskLocal(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) end function N_VInvTestLocal(x::N_Vector, z::N_Vector) @@ -1057,35 +725,18 @@ function N_VInvTestLocal(x, z) end function N_VConstrMaskLocal(c::N_Vector, x::N_Vector, m::N_Vector) - ccall( - (:N_VConstrMaskLocal, libsundials_sundials), - Cint, - (N_Vector, N_Vector, N_Vector), - c, - x, - m, - ) + ccall((:N_VConstrMaskLocal, libsundials_sundials), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) end function N_VConstrMaskLocal(c, x, m) __c = convert(NVector, c) __x = convert(NVector, x) __m = convert(NVector, m) - N_VConstrMaskLocal( - convert(N_Vector, __c), - convert(N_Vector, __x), - convert(N_Vector, __m), - ) + N_VConstrMaskLocal(convert(N_Vector, __c), convert(N_Vector, __x), convert(N_Vector, __m)) end function N_VMinQuotientLocal(num::N_Vector, denom::N_Vector) - ccall( - (:N_VMinQuotientLocal, libsundials_sundials), - realtype, - (N_Vector, N_Vector), - num, - denom, - ) + ccall((:N_VMinQuotientLocal, libsundials_sundials), realtype, (N_Vector, N_Vector), num, denom) end function N_VMinQuotientLocal(num, denom) @@ -1103,13 +754,7 @@ function N_VNewVectorArray(count) end function N_VCloneEmptyVectorArray(count::Cint, w::N_Vector) - ccall( - (:N_VCloneEmptyVectorArray, libsundials_sundials), - Ptr{N_Vector}, - (Cint, N_Vector), - count, - w, - ) + ccall((:N_VCloneEmptyVectorArray, libsundials_sundials), Ptr{N_Vector}, (Cint, N_Vector), count, w) end function N_VCloneEmptyVectorArray(count, w) @@ -1118,13 +763,7 @@ function N_VCloneEmptyVectorArray(count, w) end function N_VCloneVectorArray(count::Cint, w::N_Vector) - ccall( - (:N_VCloneVectorArray, libsundials_sundials), - Ptr{N_Vector}, - (Cint, N_Vector), - count, - w, - ) + ccall((:N_VCloneVectorArray, libsundials_sundials), Ptr{N_Vector}, (Cint, N_Vector), count, w) end function N_VCloneVectorArray(count, w) @@ -1133,13 +772,7 @@ function N_VCloneVectorArray(count, w) end function N_VDestroyVectorArray(vs, count::Cint) - ccall( - (:N_VDestroyVectorArray, libsundials_sundials), - Cvoid, - (Ptr{N_Vector}, Cint), - vs, - count, - ) + ccall((:N_VDestroyVectorArray, libsundials_sundials), Cvoid, (Ptr{N_Vector}, Cint), vs, count) end function N_VDestroyVectorArray(vs, count) @@ -1147,13 +780,7 @@ function N_VDestroyVectorArray(vs, count) end function N_VGetVecAtIndexVectorArray(vs, index::Cint) - ccall( - (:N_VGetVecAtIndexVectorArray, libsundials_sundials), - N_Vector, - (Ptr{N_Vector}, Cint), - vs, - index, - ) + ccall((:N_VGetVecAtIndexVectorArray, libsundials_sundials), N_Vector, (Ptr{N_Vector}, Cint), vs, index) end function N_VGetVecAtIndexVectorArray(vs, index) @@ -1161,14 +788,7 @@ function N_VGetVecAtIndexVectorArray(vs, index) end function N_VSetVecAtIndexVectorArray(vs, index::Cint, w::N_Vector) - ccall( - (:N_VSetVecAtIndexVectorArray, libsundials_sundials), - Cvoid, - (Ptr{N_Vector}, Cint, N_Vector), - vs, - index, - w, - ) + ccall((:N_VSetVecAtIndexVectorArray, libsundials_sundials), Cvoid, (Ptr{N_Vector}, Cint, N_Vector), vs, index, w) end function N_VSetVecAtIndexVectorArray(vs, index, w) @@ -1181,6 +801,7 @@ end # Julia wrapper for header: sundials_version.h # Automatically generated using Clang.jl + function SUNDIALSGetVersion(version, len::Cint) ccall((:SUNDIALSGetVersion, libsundials_sundials), Cint, (Cstring, Cint), version, len) end @@ -1190,16 +811,7 @@ function SUNDIALSGetVersion(version, len) end function SUNDIALSGetVersionNumber(major, minor, patch, label, len::Cint) - ccall( - (:SUNDIALSGetVersionNumber, libsundials_sundials), - Cint, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cstring, Cint), - major, - minor, - patch, - label, - len, - ) + ccall((:SUNDIALSGetVersionNumber, libsundials_sundials), Cint, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cstring, Cint), major, minor, patch, label, len) end function SUNDIALSGetVersionNumber(major, minor, patch, label, len) diff --git a/src/API/nvector.jl b/src/API/nvector.jl index 2c0c7fc0..d8f6a4af 100644 --- a/src/API/nvector.jl +++ b/src/API/nvector.jl @@ -1,24 +1,13 @@ # Julia wrapper for header: nvector_manyvector.h # Automatically generated using Clang.jl + function N_VNew_ManyVector(num_subvectors::sunindextype, vec_array) - ccall( - (:N_VNew_ManyVector, libsundials_nvecserial), - N_Vector, - (sunindextype, Ptr{N_Vector}), - num_subvectors, - vec_array, - ) + ccall((:N_VNew_ManyVector, libsundials_nvecserial), N_Vector, (sunindextype, Ptr{N_Vector}), num_subvectors, vec_array) end function N_VGetSubvector_ManyVector(v::N_Vector, vec_num::sunindextype) - ccall( - (:N_VGetSubvector_ManyVector, libsundials_nvecserial), - N_Vector, - (N_Vector, sunindextype), - v, - vec_num, - ) + ccall((:N_VGetSubvector_ManyVector, libsundials_nvecserial), N_Vector, (N_Vector, sunindextype), v, vec_num) end function N_VGetSubvector_ManyVector(v, vec_num) @@ -27,13 +16,7 @@ function N_VGetSubvector_ManyVector(v, vec_num) end function N_VGetSubvectorArrayPointer_ManyVector(v::N_Vector, vec_num::sunindextype) - ccall( - (:N_VGetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), - Ptr{realtype}, - (N_Vector, sunindextype), - v, - vec_num, - ) + ccall((:N_VGetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), Ptr{realtype}, (N_Vector, sunindextype), v, vec_num) end function N_VGetSubvectorArrayPointer_ManyVector(v, vec_num) @@ -42,14 +25,7 @@ function N_VGetSubvectorArrayPointer_ManyVector(v, vec_num) end function N_VSetSubvectorArrayPointer_ManyVector(v_data, v::N_Vector, vec_num::sunindextype) - ccall( - (:N_VSetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), - Cint, - (Ptr{realtype}, N_Vector, sunindextype), - v_data, - v, - vec_num, - ) + ccall((:N_VSetSubvectorArrayPointer_ManyVector, libsundials_nvecserial), Cint, (Ptr{realtype}, N_Vector, sunindextype), v_data, v, vec_num) end function N_VSetSubvectorArrayPointer_ManyVector(v_data, v, vec_num) @@ -58,12 +34,7 @@ function N_VSetSubvectorArrayPointer_ManyVector(v_data, v, vec_num) end function N_VGetNumSubvectors_ManyVector(v::N_Vector) - ccall( - (:N_VGetNumSubvectors_ManyVector, libsundials_nvecserial), - sunindextype, - (N_Vector,), - v, - ) + ccall((:N_VGetNumSubvectors_ManyVector, libsundials_nvecserial), sunindextype, (N_Vector,), v) end function N_VGetNumSubvectors_ManyVector(v) @@ -108,14 +79,7 @@ function N_VDestroy_ManyVector(v) end function N_VSpace_ManyVector(v::N_Vector, lrw, liw) - ccall( - (:N_VSpace_ManyVector, libsundials_nvecserial), - Cvoid, - (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), - v, - lrw, - liw, - ) + ccall((:N_VSpace_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), v, lrw, liw) end function N_VSpace_ManyVector(v, lrw, liw) @@ -132,36 +96,15 @@ function N_VGetLength_ManyVector(v) N_VGetLength_ManyVector(convert(N_Vector, __v)) end -function N_VLinearSum_ManyVector( - a::realtype, - x::N_Vector, - b::realtype, - y::N_Vector, - z::N_Vector, -) - ccall( - (:N_VLinearSum_ManyVector, libsundials_nvecserial), - Cvoid, - (realtype, N_Vector, realtype, N_Vector, N_Vector), - a, - x, - b, - y, - z, - ) +function N_VLinearSum_ManyVector(a::realtype, x::N_Vector, b::realtype, y::N_Vector, z::N_Vector) + ccall((:N_VLinearSum_ManyVector, libsundials_nvecserial), Cvoid, (realtype, N_Vector, realtype, N_Vector, N_Vector), a, x, b, y, z) end function N_VLinearSum_ManyVector(a, x, b, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VLinearSum_ManyVector( - a, - convert(N_Vector, __x), - b, - convert(N_Vector, __y), - convert(N_Vector, __z), - ) + N_VLinearSum_ManyVector(a, convert(N_Vector, __x), b, convert(N_Vector, __y), convert(N_Vector, __z)) end function N_VConst_ManyVector(c::realtype, z::N_Vector) @@ -174,58 +117,29 @@ function N_VConst_ManyVector(c, z) end function N_VProd_ManyVector(x::N_Vector, y::N_Vector, z::N_Vector) - ccall( - (:N_VProd_ManyVector, libsundials_nvecserial), - Cvoid, - (N_Vector, N_Vector, N_Vector), - x, - y, - z, - ) + ccall((:N_VProd_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) end function N_VProd_ManyVector(x, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VProd_ManyVector( - convert(N_Vector, __x), - convert(N_Vector, __y), - convert(N_Vector, __z), - ) + N_VProd_ManyVector(convert(N_Vector, __x), convert(N_Vector, __y), convert(N_Vector, __z)) end function N_VDiv_ManyVector(x::N_Vector, y::N_Vector, z::N_Vector) - ccall( - (:N_VDiv_ManyVector, libsundials_nvecserial), - Cvoid, - (N_Vector, N_Vector, N_Vector), - x, - y, - z, - ) + ccall((:N_VDiv_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) end function N_VDiv_ManyVector(x, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VDiv_ManyVector( - convert(N_Vector, __x), - convert(N_Vector, __y), - convert(N_Vector, __z), - ) + N_VDiv_ManyVector(convert(N_Vector, __x), convert(N_Vector, __y), convert(N_Vector, __z)) end function N_VScale_ManyVector(c::realtype, x::N_Vector, z::N_Vector) - ccall( - (:N_VScale_ManyVector, libsundials_nvecserial), - Cvoid, - (realtype, N_Vector, N_Vector), - c, - x, - z, - ) + ccall((:N_VScale_ManyVector, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) end function N_VScale_ManyVector(c, x, z) @@ -255,14 +169,7 @@ function N_VInv_ManyVector(x, z) end function N_VAddConst_ManyVector(x::N_Vector, b::realtype, z::N_Vector) - ccall( - (:N_VAddConst_ManyVector, libsundials_nvecserial), - Cvoid, - (N_Vector, realtype, N_Vector), - x, - b, - z, - ) + ccall((:N_VAddConst_ManyVector, libsundials_nvecserial), Cvoid, (N_Vector, realtype, N_Vector), x, b, z) end function N_VAddConst_ManyVector(x, b, z) @@ -272,13 +179,7 @@ function N_VAddConst_ManyVector(x, b, z) end function N_VWrmsNorm_ManyVector(x::N_Vector, w::N_Vector) - ccall( - (:N_VWrmsNorm_ManyVector, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - w, - ) + ccall((:N_VWrmsNorm_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) end function N_VWrmsNorm_ManyVector(x, w) @@ -288,35 +189,18 @@ function N_VWrmsNorm_ManyVector(x, w) end function N_VWrmsNormMask_ManyVector(x::N_Vector, w::N_Vector, id::N_Vector) - ccall( - (:N_VWrmsNormMask_ManyVector, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector, N_Vector), - x, - w, - id, - ) + ccall((:N_VWrmsNormMask_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) end function N_VWrmsNormMask_ManyVector(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWrmsNormMask_ManyVector( - convert(N_Vector, __x), - convert(N_Vector, __w), - convert(N_Vector, __id), - ) + N_VWrmsNormMask_ManyVector(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) end function N_VWL2Norm_ManyVector(x::N_Vector, w::N_Vector) - ccall( - (:N_VWL2Norm_ManyVector, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - w, - ) + ccall((:N_VWL2Norm_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) end function N_VWL2Norm_ManyVector(x, w) @@ -326,14 +210,7 @@ function N_VWL2Norm_ManyVector(x, w) end function N_VCompare_ManyVector(c::realtype, x::N_Vector, z::N_Vector) - ccall( - (:N_VCompare_ManyVector, libsundials_nvecserial), - Cvoid, - (realtype, N_Vector, N_Vector), - c, - x, - z, - ) + ccall((:N_VCompare_ManyVector, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) end function N_VCompare_ManyVector(c, x, z) @@ -343,15 +220,7 @@ function N_VCompare_ManyVector(c, x, z) end function N_VLinearCombination_ManyVector(nvec::Cint, c, V, z::N_Vector) - ccall( - (:N_VLinearCombination_ManyVector, libsundials_nvecserial), - Cint, - (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), - nvec, - c, - V, - z, - ) + ccall((:N_VLinearCombination_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), nvec, c, V, z) end function N_VLinearCombination_ManyVector(nvec, c, V, z) @@ -360,16 +229,7 @@ function N_VLinearCombination_ManyVector(nvec, c, V, z) end function N_VScaleAddMulti_ManyVector(nvec::Cint, a, x::N_Vector, Y, Z) - ccall( - (:N_VScaleAddMulti_ManyVector, libsundials_nvecserial), - Cint, - (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - a, - x, - Y, - Z, - ) + ccall((:N_VScaleAddMulti_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, x, Y, Z) end function N_VScaleAddMulti_ManyVector(nvec, a, x, Y, Z) @@ -378,15 +238,7 @@ function N_VScaleAddMulti_ManyVector(nvec, a, x, Y, Z) end function N_VDotProdMulti_ManyVector(nvec::Cint, x::N_Vector, Y, dotprods) - ccall( - (:N_VDotProdMulti_ManyVector, libsundials_nvecserial), - Cint, - (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), - nvec, - x, - Y, - dotprods, - ) + ccall((:N_VDotProdMulti_ManyVector, libsundials_nvecserial), Cint, (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), nvec, x, Y, dotprods) end function N_VDotProdMulti_ManyVector(nvec, x, Y, dotprods) @@ -395,17 +247,7 @@ function N_VDotProdMulti_ManyVector(nvec, x, Y, dotprods) end function N_VLinearSumVectorArray_ManyVector(nvec::Cint, a::realtype, X, b::realtype, Y, Z) - ccall( - (:N_VLinearSumVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - a, - X, - b, - Y, - Z, - ) + ccall((:N_VLinearSumVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, X, b, Y, Z) end function N_VLinearSumVectorArray_ManyVector(nvec, a, X, b, Y, Z) @@ -413,15 +255,7 @@ function N_VLinearSumVectorArray_ManyVector(nvec, a, X, b, Y, Z) end function N_VScaleVectorArray_ManyVector(nvec::Cint, c::realtype, X, Z) - ccall( - (:N_VScaleVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - c, - X, - Z, - ) + ccall((:N_VScaleVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), nvec, c, X, Z) end function N_VScaleVectorArray_ManyVector(nvec, c, X, Z) @@ -429,14 +263,7 @@ function N_VScaleVectorArray_ManyVector(nvec, c, X, Z) end function N_VConstVectorArray_ManyVector(nvecs::Cint, c::realtype, Z) - ccall( - (:N_VConstVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (Cint, realtype, Ptr{N_Vector}), - nvecs, - c, - Z, - ) + ccall((:N_VConstVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}), nvecs, c, Z) end function N_VConstVectorArray_ManyVector(nvecs, c, Z) @@ -444,15 +271,7 @@ function N_VConstVectorArray_ManyVector(nvecs, c, Z) end function N_VWrmsNormVectorArray_ManyVector(nvecs::Cint, X, W, nrm) - ccall( - (:N_VWrmsNormVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), - nvecs, - X, - W, - nrm, - ) + ccall((:N_VWrmsNormVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), nvecs, X, W, nrm) end function N_VWrmsNormVectorArray_ManyVector(nvecs, X, W, nrm) @@ -460,37 +279,16 @@ function N_VWrmsNormVectorArray_ManyVector(nvecs, X, W, nrm) end function N_VWrmsNormMaskVectorArray_ManyVector(nvec, X, W, id::N_Vector, nrm) - ccall( - (:N_VWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), - nvec, - X, - W, - id, - nrm, - ) + ccall((:N_VWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), nvec, X, W, id, nrm) end function N_VWrmsNormMaskVectorArray_ManyVector(nvec, X, W, id, nrm) __id = convert(NVector, id) - N_VWrmsNormMaskVectorArray_ManyVector( - convert(Cint, nvec), - X, - W, - convert(N_Vector, __id), - nrm, - ) + N_VWrmsNormMaskVectorArray_ManyVector(convert(Cint, nvec), X, W, convert(N_Vector, __id), nrm) end function N_VDotProdLocal_ManyVector(x::N_Vector, y::N_Vector) - ccall( - (:N_VDotProdLocal_ManyVector, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - y, - ) + ccall((:N_VDotProdLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, y) end function N_VDotProdLocal_ManyVector(x, y) @@ -527,13 +325,7 @@ function N_VL1NormLocal_ManyVector(x) end function N_VWSqrSumLocal_ManyVector(x::N_Vector, w::N_Vector) - ccall( - (:N_VWSqrSumLocal_ManyVector, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - w, - ) + ccall((:N_VWSqrSumLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) end function N_VWSqrSumLocal_ManyVector(x, w) @@ -543,35 +335,18 @@ function N_VWSqrSumLocal_ManyVector(x, w) end function N_VWSqrSumMaskLocal_ManyVector(x::N_Vector, w::N_Vector, id::N_Vector) - ccall( - (:N_VWSqrSumMaskLocal_ManyVector, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector, N_Vector), - x, - w, - id, - ) + ccall((:N_VWSqrSumMaskLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) end function N_VWSqrSumMaskLocal_ManyVector(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWSqrSumMaskLocal_ManyVector( - convert(N_Vector, __x), - convert(N_Vector, __w), - convert(N_Vector, __id), - ) + N_VWSqrSumMaskLocal_ManyVector(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) end function N_VInvTestLocal_ManyVector(x::N_Vector, z::N_Vector) - ccall( - (:N_VInvTestLocal_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, N_Vector), - x, - z, - ) + ccall((:N_VInvTestLocal_ManyVector, libsundials_nvecserial), Cint, (N_Vector, N_Vector), x, z) end function N_VInvTestLocal_ManyVector(x, z) @@ -581,35 +356,18 @@ function N_VInvTestLocal_ManyVector(x, z) end function N_VConstrMaskLocal_ManyVector(c::N_Vector, x::N_Vector, m::N_Vector) - ccall( - (:N_VConstrMaskLocal_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, N_Vector, N_Vector), - c, - x, - m, - ) + ccall((:N_VConstrMaskLocal_ManyVector, libsundials_nvecserial), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) end function N_VConstrMaskLocal_ManyVector(c, x, m) __c = convert(NVector, c) __x = convert(NVector, x) __m = convert(NVector, m) - N_VConstrMaskLocal_ManyVector( - convert(N_Vector, __c), - convert(N_Vector, __x), - convert(N_Vector, __m), - ) + N_VConstrMaskLocal_ManyVector(convert(N_Vector, __c), convert(N_Vector, __x), convert(N_Vector, __m)) end function N_VMinQuotientLocal_ManyVector(num::N_Vector, denom::N_Vector) - ccall( - (:N_VMinQuotientLocal_ManyVector, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - num, - denom, - ) + ccall((:N_VMinQuotientLocal_ManyVector, libsundials_nvecserial), realtype, (N_Vector, N_Vector), num, denom) end function N_VMinQuotientLocal_ManyVector(num, denom) @@ -619,13 +377,7 @@ function N_VMinQuotientLocal_ManyVector(num, denom) end function N_VEnableFusedOps_ManyVector(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableFusedOps_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableFusedOps_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableFusedOps_ManyVector(v, tf) @@ -634,13 +386,7 @@ function N_VEnableFusedOps_ManyVector(v, tf) end function N_VEnableLinearCombination_ManyVector(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableLinearCombination_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableLinearCombination_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableLinearCombination_ManyVector(v, tf) @@ -649,13 +395,7 @@ function N_VEnableLinearCombination_ManyVector(v, tf) end function N_VEnableScaleAddMulti_ManyVector(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableScaleAddMulti_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableScaleAddMulti_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableScaleAddMulti_ManyVector(v, tf) @@ -664,13 +404,7 @@ function N_VEnableScaleAddMulti_ManyVector(v, tf) end function N_VEnableDotProdMulti_ManyVector(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableDotProdMulti_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableDotProdMulti_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableDotProdMulti_ManyVector(v, tf) @@ -679,13 +413,7 @@ function N_VEnableDotProdMulti_ManyVector(v, tf) end function N_VEnableLinearSumVectorArray_ManyVector(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableLinearSumVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableLinearSumVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableLinearSumVectorArray_ManyVector(v, tf) @@ -694,13 +422,7 @@ function N_VEnableLinearSumVectorArray_ManyVector(v, tf) end function N_VEnableScaleVectorArray_ManyVector(v::N_Vector, tf) - ccall( - (:N_VEnableScaleVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableScaleVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableScaleVectorArray_ManyVector(v, tf) @@ -709,13 +431,7 @@ function N_VEnableScaleVectorArray_ManyVector(v, tf) end function N_VEnableConstVectorArray_ManyVector(v::N_Vector, tf) - ccall( - (:N_VEnableConstVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableConstVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableConstVectorArray_ManyVector(v, tf) @@ -724,13 +440,7 @@ function N_VEnableConstVectorArray_ManyVector(v, tf) end function N_VEnableWrmsNormVectorArray_ManyVector(v::N_Vector, tf) - ccall( - (:N_VEnableWrmsNormVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableWrmsNormVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableWrmsNormVectorArray_ManyVector(v, tf) @@ -739,13 +449,7 @@ function N_VEnableWrmsNormVectorArray_ManyVector(v, tf) end function N_VEnableWrmsNormMaskVectorArray_ManyVector(v::N_Vector, tf) - ccall( - (:N_VEnableWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableWrmsNormMaskVectorArray_ManyVector, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableWrmsNormMaskVectorArray_ManyVector(v, tf) @@ -756,37 +460,21 @@ end # Julia wrapper for header: nvector_serial.h # Automatically generated using Clang.jl + function N_VNew_Serial(vec_length::sunindextype) ccall((:N_VNew_Serial, libsundials_nvecserial), N_Vector, (sunindextype,), vec_length) end function N_VNewEmpty_Serial(vec_length::sunindextype) - ccall( - (:N_VNewEmpty_Serial, libsundials_nvecserial), - N_Vector, - (sunindextype,), - vec_length, - ) + ccall((:N_VNewEmpty_Serial, libsundials_nvecserial), N_Vector, (sunindextype,), vec_length) end function N_VMake_Serial(vec_length::sunindextype, v_data) - ccall( - (:N_VMake_Serial, libsundials_nvecserial), - N_Vector, - (sunindextype, Ptr{realtype}), - vec_length, - v_data, - ) + ccall((:N_VMake_Serial, libsundials_nvecserial), N_Vector, (sunindextype, Ptr{realtype}), vec_length, v_data) end function N_VCloneVectorArray_Serial(count::Cint, w::N_Vector) - ccall( - (:N_VCloneVectorArray_Serial, libsundials_nvecserial), - Ptr{N_Vector}, - (Cint, N_Vector), - count, - w, - ) + ccall((:N_VCloneVectorArray_Serial, libsundials_nvecserial), Ptr{N_Vector}, (Cint, N_Vector), count, w) end function N_VCloneVectorArray_Serial(count::Int, w) @@ -795,13 +483,7 @@ function N_VCloneVectorArray_Serial(count::Int, w) end function N_VCloneVectorArrayEmpty_Serial(count::Cint, w::N_Vector) - ccall( - (:N_VCloneVectorArrayEmpty_Serial, libsundials_nvecserial), - Ptr{N_Vector}, - (Cint, N_Vector), - count, - w, - ) + ccall((:N_VCloneVectorArrayEmpty_Serial, libsundials_nvecserial), Ptr{N_Vector}, (Cint, N_Vector), count, w) end function N_VCloneVectorArrayEmpty_Serial(count, w) @@ -810,13 +492,7 @@ function N_VCloneVectorArrayEmpty_Serial(count, w) end function N_VDestroyVectorArray_Serial(vs, count::Cint) - ccall( - (:N_VDestroyVectorArray_Serial, libsundials_nvecserial), - Cvoid, - (Ptr{N_Vector}, Cint), - vs, - count, - ) + ccall((:N_VDestroyVectorArray_Serial, libsundials_nvecserial), Cvoid, (Ptr{N_Vector}, Cint), vs, count) end function N_VDestroyVectorArray_Serial(vs, count) @@ -842,13 +518,7 @@ function N_VPrint_Serial(v) end function N_VPrintFile_Serial(v::N_Vector, outfile) - ccall( - (:N_VPrintFile_Serial, libsundials_nvecserial), - Cvoid, - (N_Vector, Ptr{FILE}), - v, - outfile, - ) + ccall((:N_VPrintFile_Serial, libsundials_nvecserial), Cvoid, (N_Vector, Ptr{FILE}), v, outfile) end function N_VPrintFile_Serial(v, outfile) @@ -893,14 +563,7 @@ function N_VDestroy_Serial(v) end function N_VSpace_Serial(v::N_Vector, lrw, liw) - ccall( - (:N_VSpace_Serial, libsundials_nvecserial), - Cvoid, - (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), - v, - lrw, - liw, - ) + ccall((:N_VSpace_Serial, libsundials_nvecserial), Cvoid, (N_Vector, Ptr{sunindextype}, Ptr{sunindextype}), v, lrw, liw) end function N_VSpace_Serial(v, lrw, liw) @@ -909,12 +572,7 @@ function N_VSpace_Serial(v, lrw, liw) end function N_VGetArrayPointer_Serial(v::N_Vector) - ccall( - (:N_VGetArrayPointer_Serial, libsundials_nvecserial), - Ptr{realtype}, - (N_Vector,), - v, - ) + ccall((:N_VGetArrayPointer_Serial, libsundials_nvecserial), Ptr{realtype}, (N_Vector,), v) end function N_VGetArrayPointer_Serial(v) @@ -923,13 +581,7 @@ function N_VGetArrayPointer_Serial(v) end function N_VSetArrayPointer_Serial(v_data, v::N_Vector) - ccall( - (:N_VSetArrayPointer_Serial, libsundials_nvecserial), - Cvoid, - (Ptr{realtype}, N_Vector), - v_data, - v, - ) + ccall((:N_VSetArrayPointer_Serial, libsundials_nvecserial), Cvoid, (Ptr{realtype}, N_Vector), v_data, v) end function N_VSetArrayPointer_Serial(v_data, v) @@ -937,36 +589,15 @@ function N_VSetArrayPointer_Serial(v_data, v) N_VSetArrayPointer_Serial(v_data, convert(N_Vector, __v)) end -function N_VLinearSum_Serial( - a::realtype, - x::N_Vector, - b::realtype, - y::N_Vector, - z::N_Vector, -) - ccall( - (:N_VLinearSum_Serial, libsundials_nvecserial), - Cvoid, - (realtype, N_Vector, realtype, N_Vector, N_Vector), - a, - x, - b, - y, - z, - ) +function N_VLinearSum_Serial(a::realtype, x::N_Vector, b::realtype, y::N_Vector, z::N_Vector) + ccall((:N_VLinearSum_Serial, libsundials_nvecserial), Cvoid, (realtype, N_Vector, realtype, N_Vector, N_Vector), a, x, b, y, z) end function N_VLinearSum_Serial(a, x, b, y, z) __x = convert(NVector, x) __y = convert(NVector, y) __z = convert(NVector, z) - N_VLinearSum_Serial( - a, - convert(N_Vector, __x), - b, - convert(N_Vector, __y), - convert(N_Vector, __z), - ) + N_VLinearSum_Serial(a, convert(N_Vector, __x), b, convert(N_Vector, __y), convert(N_Vector, __z)) end function N_VConst_Serial(c::realtype, z::N_Vector) @@ -979,14 +610,7 @@ function N_VConst_Serial(c, z) end function N_VProd_Serial(x::N_Vector, y::N_Vector, z::N_Vector) - ccall( - (:N_VProd_Serial, libsundials_nvecserial), - Cvoid, - (N_Vector, N_Vector, N_Vector), - x, - y, - z, - ) + ccall((:N_VProd_Serial, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) end function N_VProd_Serial(x, y, z) @@ -997,14 +621,7 @@ function N_VProd_Serial(x, y, z) end function N_VDiv_Serial(x::N_Vector, y::N_Vector, z::N_Vector) - ccall( - (:N_VDiv_Serial, libsundials_nvecserial), - Cvoid, - (N_Vector, N_Vector, N_Vector), - x, - y, - z, - ) + ccall((:N_VDiv_Serial, libsundials_nvecserial), Cvoid, (N_Vector, N_Vector, N_Vector), x, y, z) end function N_VDiv_Serial(x, y, z) @@ -1015,14 +632,7 @@ function N_VDiv_Serial(x, y, z) end function N_VScale_Serial(c::realtype, x::N_Vector, z::N_Vector) - ccall( - (:N_VScale_Serial, libsundials_nvecserial), - Cvoid, - (realtype, N_Vector, N_Vector), - c, - x, - z, - ) + ccall((:N_VScale_Serial, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) end function N_VScale_Serial(c, x, z) @@ -1052,14 +662,7 @@ function N_VInv_Serial(x, z) end function N_VAddConst_Serial(x::N_Vector, b::realtype, z::N_Vector) - ccall( - (:N_VAddConst_Serial, libsundials_nvecserial), - Cvoid, - (N_Vector, realtype, N_Vector), - x, - b, - z, - ) + ccall((:N_VAddConst_Serial, libsundials_nvecserial), Cvoid, (N_Vector, realtype, N_Vector), x, b, z) end function N_VAddConst_Serial(x, b, z) @@ -1069,13 +672,7 @@ function N_VAddConst_Serial(x, b, z) end function N_VDotProd_Serial(x::N_Vector, y::N_Vector) - ccall( - (:N_VDotProd_Serial, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - y, - ) + ccall((:N_VDotProd_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, y) end function N_VDotProd_Serial(x, y) @@ -1094,13 +691,7 @@ function N_VMaxNorm_Serial(x) end function N_VWrmsNorm_Serial(x::N_Vector, w::N_Vector) - ccall( - (:N_VWrmsNorm_Serial, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - w, - ) + ccall((:N_VWrmsNorm_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) end function N_VWrmsNorm_Serial(x, w) @@ -1110,25 +701,14 @@ function N_VWrmsNorm_Serial(x, w) end function N_VWrmsNormMask_Serial(x::N_Vector, w::N_Vector, id::N_Vector) - ccall( - (:N_VWrmsNormMask_Serial, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector, N_Vector), - x, - w, - id, - ) + ccall((:N_VWrmsNormMask_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) end function N_VWrmsNormMask_Serial(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWrmsNormMask_Serial( - convert(N_Vector, __x), - convert(N_Vector, __w), - convert(N_Vector, __id), - ) + N_VWrmsNormMask_Serial(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) end function N_VMin_Serial(x::N_Vector) @@ -1141,13 +721,7 @@ function N_VMin_Serial(x) end function N_VWL2Norm_Serial(x::N_Vector, w::N_Vector) - ccall( - (:N_VWL2Norm_Serial, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - w, - ) + ccall((:N_VWL2Norm_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) end function N_VWL2Norm_Serial(x, w) @@ -1166,14 +740,7 @@ function N_VL1Norm_Serial(x) end function N_VCompare_Serial(c::realtype, x::N_Vector, z::N_Vector) - ccall( - (:N_VCompare_Serial, libsundials_nvecserial), - Cvoid, - (realtype, N_Vector, N_Vector), - c, - x, - z, - ) + ccall((:N_VCompare_Serial, libsundials_nvecserial), Cvoid, (realtype, N_Vector, N_Vector), c, x, z) end function N_VCompare_Serial(c, x, z) @@ -1193,35 +760,18 @@ function N_VInvTest_Serial(x, z) end function N_VConstrMask_Serial(c::N_Vector, x::N_Vector, m::N_Vector) - ccall( - (:N_VConstrMask_Serial, libsundials_nvecserial), - Cint, - (N_Vector, N_Vector, N_Vector), - c, - x, - m, - ) + ccall((:N_VConstrMask_Serial, libsundials_nvecserial), Cint, (N_Vector, N_Vector, N_Vector), c, x, m) end function N_VConstrMask_Serial(c, x, m) __c = convert(NVector, c) __x = convert(NVector, x) __m = convert(NVector, m) - N_VConstrMask_Serial( - convert(N_Vector, __c), - convert(N_Vector, __x), - convert(N_Vector, __m), - ) + N_VConstrMask_Serial(convert(N_Vector, __c), convert(N_Vector, __x), convert(N_Vector, __m)) end function N_VMinQuotient_Serial(num::N_Vector, denom::N_Vector) - ccall( - (:N_VMinQuotient_Serial, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - num, - denom, - ) + ccall((:N_VMinQuotient_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), num, denom) end function N_VMinQuotient_Serial(num, denom) @@ -1231,15 +781,7 @@ function N_VMinQuotient_Serial(num, denom) end function N_VLinearCombination_Serial(nvec::Cint, c, V, z::N_Vector) - ccall( - (:N_VLinearCombination_Serial, libsundials_nvecserial), - Cint, - (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), - nvec, - c, - V, - z, - ) + ccall((:N_VLinearCombination_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, N_Vector), nvec, c, V, z) end function N_VLinearCombination_Serial(nvec, c, V, z) @@ -1248,16 +790,7 @@ function N_VLinearCombination_Serial(nvec, c, V, z) end function N_VScaleAddMulti_Serial(nvec::Cint, a, x::N_Vector, Y, Z) - ccall( - (:N_VScaleAddMulti_Serial, libsundials_nvecserial), - Cint, - (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - a, - x, - Y, - Z, - ) + ccall((:N_VScaleAddMulti_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, N_Vector, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, x, Y, Z) end function N_VScaleAddMulti_Serial(nvec, a, x, Y, Z) @@ -1266,15 +799,7 @@ function N_VScaleAddMulti_Serial(nvec, a, x, Y, Z) end function N_VDotProdMulti_Serial(nvec::Cint, x::N_Vector, Y, dotprods) - ccall( - (:N_VDotProdMulti_Serial, libsundials_nvecserial), - Cint, - (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), - nvec, - x, - Y, - dotprods, - ) + ccall((:N_VDotProdMulti_Serial, libsundials_nvecserial), Cint, (Cint, N_Vector, Ptr{N_Vector}, Ptr{realtype}), nvec, x, Y, dotprods) end function N_VDotProdMulti_Serial(nvec, x, Y, dotprods) @@ -1283,17 +808,7 @@ function N_VDotProdMulti_Serial(nvec, x, Y, dotprods) end function N_VLinearSumVectorArray_Serial(nvec::Cint, a::realtype, X, b::realtype, Y, Z) - ccall( - (:N_VLinearSumVectorArray_Serial, libsundials_nvecserial), - Cint, - (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - a, - X, - b, - Y, - Z, - ) + ccall((:N_VLinearSumVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}, realtype, Ptr{N_Vector}, Ptr{N_Vector}), nvec, a, X, b, Y, Z) end function N_VLinearSumVectorArray_Serial(nvec, a, X, b, Y, Z) @@ -1301,15 +816,7 @@ function N_VLinearSumVectorArray_Serial(nvec, a, X, b, Y, Z) end function N_VScaleVectorArray_Serial(nvec::Cint, c, X, Z) - ccall( - (:N_VScaleVectorArray_Serial, libsundials_nvecserial), - Cint, - (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), - nvec, - c, - X, - Z, - ) + ccall((:N_VScaleVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{N_Vector}), nvec, c, X, Z) end function N_VScaleVectorArray_Serial(nvec, c, X, Z) @@ -1317,14 +824,7 @@ function N_VScaleVectorArray_Serial(nvec, c, X, Z) end function N_VConstVectorArray_Serial(nvecs::Cint, c::realtype, Z) - ccall( - (:N_VConstVectorArray_Serial, libsundials_nvecserial), - Cint, - (Cint, realtype, Ptr{N_Vector}), - nvecs, - c, - Z, - ) + ccall((:N_VConstVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, realtype, Ptr{N_Vector}), nvecs, c, Z) end function N_VConstVectorArray_Serial(nvecs, c, Z) @@ -1332,15 +832,7 @@ function N_VConstVectorArray_Serial(nvecs, c, Z) end function N_VWrmsNormVectorArray_Serial(nvecs::Cint, X, W, nrm) - ccall( - (:N_VWrmsNormVectorArray_Serial, libsundials_nvecserial), - Cint, - (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), - nvecs, - X, - W, - nrm, - ) + ccall((:N_VWrmsNormVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, Ptr{realtype}), nvecs, X, W, nrm) end function N_VWrmsNormVectorArray_Serial(nvecs, X, W, nrm) @@ -1348,41 +840,16 @@ function N_VWrmsNormVectorArray_Serial(nvecs, X, W, nrm) end function N_VWrmsNormMaskVectorArray_Serial(nvecs::Cint, X, W, id::N_Vector, nrm) - ccall( - (:N_VWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), - Cint, - (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), - nvecs, - X, - W, - id, - nrm, - ) + ccall((:N_VWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Ptr{N_Vector}, Ptr{N_Vector}, N_Vector, Ptr{realtype}), nvecs, X, W, id, nrm) end function N_VWrmsNormMaskVectorArray_Serial(nvecs, X, W, id, nrm) __id = convert(NVector, id) - N_VWrmsNormMaskVectorArray_Serial( - convert(Cint, nvecs), - X, - W, - convert(N_Vector, __id), - nrm, - ) + N_VWrmsNormMaskVectorArray_Serial(convert(Cint, nvecs), X, W, convert(N_Vector, __id), nrm) end function N_VScaleAddMultiVectorArray_Serial(nvec::Cint, nsum::Cint, a, X, Y, Z) - ccall( - (:N_VScaleAddMultiVectorArray_Serial, libsundials_nvecserial), - Cint, - (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), - nvec, - nsum, - a, - X, - Y, - Z, - ) + ccall((:N_VScaleAddMultiVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Cint, Ptr{realtype}, Ptr{N_Vector}, Ptr{Ptr{N_Vector}}, Ptr{Ptr{N_Vector}}), nvec, nsum, a, X, Y, Z) end function N_VScaleAddMultiVectorArray_Serial(nvec, nsum, a, X, Y, Z) @@ -1390,36 +857,15 @@ function N_VScaleAddMultiVectorArray_Serial(nvec, nsum, a, X, Y, Z) end function N_VLinearCombinationVectorArray_Serial(nvec::Cint, nsum::Cint, c, X, Z) - ccall( - (:N_VLinearCombinationVectorArray_Serial, libsundials_nvecserial), - Cint, - (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), - nvec, - nsum, - c, - X, - Z, - ) + ccall((:N_VLinearCombinationVectorArray_Serial, libsundials_nvecserial), Cint, (Cint, Cint, Ptr{realtype}, Ptr{Ptr{N_Vector}}, Ptr{N_Vector}), nvec, nsum, c, X, Z) end function N_VLinearCombinationVectorArray_Serial(nvec, nsum, c, X, Z) - N_VLinearCombinationVectorArray_Serial( - convert(Cint, nvec), - convert(Cint, nsum), - c, - X, - Z, - ) + N_VLinearCombinationVectorArray_Serial(convert(Cint, nvec), convert(Cint, nsum), c, X, Z) end function N_VWSqrSumLocal_Serial(x::N_Vector, w::N_Vector) - ccall( - (:N_VWSqrSumLocal_Serial, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector), - x, - w, - ) + ccall((:N_VWSqrSumLocal_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector), x, w) end function N_VWSqrSumLocal_Serial(x, w) @@ -1428,36 +874,20 @@ function N_VWSqrSumLocal_Serial(x, w) N_VWSqrSumLocal_Serial(convert(N_Vector, __x), convert(N_Vector, __w)) end + function N_VWSqrSumMaskLocal_Serial(x::N_Vector, w::N_Vector, id::N_Vector) - ccall( - (:N_VWSqrSumMaskLocal_Serial, libsundials_nvecserial), - realtype, - (N_Vector, N_Vector, N_Vector), - x, - w, - id, - ) + ccall((:N_VWSqrSumMaskLocal_Serial, libsundials_nvecserial), realtype, (N_Vector, N_Vector, N_Vector), x, w, id) end function N_VWSqrSumMaskLocal_Serial(x, w, id) __x = convert(NVector, x) __w = convert(NVector, w) __id = convert(NVector, id) - N_VWSqrSumMaskLocal_Serial( - convert(N_Vector, __x), - convert(N_Vector, __w), - convert(N_Vector, __id), - ) + N_VWSqrSumMaskLocal_Serial(convert(N_Vector, __x), convert(N_Vector, __w), convert(N_Vector, __id)) end function N_VEnableFusedOps_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableFusedOps_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableFusedOps_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableFusedOps_Serial(v, tf) @@ -1466,13 +896,7 @@ function N_VEnableFusedOps_Serial(v, tf) end function N_VEnableLinearCombination_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableLinearCombination_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableLinearCombination_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableLinearCombination_Serial(v, tf) @@ -1481,13 +905,7 @@ function N_VEnableLinearCombination_Serial(v, tf) end function N_VEnableScaleAddMulti_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableScaleAddMulti_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableScaleAddMulti_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableScaleAddMulti_Serial(v, tf) @@ -1496,13 +914,7 @@ function N_VEnableScaleAddMulti_Serial(v, tf) end function N_VEnableDotProdMulti_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableDotProdMulti_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableDotProdMulti_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableDotProdMulti_Serial(v, tf) @@ -1511,13 +923,7 @@ function N_VEnableDotProdMulti_Serial(v, tf) end function N_VEnableLinearSumVectorArray_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableLinearSumVectorArray_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableLinearSumVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableLinearSumVectorArray_Serial(v, tf) @@ -1526,13 +932,7 @@ function N_VEnableLinearSumVectorArray_Serial(v, tf) end function N_VEnableScaleVectorArray_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableScaleVectorArray_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableScaleVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableScaleVectorArray_Serial(v, tf) @@ -1541,13 +941,7 @@ function N_VEnableScaleVectorArray_Serial(v, tf) end function N_VEnableConstVectorArray_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableConstVectorArray_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableConstVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableConstVectorArray_Serial(v, tf) @@ -1556,13 +950,7 @@ function N_VEnableConstVectorArray_Serial(v, tf) end function N_VEnableWrmsNormVectorArray_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableWrmsNormVectorArray_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableWrmsNormVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableWrmsNormVectorArray_Serial(v, tf) @@ -1571,13 +959,7 @@ function N_VEnableWrmsNormVectorArray_Serial(v, tf) end function N_VEnableWrmsNormMaskVectorArray_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableWrmsNormMaskVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableWrmsNormMaskVectorArray_Serial(v, tf) @@ -1586,13 +968,7 @@ function N_VEnableWrmsNormMaskVectorArray_Serial(v, tf) end function N_VEnableScaleAddMultiVectorArray_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableScaleAddMultiVectorArray_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableScaleAddMultiVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableScaleAddMultiVectorArray_Serial(v, tf) @@ -1601,13 +977,7 @@ function N_VEnableScaleAddMultiVectorArray_Serial(v, tf) end function N_VEnableLinearCombinationVectorArray_Serial(v::N_Vector, tf::Cint) - ccall( - (:N_VEnableLinearCombinationVectorArray_Serial, libsundials_nvecserial), - Cint, - (N_Vector, Cint), - v, - tf, - ) + ccall((:N_VEnableLinearCombinationVectorArray_Serial, libsundials_nvecserial), Cint, (N_Vector, Cint), v, tf) end function N_VEnableLinearCombinationVectorArray_Serial(v, tf) diff --git a/src/API/sunlinsol.jl b/src/API/sunlinsol.jl index fc94c518..aaef6bee 100644 --- a/src/API/sunlinsol.jl +++ b/src/API/sunlinsol.jl @@ -1,14 +1,9 @@ # Julia wrapper for header: sunlinsol_band.h # Automatically generated using Clang.jl + function SUNLinSol_Band(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNLinSol_Band, libsundials_sunlinsolband), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNLinSol_Band, libsundials_sunlinsolband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNLinSol_Band(y, A) @@ -17,13 +12,7 @@ function SUNLinSol_Band(y, A) end function SUNBandLinearSolver(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNBandLinearSolver, libsundials_sunlinsolband), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNBandLinearSolver, libsundials_sunlinsolband), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNBandLinearSolver(y, A) @@ -32,59 +21,23 @@ function SUNBandLinearSolver(y, A) end function SUNLinSolGetType_Band(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_Band, libsundials_sunlinsolband), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_Band, libsundials_sunlinsolband), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_Band(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_Band, libsundials_sunlinsolband), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_Band, libsundials_sunlinsolband), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_Band(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_Band, libsundials_sunlinsolband), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetup_Band(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_Band, libsundials_sunlinsolband), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) -end - -function SUNLinSolSolve_Band( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_Band, libsundials_sunlinsolband), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver, SUNMatrix), S, A) +end + +function SUNLinSolSolve_Band(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_Band(S, A, x, b, tol) @@ -94,23 +47,11 @@ function SUNLinSolSolve_Band(S, A, x, b, tol) end function SUNLinSolLastFlag_Band(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_Band, libsundials_sunlinsolband), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_Band, libsundials_sunlinsolband), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_Band(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_Band, libsundials_sunlinsolband), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_Band, libsundials_sunlinsolband), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_Band(S::SUNLinearSolver) @@ -119,29 +60,18 @@ end # Julia wrapper for header: sunlinsol_dense.h # Automatically generated using Clang.jl + function SUNLinSol_Dense(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNLinSol_Dense, libsundials_sunlinsoldense), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNLinSol_Dense, libsundials_sunlinsoldense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNLinSol_Dense(y, A) __y = convert(NVector, y) - SUNLinSol_Dense(convert(N_Vector, __y), A) + SUNLinSol_Dense(convert(N_Vector, __y), A) end function SUNDenseLinearSolver(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNDenseLinearSolver, libsundials_sunlinsoldense), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNDenseLinearSolver, libsundials_sunlinsoldense), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNDenseLinearSolver(y, A) @@ -150,59 +80,23 @@ function SUNDenseLinearSolver(y, A) end function SUNLinSolGetType_Dense(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_Dense, libsundials_sunlinsoldense), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_Dense, libsundials_sunlinsoldense), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_Dense(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_Dense, libsundials_sunlinsoldense), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_Dense, libsundials_sunlinsoldense), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_Dense(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_Dense, libsundials_sunlinsoldense), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetup_Dense(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_Dense, libsundials_sunlinsoldense), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) -end - -function SUNLinSolSolve_Dense( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_Dense, libsundials_sunlinsoldense), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver, SUNMatrix), S, A) +end + +function SUNLinSolSolve_Dense(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_Dense(S, A, x, b, tol) @@ -212,23 +106,11 @@ function SUNLinSolSolve_Dense(S, A, x, b, tol) end function SUNLinSolLastFlag_Dense(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_Dense, libsundials_sunlinsoldense), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_Dense, libsundials_sunlinsoldense), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_Dense(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_Dense, libsundials_sunlinsoldense), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_Dense, libsundials_sunlinsoldense), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_Dense(S::SUNLinearSolver) @@ -237,14 +119,9 @@ end # Julia wrapper for header: sunlinsol_klu.h # Automatically generated using Clang.jl + function SUNLinSol_KLU(y::N_Vector, A::SUNMatrix) - ccall( - (:SUNLinSol_KLU, libsundials_sunlinsolklu), - SUNLinearSolver, - (N_Vector, SUNMatrix), - y, - A, - ) + ccall((:SUNLinSol_KLU, libsundials_sunlinsolklu), SUNLinearSolver, (N_Vector, SUNMatrix), y, A) end function SUNLinSol_KLU(y, A) @@ -252,21 +129,8 @@ function SUNLinSol_KLU(y, A) SUNLinSol_KLU(convert(N_Vector, __y), A) end -function SUNLinSol_KLUReInit( - S::SUNLinearSolver, - A::SUNMatrix, - nnz::sunindextype, - reinit_type::Cint, -) - ccall( - (:SUNLinSol_KLUReInit, libsundials_sunlinsolklu), - Cint, - (SUNLinearSolver, SUNMatrix, sunindextype, Cint), - S, - A, - nnz, - reinit_type, - ) +function SUNLinSol_KLUReInit(S::SUNLinearSolver, A::SUNMatrix, nnz::sunindextype, reinit_type::Cint) + ccall((:SUNLinSol_KLUReInit, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix, sunindextype, Cint), S, A, nnz, reinit_type) end function SUNLinSol_KLUReInit(S, A, nnz, reinit_type) @@ -274,13 +138,7 @@ function SUNLinSol_KLUReInit(S, A, nnz, reinit_type) end function SUNLinSol_KLUSetOrdering(S::SUNLinearSolver, ordering_choice::Cint) - ccall( - (:SUNLinSol_KLUSetOrdering, libsundials_sunlinsolklu), - Cint, - (SUNLinearSolver, Cint), - S, - ordering_choice, - ) + ccall((:SUNLinSol_KLUSetOrdering, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, Cint), S, ordering_choice) end function SUNLinSol_KLUSetOrdering(S, ordering_choice) @@ -296,21 +154,8 @@ function SUNKLU(y, A) SUNKLU(convert(N_Vector, y), A) end -function SUNKLUReInit( - S::SUNLinearSolver, - A::SUNMatrix, - nnz::sunindextype, - reinit_type::Cint, -) - ccall( - (:SUNKLUReInit, libsundials_sunlinsolklu), - Cint, - (SUNLinearSolver, SUNMatrix, sunindextype, Cint), - S, - A, - nnz, - reinit_type, - ) +function SUNKLUReInit(S::SUNLinearSolver, A::SUNMatrix, nnz::sunindextype, reinit_type::Cint) + ccall((:SUNKLUReInit, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix, sunindextype, Cint), S, A, nnz, reinit_type) end function SUNKLUReInit(S, A, nnz, reinit_type) @@ -318,13 +163,7 @@ function SUNKLUReInit(S, A, nnz, reinit_type) end function SUNKLUSetOrdering(S::SUNLinearSolver, ordering_choice::Cint) - ccall( - (:SUNKLUSetOrdering, libsundials_sunlinsolklu), - Cint, - (SUNLinearSolver, Cint), - S, - ordering_choice, - ) + ccall((:SUNKLUSetOrdering, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, Cint), S, ordering_choice) end function SUNKLUSetOrdering(S, ordering_choice) @@ -332,48 +171,23 @@ function SUNKLUSetOrdering(S, ordering_choice) end function SUNLinSol_KLUGetSymbolic(S::SUNLinearSolver) - ccall( - (:SUNLinSol_KLUGetSymbolic, libsundials_sunlinsolklu), - Ptr{klu_l_symbolic}, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSol_KLUGetSymbolic, libsundials_sunlinsolklu), Ptr{klu_l_symbolic}, (SUNLinearSolver,), S) end function SUNLinSol_KLUGetNumeric(S::SUNLinearSolver) - ccall( - (:SUNLinSol_KLUGetNumeric, libsundials_sunlinsolklu), - Ptr{klu_l_numeric}, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSol_KLUGetNumeric, libsundials_sunlinsolklu), Ptr{klu_l_numeric}, (SUNLinearSolver,), S) end function SUNLinSol_KLUGetCommon(S::SUNLinearSolver) - ccall( - (:SUNLinSol_KLUGetCommon, libsundials_sunlinsolklu), - Ptr{klu_l_common}, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSol_KLUGetCommon, libsundials_sunlinsolklu), Ptr{klu_l_common}, (SUNLinearSolver,), S) end function SUNLinSolGetType_KLU(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_KLU, libsundials_sunlinsolklu), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_KLU, libsundials_sunlinsolklu), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_KLU(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_KLU, libsundials_sunlinsolklu), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_KLU, libsundials_sunlinsolklu), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_KLU(S::SUNLinearSolver) @@ -381,32 +195,11 @@ function SUNLinSolInitialize_KLU(S::SUNLinearSolver) end function SUNLinSolSetup_KLU(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_KLU, libsundials_sunlinsolklu), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) -end - -function SUNLinSolSolve_KLU( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_KLU, libsundials_sunlinsolklu), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_KLU, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix), S, A) +end + +function SUNLinSolSolve_KLU(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_KLU, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_KLU(S, A, x, b, tol) @@ -416,23 +209,11 @@ function SUNLinSolSolve_KLU(S, A, x, b, tol) end function SUNLinSolLastFlag_KLU(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_KLU, libsundials_sunlinsolklu), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_KLU, libsundials_sunlinsolklu), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_KLU(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_KLU, libsundials_sunlinsolklu), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_KLU, libsundials_sunlinsolklu), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_KLU(S::SUNLinearSolver) @@ -441,15 +222,9 @@ end # Julia wrapper for header: sunlinsol_pcg.h # Automatically generated using Clang.jl + function SUNLinSol_PCG(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNLinSol_PCG, libsundials_sunlinsolpcg), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNLinSol_PCG, libsundials_sunlinsolpcg), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNLinSol_PCG(y, pretype, maxl) @@ -458,13 +233,7 @@ function SUNLinSol_PCG(y, pretype, maxl) end function SUNLinSol_PCGSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNLinSol_PCGSetPrecType, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNLinSol_PCGSetPrecType, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNLinSol_PCGSetPrecType(S, pretype) @@ -472,13 +241,7 @@ function SUNLinSol_PCGSetPrecType(S, pretype) end function SUNLinSol_PCGSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall( - (:SUNLinSol_PCGSetMaxl, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, Cint), - S, - maxl, - ) + ccall((:SUNLinSol_PCGSetMaxl, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, maxl) end function SUNLinSol_PCGSetMaxl(S, maxl) @@ -486,14 +249,7 @@ function SUNLinSol_PCGSetMaxl(S, maxl) end function SUNPCG(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNPCG, libsundials_sunlinsolpcg), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNPCG, libsundials_sunlinsolpcg), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNPCG(y, pretype, maxl) @@ -502,13 +258,7 @@ function SUNPCG(y, pretype, maxl) end function SUNPCGSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNPCGSetPrecType, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNPCGSetPrecType, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNPCGSetPrecType(S, pretype) @@ -516,13 +266,7 @@ function SUNPCGSetPrecType(S, pretype) end function SUNPCGSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall( - (:SUNPCGSetMaxl, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, Cint), - S, - maxl, - ) + ccall((:SUNPCGSetMaxl, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Cint), S, maxl) end function SUNPCGSetMaxl(S, maxl) @@ -530,21 +274,11 @@ function SUNPCGSetMaxl(S, maxl) end function SUNLinSolGetType_PCG(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_PCG, libsundials_sunlinsolpcg), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_PCG, libsundials_sunlinsolpcg), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_PCG(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_PCG, libsundials_sunlinsolpcg), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_PCG, libsundials_sunlinsolpcg), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_PCG(S::SUNLinearSolver) @@ -552,42 +286,15 @@ function SUNLinSolInitialize_PCG(S::SUNLinearSolver) end function SUNLinSolSetATimes_PCG(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall( - (:SUNLinSolSetATimes_PCG, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), - S, - A_data, - ATimes, - ) -end - -function SUNLinSolSetPreconditioner_PCG( - S::SUNLinearSolver, - P_data, - Pset::PSetupFn, - Psol::PSolveFn, -) - ccall( - (:SUNLinSolSetPreconditioner_PCG, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), - S, - P_data, - Pset, - Psol, - ) + ccall((:SUNLinSolSetATimes_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) +end + +function SUNLinSolSetPreconditioner_PCG(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) + ccall((:SUNLinSolSetPreconditioner_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) end function SUNLinSolSetScalingVectors_PCG(S::SUNLinearSolver, s::N_Vector, nul::N_Vector) - ccall( - (:SUNLinSolSetScalingVectors_PCG, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, N_Vector, N_Vector), - S, - s, - nul, - ) + ccall((:SUNLinSolSetScalingVectors_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s, nul) end function SUNLinSolSetScalingVectors_PCG(S, s, nul) @@ -597,32 +304,11 @@ function SUNLinSolSetScalingVectors_PCG(S, s, nul) end function SUNLinSolSetup_PCG(S::SUNLinearSolver, nul::SUNMatrix) - ccall( - (:SUNLinSolSetup_PCG, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - nul, - ) -end - -function SUNLinSolSolve_PCG( - S::SUNLinearSolver, - nul::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_PCG, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - nul, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, SUNMatrix), S, nul) +end + +function SUNLinSolSolve_PCG(S::SUNLinearSolver, nul::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, nul, x, b, tol) end function SUNLinSolSolve_PCG(S, nul, x, b, tol) @@ -636,12 +322,7 @@ function SUNLinSolNumIters_PCG(S::SUNLinearSolver) end function SUNLinSolResNorm_PCG(S::SUNLinearSolver) - ccall( - (:SUNLinSolResNorm_PCG, libsundials_sunlinsolpcg), - realtype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResNorm_PCG, libsundials_sunlinsolpcg), realtype, (SUNLinearSolver,), S) end function SUNLinSolResid_PCG(S::SUNLinearSolver) @@ -649,23 +330,11 @@ function SUNLinSolResid_PCG(S::SUNLinearSolver) end function SUNLinSolLastFlag_PCG(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_PCG, libsundials_sunlinsolpcg), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_PCG, libsundials_sunlinsolpcg), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_PCG(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_PCG, libsundials_sunlinsolpcg), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_PCG, libsundials_sunlinsolpcg), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_PCG(S::SUNLinearSolver) @@ -674,15 +343,9 @@ end # Julia wrapper for header: sunlinsol_spbcgs.h # Automatically generated using Clang.jl + function SUNLinSol_SPBCGS(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNLinSol_SPBCGS, libsundials_sunlinsolspbcgs), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNLinSol_SPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNLinSol_SPBCGS(y, pretype, maxl) @@ -691,13 +354,7 @@ function SUNLinSol_SPBCGS(y, pretype, maxl) end function SUNLinSol_SPBCGSSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNLinSol_SPBCGSSetPrecType, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNLinSol_SPBCGSSetPrecType, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNLinSol_SPBCGSSetPrecType(S::SUNLinearSolver, pretype) @@ -705,13 +362,7 @@ function SUNLinSol_SPBCGSSetPrecType(S::SUNLinearSolver, pretype) end function SUNLinSol_SPBCGSSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall( - (:SUNLinSol_SPBCGSSetMaxl, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, Cint), - S, - maxl, - ) + ccall((:SUNLinSol_SPBCGSSetMaxl, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, maxl) end function SUNLinSol_SPBCGSSetMaxl(S::SUNLinearSolver, maxl) @@ -719,14 +370,7 @@ function SUNLinSol_SPBCGSSetMaxl(S::SUNLinearSolver, maxl) end function SUNSPBCGS(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNSPBCGS, libsundials_sunlinsolspbcgs), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNSPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNSPBCGS(y, pretype, maxl) @@ -735,13 +379,7 @@ function SUNSPBCGS(y, pretype, maxl) end function SUNSPBCGSSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNSPBCGSSetPrecType, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNSPBCGSSetPrecType, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNSPBCGSSetPrecType(S, pretype) @@ -749,13 +387,7 @@ function SUNSPBCGSSetPrecType(S, pretype) end function SUNSPBCGSSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall( - (:SUNSPBCGSSetMaxl, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, Cint), - S, - maxl, - ) + ccall((:SUNSPBCGSSetMaxl, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Cint), S, maxl) end function SUNSPBCGSSetMaxl(S, maxl) @@ -763,69 +395,27 @@ function SUNSPBCGSSetMaxl(S, maxl) end function SUNLinSolGetType_SPBCGS(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_SPBCGS, libsundials_sunlinsolspbcgs), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_SPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_SPBCGS(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_SPBCGS, libsundials_sunlinsolspbcgs), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_SPBCGS, libsundials_sunlinsolspbcgs), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_SPBCGS(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetATimes_SPBCGS(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall( - (:SUNLinSolSetATimes_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), - S, - A_data, - ATimes, - ) -end - -function SUNLinSolSetPreconditioner_SPBCGS( - S::SUNLinearSolver, - P_data, - Pset::PSetupFn, - Psol::PSolveFn, -) - ccall( - (:SUNLinSolSetPreconditioner_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), - S, - P_data, - Pset, - Psol, - ) + ccall((:SUNLinSolSetATimes_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) +end + +function SUNLinSolSetPreconditioner_SPBCGS(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) + ccall((:SUNLinSolSetPreconditioner_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) end function SUNLinSolSetScalingVectors_SPBCGS(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall( - (:SUNLinSolSetScalingVectors_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, N_Vector, N_Vector), - S, - s1, - s2, - ) + ccall((:SUNLinSolSetScalingVectors_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) end function SUNLinSolSetScalingVectors_SPBCGS(S, s1, s2) @@ -835,32 +425,11 @@ function SUNLinSolSetScalingVectors_SPBCGS(S, s1, s2) end function SUNLinSolSetup_SPBCGS(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) -end - -function SUNLinSolSolve_SPBCGS( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, SUNMatrix), S, A) +end + +function SUNLinSolSolve_SPBCGS(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_SPBCGS(S, A, x, b, tol) @@ -870,50 +439,23 @@ function SUNLinSolSolve_SPBCGS(S, A, x, b, tol) end function SUNLinSolNumIters_SPBCGS(S::SUNLinearSolver) - ccall( - (:SUNLinSolNumIters_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolNumIters_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver,), S) end function SUNLinSolResNorm_SPBCGS(S::SUNLinearSolver) - ccall( - (:SUNLinSolResNorm_SPBCGS, libsundials_sunlinsolspbcgs), - realtype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResNorm_SPBCGS, libsundials_sunlinsolspbcgs), realtype, (SUNLinearSolver,), S) end function SUNLinSolResid_SPBCGS(S::SUNLinearSolver) - ccall( - (:SUNLinSolResid_SPBCGS, libsundials_sunlinsolspbcgs), - N_Vector, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResid_SPBCGS, libsundials_sunlinsolspbcgs), N_Vector, (SUNLinearSolver,), S) end function SUNLinSolLastFlag_SPBCGS(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_SPBCGS, libsundials_sunlinsolspbcgs), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_SPBCGS, libsundials_sunlinsolspbcgs), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_SPBCGS(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_SPBCGS, libsundials_sunlinsolspbcgs), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_SPBCGS, libsundials_sunlinsolspbcgs), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_SPBCGS(S::SUNLinearSolver) @@ -922,15 +464,9 @@ end # Julia wrapper for header: sunlinsol_spfgmr.h # Automatically generated using Clang.jl + function SUNLinSol_SPFGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNLinSol_SPFGMR, libsundials_sunlinsolspfgmr), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNLinSol_SPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNLinSol_SPFGMR(y, pretype, maxl) @@ -939,13 +475,7 @@ function SUNLinSol_SPFGMR(y, pretype, maxl) end function SUNLinSol_SPFGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNLinSol_SPFGMRSetPrecType, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNLinSol_SPFGMRSetPrecType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNLinSol_SPFGMRSetPrecType(S, pretype) @@ -953,13 +483,7 @@ function SUNLinSol_SPFGMRSetPrecType(S, pretype) end function SUNLinSol_SPFGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall( - (:SUNLinSol_SPFGMRSetGSType, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Cint), - S, - gstype, - ) + ccall((:SUNLinSol_SPFGMRSetGSType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, gstype) end function SUNLinSol_SPFGMRSetGSType(S, gstype) @@ -967,13 +491,7 @@ function SUNLinSol_SPFGMRSetGSType(S, gstype) end function SUNLinSol_SPFGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall( - (:SUNLinSol_SPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Cint), - S, - maxrs, - ) + ccall((:SUNLinSol_SPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) end function SUNLinSol_SPFGMRSetMaxRestarts(S, maxrs) @@ -981,14 +499,7 @@ function SUNLinSol_SPFGMRSetMaxRestarts(S, maxrs) end function SUNSPFGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNSPFGMR, libsundials_sunlinsolspfgmr), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNSPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNSPFGMR(y, pretype, maxl) @@ -997,13 +508,7 @@ function SUNSPFGMR(y, pretype, maxl) end function SUNSPFGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNSPFGMRSetPrecType, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNSPFGMRSetPrecType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNSPFGMRSetPrecType(S, pretype) @@ -1011,13 +516,7 @@ function SUNSPFGMRSetPrecType(S, pretype) end function SUNSPFGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall( - (:SUNSPFGMRSetGSType, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Cint), - S, - gstype, - ) + ccall((:SUNSPFGMRSetGSType, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, gstype) end function SUNSPFGMRSetGSType(S, gstype) @@ -1025,13 +524,7 @@ function SUNSPFGMRSetGSType(S, gstype) end function SUNSPFGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall( - (:SUNSPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Cint), - S, - maxrs, - ) + ccall((:SUNSPFGMRSetMaxRestarts, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) end function SUNSPFGMRSetMaxRestarts(S, maxrs) @@ -1039,69 +532,27 @@ function SUNSPFGMRSetMaxRestarts(S, maxrs) end function SUNLinSolGetType_SPFGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_SPFGMR, libsundials_sunlinsolspfgmr), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_SPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_SPFGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_SPFGMR, libsundials_sunlinsolspfgmr), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_SPFGMR, libsundials_sunlinsolspfgmr), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_SPFGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetATimes_SPFGMR(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall( - (:SUNLinSolSetATimes_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), - S, - A_data, - ATimes, - ) -end - -function SUNLinSolSetPreconditioner_SPFGMR( - S::SUNLinearSolver, - P_data, - Pset::PSetupFn, - Psol::PSolveFn, -) - ccall( - (:SUNLinSolSetPreconditioner_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), - S, - P_data, - Pset, - Psol, - ) + ccall((:SUNLinSolSetATimes_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) +end + +function SUNLinSolSetPreconditioner_SPFGMR(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) + ccall((:SUNLinSolSetPreconditioner_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) end function SUNLinSolSetScalingVectors_SPFGMR(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall( - (:SUNLinSolSetScalingVectors_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, N_Vector, N_Vector), - S, - s1, - s2, - ) + ccall((:SUNLinSolSetScalingVectors_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) end function SUNLinSolSetScalingVectors_SPFGMR(S, s1, s2) @@ -1111,32 +562,11 @@ function SUNLinSolSetScalingVectors_SPFGMR(S, s1, s2) end function SUNLinSolSetup_SPFGMR(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) -end - -function SUNLinSolSolve_SPFGMR( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, SUNMatrix), S, A) +end + +function SUNLinSolSolve_SPFGMR(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_SPFGMR(S, A, x, b, tol) @@ -1146,50 +576,23 @@ function SUNLinSolSolve_SPFGMR(S, A, x, b, tol) end function SUNLinSolNumIters_SPFGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolNumIters_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolNumIters_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver,), S) end function SUNLinSolResNorm_SPFGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolResNorm_SPFGMR, libsundials_sunlinsolspfgmr), - realtype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResNorm_SPFGMR, libsundials_sunlinsolspfgmr), realtype, (SUNLinearSolver,), S) end function SUNLinSolResid_SPFGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolResid_SPFGMR, libsundials_sunlinsolspfgmr), - N_Vector, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResid_SPFGMR, libsundials_sunlinsolspfgmr), N_Vector, (SUNLinearSolver,), S) end function SUNLinSolLastFlag_SPFGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_SPFGMR, libsundials_sunlinsolspfgmr), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_SPFGMR, libsundials_sunlinsolspfgmr), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_SPFGMR(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_SPFGMR, libsundials_sunlinsolspfgmr), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_SPFGMR, libsundials_sunlinsolspfgmr), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_SPFGMR(S::SUNLinearSolver) @@ -1198,15 +601,9 @@ end # Julia wrapper for header: sunlinsol_spgmr.h # Automatically generated using Clang.jl + function SUNLinSol_SPGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNLinSol_SPGMR, libsundials_sunlinsolspgmr), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNLinSol_SPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNLinSol_SPGMR(y, pretype, maxl) @@ -1215,13 +612,7 @@ function SUNLinSol_SPGMR(y, pretype, maxl) end function SUNLinSol_SPGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNLinSol_SPGMRSetPrecType, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNLinSol_SPGMRSetPrecType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNLinSol_SPGMRSetPrecType(S, pretype) @@ -1229,13 +620,7 @@ function SUNLinSol_SPGMRSetPrecType(S, pretype) end function SUNLinSol_SPGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall( - (:SUNLinSol_SPGMRSetGSType, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Cint), - S, - gstype, - ) + ccall((:SUNLinSol_SPGMRSetGSType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, gstype) end function SUNLinSol_SPGMRSetGSType(S, gstype) @@ -1243,13 +628,7 @@ function SUNLinSol_SPGMRSetGSType(S, gstype) end function SUNLinSol_SPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall( - (:SUNLinSol_SPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Cint), - S, - maxrs, - ) + ccall((:SUNLinSol_SPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) end function SUNLinSol_SPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs) @@ -1257,14 +636,7 @@ function SUNLinSol_SPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs) end function SUNSPGMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNSPGMR, libsundials_sunlinsolspgmr), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNSPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNSPGMR(y, pretype, maxl) @@ -1273,13 +645,7 @@ function SUNSPGMR(y, pretype, maxl) end function SUNSPGMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNSPGMRSetPrecType, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNSPGMRSetPrecType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNSPGMRSetPrecType(S, pretype) @@ -1287,13 +653,7 @@ function SUNSPGMRSetPrecType(S, pretype) end function SUNSPGMRSetGSType(S::SUNLinearSolver, gstype::Cint) - ccall( - (:SUNSPGMRSetGSType, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Cint), - S, - gstype, - ) + ccall((:SUNSPGMRSetGSType, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, gstype) end function SUNSPGMRSetGSType(S, gstype) @@ -1301,13 +661,7 @@ function SUNSPGMRSetGSType(S, gstype) end function SUNSPGMRSetMaxRestarts(S::SUNLinearSolver, maxrs::Cint) - ccall( - (:SUNSPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Cint), - S, - maxrs, - ) + ccall((:SUNSPGMRSetMaxRestarts, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Cint), S, maxrs) end function SUNSPGMRSetMaxRestarts(S, maxrs) @@ -1315,69 +669,27 @@ function SUNSPGMRSetMaxRestarts(S, maxrs) end function SUNLinSolGetType_SPGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_SPGMR, libsundials_sunlinsolspgmr), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_SPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_SPGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_SPGMR, libsundials_sunlinsolspgmr), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_SPGMR, libsundials_sunlinsolspgmr), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_SPGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetATimes_SPGMR(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall( - (:SUNLinSolSetATimes_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), - S, - A_data, - ATimes, - ) -end - -function SUNLinSolSetPreconditioner_SPGMR( - S::SUNLinearSolver, - P_data, - Pset::PSetupFn, - Psol::PSolveFn, -) - ccall( - (:SUNLinSolSetPreconditioner_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), - S, - P_data, - Pset, - Psol, - ) + ccall((:SUNLinSolSetATimes_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) +end + +function SUNLinSolSetPreconditioner_SPGMR(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) + ccall((:SUNLinSolSetPreconditioner_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) end function SUNLinSolSetScalingVectors_SPGMR(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall( - (:SUNLinSolSetScalingVectors_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, N_Vector, N_Vector), - S, - s1, - s2, - ) + ccall((:SUNLinSolSetScalingVectors_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) end function SUNLinSolSetScalingVectors_SPGMR(S, s1, s2) @@ -1387,32 +699,11 @@ function SUNLinSolSetScalingVectors_SPGMR(S, s1, s2) end function SUNLinSolSetup_SPGMR(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) -end - -function SUNLinSolSolve_SPGMR( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, SUNMatrix), S, A) +end + +function SUNLinSolSolve_SPGMR(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_SPGMR(S, A, x, b, tol) @@ -1422,50 +713,23 @@ function SUNLinSolSolve_SPGMR(S, A, x, b, tol) end function SUNLinSolNumIters_SPGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolNumIters_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolNumIters_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver,), S) end function SUNLinSolResNorm_SPGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolResNorm_SPGMR, libsundials_sunlinsolspgmr), - realtype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResNorm_SPGMR, libsundials_sunlinsolspgmr), realtype, (SUNLinearSolver,), S) end function SUNLinSolResid_SPGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolResid_SPGMR, libsundials_sunlinsolspgmr), - N_Vector, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResid_SPGMR, libsundials_sunlinsolspgmr), N_Vector, (SUNLinearSolver,), S) end function SUNLinSolLastFlag_SPGMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_SPGMR, libsundials_sunlinsolspgmr), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_SPGMR, libsundials_sunlinsolspgmr), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_SPGMR(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_SPGMR, libsundials_sunlinsolspgmr), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_SPGMR, libsundials_sunlinsolspgmr), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_SPGMR(S::SUNLinearSolver) @@ -1474,15 +738,9 @@ end # Julia wrapper for header: sunlinsol_sptfqmr.h # Automatically generated using Clang.jl + function SUNLinSol_SPTFQMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNLinSol_SPTFQMR, libsundials_sunlinsolsptfqmr), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNLinSol_SPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNLinSol_SPTFQMR(y, pretype, maxl) @@ -1491,13 +749,7 @@ function SUNLinSol_SPTFQMR(y, pretype, maxl) end function SUNLinSol_SPTFQMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNLinSol_SPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNLinSol_SPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNLinSol_SPTFQMRSetPrecType(S, pretype) @@ -1505,13 +757,7 @@ function SUNLinSol_SPTFQMRSetPrecType(S, pretype) end function SUNLinSol_SPTFQMRSetMaxl(S::SUNLinearSolver, maxl::Cint) - ccall( - (:SUNLinSol_SPTFQMRSetMaxl, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, Cint), - S, - maxl, - ) + ccall((:SUNLinSol_SPTFQMRSetMaxl, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Cint), S, maxl) end function SUNLinSol_SPTFQMRSetMaxl(S, maxl) @@ -1519,14 +765,7 @@ function SUNLinSol_SPTFQMRSetMaxl(S, maxl) end function SUNSPTFQMR(y::N_Vector, pretype::Cint, maxl::Cint) - ccall( - (:SUNSPTFQMR, libsundials_sunlinsolsptfqmr), - SUNLinearSolver, - (N_Vector, Cint, Cint), - y, - pretype, - maxl, - ) + ccall((:SUNSPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver, (N_Vector, Cint, Cint), y, pretype, maxl) end function SUNSPTFQMR(y, pretype, maxl) @@ -1535,13 +774,7 @@ function SUNSPTFQMR(y, pretype, maxl) end function SUNSPTFQMRSetPrecType(S::SUNLinearSolver, pretype::Cint) - ccall( - (:SUNSPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, Cint), - S, - pretype, - ) + ccall((:SUNSPTFQMRSetPrecType, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Cint), S, pretype) end function SUNSPTFQMRSetPrecType(S, pretype) @@ -1549,69 +782,27 @@ function SUNSPTFQMRSetPrecType(S, pretype) end function SUNLinSolGetType_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetType_SPTFQMR, libsundials_sunlinsolsptfqmr), - SUNLinearSolver_Type, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetType_SPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver_Type, (SUNLinearSolver,), S) end function SUNLinSolGetID_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolGetID_SPTFQMR, libsundials_sunlinsolsptfqmr), - SUNLinearSolver_ID, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolGetID_SPTFQMR, libsundials_sunlinsolsptfqmr), SUNLinearSolver_ID, (SUNLinearSolver,), S) end function SUNLinSolInitialize_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolInitialize_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolInitialize_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver,), S) end function SUNLinSolSetATimes_SPTFQMR(S::SUNLinearSolver, A_data, ATimes::ATimesFn) - ccall( - (:SUNLinSolSetATimes_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), - S, - A_data, - ATimes, - ) -end - -function SUNLinSolSetPreconditioner_SPTFQMR( - S::SUNLinearSolver, - P_data, - Pset::PSetupFn, - Psol::PSolveFn, -) - ccall( - (:SUNLinSolSetPreconditioner_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), - S, - P_data, - Pset, - Psol, - ) + ccall((:SUNLinSolSetATimes_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, ATimesFn), S, A_data, ATimes) +end + +function SUNLinSolSetPreconditioner_SPTFQMR(S::SUNLinearSolver, P_data, Pset::PSetupFn, Psol::PSolveFn) + ccall((:SUNLinSolSetPreconditioner_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Ptr{Cvoid}, PSetupFn, PSolveFn), S, P_data, Pset, Psol) end function SUNLinSolSetScalingVectors_SPTFQMR(S::SUNLinearSolver, s1::N_Vector, s2::N_Vector) - ccall( - (:SUNLinSolSetScalingVectors_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, N_Vector, N_Vector), - S, - s1, - s2, - ) + ccall((:SUNLinSolSetScalingVectors_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, N_Vector, N_Vector), S, s1, s2) end function SUNLinSolSetScalingVectors_SPTFQMR(S, s1, s2) @@ -1621,32 +812,11 @@ function SUNLinSolSetScalingVectors_SPTFQMR(S, s1, s2) end function SUNLinSolSetup_SPTFQMR(S::SUNLinearSolver, A::SUNMatrix) - ccall( - (:SUNLinSolSetup_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, SUNMatrix), - S, - A, - ) -end - -function SUNLinSolSolve_SPTFQMR( - S::SUNLinearSolver, - A::SUNMatrix, - x::N_Vector, - b::N_Vector, - tol::realtype, -) - ccall( - (:SUNLinSolSolve_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), - S, - A, - x, - b, - tol, - ) + ccall((:SUNLinSolSetup_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, SUNMatrix), S, A) +end + +function SUNLinSolSolve_SPTFQMR(S::SUNLinearSolver, A::SUNMatrix, x::N_Vector, b::N_Vector, tol::realtype) + ccall((:SUNLinSolSolve_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, SUNMatrix, N_Vector, N_Vector, realtype), S, A, x, b, tol) end function SUNLinSolSolve_SPTFQMR(S, A, x, b, tol) @@ -1656,57 +826,25 @@ function SUNLinSolSolve_SPTFQMR(S, A, x, b, tol) end function SUNLinSolNumIters_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolNumIters_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolNumIters_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver,), S) end function SUNLinSolResNorm_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolResNorm_SPTFQMR, libsundials_sunlinsolsptfqmr), - realtype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResNorm_SPTFQMR, libsundials_sunlinsolsptfqmr), realtype, (SUNLinearSolver,), S) end function SUNLinSolResid_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolResid_SPTFQMR, libsundials_sunlinsolsptfqmr), - N_Vector, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolResid_SPTFQMR, libsundials_sunlinsolsptfqmr), N_Vector, (SUNLinearSolver,), S) end function SUNLinSolLastFlag_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolLastFlag_SPTFQMR, libsundials_sunlinsolsptfqmr), - sunindextype, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolLastFlag_SPTFQMR, libsundials_sunlinsolsptfqmr), sunindextype, (SUNLinearSolver,), S) end function SUNLinSolSpace_SPTFQMR(S::SUNLinearSolver, lenrwLS, leniwLS) - ccall( - (:SUNLinSolSpace_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), - S, - lenrwLS, - leniwLS, - ) + ccall((:SUNLinSolSpace_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver, Ptr{Clong}, Ptr{Clong}), S, lenrwLS, leniwLS) end function SUNLinSolFree_SPTFQMR(S::SUNLinearSolver) - ccall( - (:SUNLinSolFree_SPTFQMR, libsundials_sunlinsolsptfqmr), - Cint, - (SUNLinearSolver,), - S, - ) + ccall((:SUNLinSolFree_SPTFQMR, libsundials_sunlinsolsptfqmr), Cint, (SUNLinearSolver,), S) end diff --git a/src/API/sunmatrix.jl b/src/API/sunmatrix.jl index 5a420dee..9b48fae3 100644 --- a/src/API/sunmatrix.jl +++ b/src/API/sunmatrix.jl @@ -1,42 +1,17 @@ # Julia wrapper for header: sunmatrix_band.h # Automatically generated using Clang.jl + function SUNBandMatrix(N::sunindextype, mu::sunindextype, ml::sunindextype) - ccall( - (:SUNBandMatrix, libsundials_sunmatrixband), - SUNMatrix, - (sunindextype, sunindextype, sunindextype), - N, - mu, - ml, - ) -end - -function SUNBandMatrixStorage( - N::sunindextype, - mu::sunindextype, - ml::sunindextype, - smu::sunindextype, -) - ccall( - (:SUNBandMatrixStorage, libsundials_sunmatrixband), - SUNMatrix, - (sunindextype, sunindextype, sunindextype, sunindextype), - N, - mu, - ml, - smu, - ) + ccall((:SUNBandMatrix, libsundials_sunmatrixband), SUNMatrix, (sunindextype, sunindextype, sunindextype), N, mu, ml) +end + +function SUNBandMatrixStorage(N::sunindextype, mu::sunindextype, ml::sunindextype, smu::sunindextype) + ccall((:SUNBandMatrixStorage, libsundials_sunmatrixband), SUNMatrix, (sunindextype, sunindextype, sunindextype, sunindextype), N, mu, ml, smu) end function SUNBandMatrix_Print(A::SUNMatrix, outfile) - ccall( - (:SUNBandMatrix_Print, libsundials_sunmatrixband), - Cvoid, - (SUNMatrix, Ptr{FILE}), - A, - outfile, - ) + ccall((:SUNBandMatrix_Print, libsundials_sunmatrixband), Cvoid, (SUNMatrix, Ptr{FILE}), A, outfile) end function SUNBandMatrix_Rows(A::SUNMatrix) @@ -44,39 +19,19 @@ function SUNBandMatrix_Rows(A::SUNMatrix) end function SUNBandMatrix_Columns(A::SUNMatrix) - ccall( - (:SUNBandMatrix_Columns, libsundials_sunmatrixband), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNBandMatrix_Columns, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) end function SUNBandMatrix_LowerBandwidth(A::SUNMatrix) - ccall( - (:SUNBandMatrix_LowerBandwidth, libsundials_sunmatrixband), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNBandMatrix_LowerBandwidth, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) end function SUNBandMatrix_UpperBandwidth(A::SUNMatrix) - ccall( - (:SUNBandMatrix_UpperBandwidth, libsundials_sunmatrixband), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNBandMatrix_UpperBandwidth, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) end function SUNBandMatrix_StoredUpperBandwidth(A::SUNMatrix) - ccall( - (:SUNBandMatrix_StoredUpperBandwidth, libsundials_sunmatrixband), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNBandMatrix_StoredUpperBandwidth, libsundials_sunmatrixband), sunindextype, (SUNMatrix,), A) end function SUNBandMatrix_LDim(A::SUNMatrix) @@ -88,22 +43,11 @@ function SUNBandMatrix_Data(A::SUNMatrix) end function SUNBandMatrix_Cols(A::SUNMatrix) - ccall( - (:SUNBandMatrix_Cols, libsundials_sunmatrixband), - Ptr{Ptr{realtype}}, - (SUNMatrix,), - A, - ) + ccall((:SUNBandMatrix_Cols, libsundials_sunmatrixband), Ptr{Ptr{realtype}}, (SUNMatrix,), A) end function SUNBandMatrix_Column(A::SUNMatrix, j::sunindextype) - ccall( - (:SUNBandMatrix_Column, libsundials_sunmatrixband), - Ptr{realtype}, - (SUNMatrix, sunindextype), - A, - j, - ) + ccall((:SUNBandMatrix_Column, libsundials_sunmatrixband), Ptr{realtype}, (SUNMatrix, sunindextype), A, j) end function SUNMatGetID_Band(A::SUNMatrix) @@ -127,35 +71,15 @@ function SUNMatCopy_Band(A::SUNMatrix, B::SUNMatrix) end function SUNMatScaleAdd_Band(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall( - (:SUNMatScaleAdd_Band, libsundials_sunmatrixband), - Cint, - (realtype, SUNMatrix, SUNMatrix), - c, - A, - B, - ) + ccall((:SUNMatScaleAdd_Band, libsundials_sunmatrixband), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) end function SUNMatScaleAddI_Band(c::realtype, A::SUNMatrix) - ccall( - (:SUNMatScaleAddI_Band, libsundials_sunmatrixband), - Cint, - (realtype, SUNMatrix), - c, - A, - ) + ccall((:SUNMatScaleAddI_Band, libsundials_sunmatrixband), Cint, (realtype, SUNMatrix), c, A) end function SUNMatMatvec_Band(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall( - (:SUNMatMatvec_Band, libsundials_sunmatrixband), - Cint, - (SUNMatrix, N_Vector, N_Vector), - A, - x, - y, - ) + ccall((:SUNMatMatvec_Band, libsundials_sunmatrixband), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) end function SUNMatMatvec_Band(A, x, y) @@ -165,36 +89,18 @@ function SUNMatMatvec_Band(A, x, y) end function SUNMatSpace_Band(A::SUNMatrix, lenrw, leniw) - ccall( - (:SUNMatSpace_Band, libsundials_sunmatrixband), - Cint, - (SUNMatrix, Ptr{Clong}, Ptr{Clong}), - A, - lenrw, - leniw, - ) + ccall((:SUNMatSpace_Band, libsundials_sunmatrixband), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) end # Julia wrapper for header: sunmatrix_dense.h # Automatically generated using Clang.jl + function SUNDenseMatrix(M::sunindextype, N::sunindextype) - ccall( - (:SUNDenseMatrix, libsundials_sunmatrixdense), - SUNMatrix, - (sunindextype, sunindextype), - M, - N, - ) + ccall((:SUNDenseMatrix, libsundials_sunmatrixdense), SUNMatrix, (sunindextype, sunindextype), M, N) end function SUNDenseMatrix_Print(A::SUNMatrix, outfile) - ccall( - (:SUNDenseMatrix_Print, libsundials_sunmatrixdense), - Cvoid, - (SUNMatrix, Ptr{FILE}), - A, - outfile, - ) + ccall((:SUNDenseMatrix_Print, libsundials_sunmatrixdense), Cvoid, (SUNMatrix, Ptr{FILE}), A, outfile) end function SUNDenseMatrix_Rows(A::SUNMatrix) @@ -202,49 +108,23 @@ function SUNDenseMatrix_Rows(A::SUNMatrix) end function SUNDenseMatrix_Columns(A::SUNMatrix) - ccall( - (:SUNDenseMatrix_Columns, libsundials_sunmatrixdense), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNDenseMatrix_Columns, libsundials_sunmatrixdense), sunindextype, (SUNMatrix,), A) end function SUNDenseMatrix_LData(A::SUNMatrix) - ccall( - (:SUNDenseMatrix_LData, libsundials_sunmatrixdense), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNDenseMatrix_LData, libsundials_sunmatrixdense), sunindextype, (SUNMatrix,), A) end function SUNDenseMatrix_Data(A::SUNMatrix) - ccall( - (:SUNDenseMatrix_Data, libsundials_sunmatrixdense), - Ptr{realtype}, - (SUNMatrix,), - A, - ) + ccall((:SUNDenseMatrix_Data, libsundials_sunmatrixdense), Ptr{realtype}, (SUNMatrix,), A) end function SUNDenseMatrix_Cols(A::SUNMatrix) - ccall( - (:SUNDenseMatrix_Cols, libsundials_sunmatrixdense), - Ptr{Ptr{realtype}}, - (SUNMatrix,), - A, - ) + ccall((:SUNDenseMatrix_Cols, libsundials_sunmatrixdense), Ptr{Ptr{realtype}}, (SUNMatrix,), A) end function SUNDenseMatrix_Column(A::SUNMatrix, j::sunindextype) - ccall( - (:SUNDenseMatrix_Column, libsundials_sunmatrixdense), - Ptr{realtype}, - (SUNMatrix, sunindextype), - A, - j, - ) + ccall((:SUNDenseMatrix_Column, libsundials_sunmatrixdense), Ptr{realtype}, (SUNMatrix, sunindextype), A, j) end function SUNMatGetID_Dense(A::SUNMatrix) @@ -264,45 +144,19 @@ function SUNMatZero_Dense(A::SUNMatrix) end function SUNMatCopy_Dense(A::SUNMatrix, B::SUNMatrix) - ccall( - (:SUNMatCopy_Dense, libsundials_sunmatrixdense), - Cint, - (SUNMatrix, SUNMatrix), - A, - B, - ) + ccall((:SUNMatCopy_Dense, libsundials_sunmatrixdense), Cint, (SUNMatrix, SUNMatrix), A, B) end function SUNMatScaleAdd_Dense(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall( - (:SUNMatScaleAdd_Dense, libsundials_sunmatrixdense), - Cint, - (realtype, SUNMatrix, SUNMatrix), - c, - A, - B, - ) + ccall((:SUNMatScaleAdd_Dense, libsundials_sunmatrixdense), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) end function SUNMatScaleAddI_Dense(c::realtype, A::SUNMatrix) - ccall( - (:SUNMatScaleAddI_Dense, libsundials_sunmatrixdense), - Cint, - (realtype, SUNMatrix), - c, - A, - ) + ccall((:SUNMatScaleAddI_Dense, libsundials_sunmatrixdense), Cint, (realtype, SUNMatrix), c, A) end function SUNMatMatvec_Dense(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall( - (:SUNMatMatvec_Dense, libsundials_sunmatrixdense), - Cint, - (SUNMatrix, N_Vector, N_Vector), - A, - x, - y, - ) + ccall((:SUNMatMatvec_Dense, libsundials_sunmatrixdense), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) end function SUNMatMatvec_Dense(A, x, y) @@ -312,33 +166,14 @@ function SUNMatMatvec_Dense(A, x, y) end function SUNMatSpace_Dense(A::SUNMatrix, lenrw, leniw) - ccall( - (:SUNMatSpace_Dense, libsundials_sunmatrixdense), - Cint, - (SUNMatrix, Ptr{Clong}, Ptr{Clong}), - A, - lenrw, - leniw, - ) + ccall((:SUNMatSpace_Dense, libsundials_sunmatrixdense), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) end # Julia wrapper for header: sunmatrix_sparse.h # Automatically generated using Clang.jl -function SUNSparseMatrix( - M::sunindextype, - N::sunindextype, - NNZ::sunindextype, - sparsetype::Cint, -) - ccall( - (:SUNSparseMatrix, libsundials_sunmatrixsparse), - SUNMatrix, - (sunindextype, sunindextype, sunindextype, Cint), - M, - N, - NNZ, - sparsetype, - ) + +function SUNSparseMatrix(M::sunindextype, N::sunindextype, NNZ::sunindextype, sparsetype::Cint) + ccall((:SUNSparseMatrix, libsundials_sunmatrixsparse), SUNMatrix, (sunindextype, sunindextype, sunindextype, Cint), M, N, NNZ, sparsetype) end function SUNSparseMatrix(M, N, NNZ, sparsetype) @@ -346,14 +181,7 @@ function SUNSparseMatrix(M, N, NNZ, sparsetype) end function SUNSparseFromDenseMatrix(A::SUNMatrix, droptol::realtype, sparsetype::Cint) - ccall( - (:SUNSparseFromDenseMatrix, libsundials_sunmatrixdense), - SUNMatrix, - (SUNMatrix, realtype, Cint), - A, - droptol, - sparsetype, - ) + ccall((:SUNSparseFromDenseMatrix, libsundials_sunmatrixdense), SUNMatrix, (SUNMatrix, realtype, Cint), A, droptol, sparsetype) end function SUNSparseFromDenseMatrix(A, droptol, sparsetype) @@ -361,14 +189,7 @@ function SUNSparseFromDenseMatrix(A, droptol, sparsetype) end function SUNSparseFromBandMatrix(A::SUNMatrix, droptol::realtype, sparsetype::Cint) - ccall( - (:SUNSparseFromBandMatrix, libsundials_sunmatrixband), - SUNMatrix, - (SUNMatrix, realtype, Cint), - A, - droptol, - sparsetype, - ) + ccall((:SUNSparseFromBandMatrix, libsundials_sunmatrixband), SUNMatrix, (SUNMatrix, realtype, Cint), A, droptol, sparsetype) end function SUNSparseFromBandMatrix(A, droptol, sparsetype) @@ -380,50 +201,23 @@ function SUNSparseMatrix_Realloc(A::SUNMatrix) end function SUNSparseMatrix_Reallocate(A::SUNMatrix, NNZ::sunindextype) - ccall( - (:SUNSparseMatrix_Reallocate, libsundials_sunmatrixsparse), - Cint, - (SUNMatrix, sunindextype), - A, - NNZ, - ) + ccall((:SUNSparseMatrix_Reallocate, libsundials_sunmatrixsparse), Cint, (SUNMatrix, sunindextype), A, NNZ) end function SUNSparseMatrix_Print(A::SUNMatrix, outfile) - ccall( - (:SUNSparseMatrix_Print, libsundials_sunmatrixsparse), - Cvoid, - (SUNMatrix, Ptr{FILE}), - A, - outfile, - ) + ccall((:SUNSparseMatrix_Print, libsundials_sunmatrixsparse), Cvoid, (SUNMatrix, Ptr{FILE}), A, outfile) end function SUNSparseMatrix_Rows(A::SUNMatrix) - ccall( - (:SUNSparseMatrix_Rows, libsundials_sunmatrixsparse), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNSparseMatrix_Rows, libsundials_sunmatrixsparse), sunindextype, (SUNMatrix,), A) end function SUNSparseMatrix_Columns(A::SUNMatrix) - ccall( - (:SUNSparseMatrix_Columns, libsundials_sunmatrixsparse), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNSparseMatrix_Columns, libsundials_sunmatrixsparse), sunindextype, (SUNMatrix,), A) end function SUNSparseMatrix_NNZ(A::SUNMatrix) - ccall( - (:SUNSparseMatrix_NNZ, libsundials_sunmatrixsparse), - sunindextype, - (SUNMatrix,), - A, - ) + ccall((:SUNSparseMatrix_NNZ, libsundials_sunmatrixsparse), sunindextype, (SUNMatrix,), A) end function SUNSparseMatrix_NP(A::SUNMatrix) @@ -435,30 +229,15 @@ function SUNSparseMatrix_SparseType(A::SUNMatrix) end function SUNSparseMatrix_Data(A::SUNMatrix) - ccall( - (:SUNSparseMatrix_Data, libsundials_sunmatrixsparse), - Ptr{realtype}, - (SUNMatrix,), - A, - ) + ccall((:SUNSparseMatrix_Data, libsundials_sunmatrixsparse), Ptr{realtype}, (SUNMatrix,), A) end function SUNSparseMatrix_IndexValues(A::SUNMatrix) - ccall( - (:SUNSparseMatrix_IndexValues, libsundials_sunmatrixsparse), - Ptr{sunindextype}, - (SUNMatrix,), - A, - ) + ccall((:SUNSparseMatrix_IndexValues, libsundials_sunmatrixsparse), Ptr{sunindextype}, (SUNMatrix,), A) end function SUNSparseMatrix_IndexPointers(A::SUNMatrix) - ccall( - (:SUNSparseMatrix_IndexPointers, libsundials_sunmatrixsparse), - Ptr{sunindextype}, - (SUNMatrix,), - A, - ) + ccall((:SUNSparseMatrix_IndexPointers, libsundials_sunmatrixsparse), Ptr{sunindextype}, (SUNMatrix,), A) end function SUNMatGetID_Sparse(A::SUNMatrix) @@ -478,45 +257,19 @@ function SUNMatZero_Sparse(A::SUNMatrix) end function SUNMatCopy_Sparse(A::SUNMatrix, B::SUNMatrix) - ccall( - (:SUNMatCopy_Sparse, libsundials_sunmatrixsparse), - Cint, - (SUNMatrix, SUNMatrix), - A, - B, - ) + ccall((:SUNMatCopy_Sparse, libsundials_sunmatrixsparse), Cint, (SUNMatrix, SUNMatrix), A, B) end function SUNMatScaleAdd_Sparse(c::realtype, A::SUNMatrix, B::SUNMatrix) - ccall( - (:SUNMatScaleAdd_Sparse, libsundials_sunmatrixsparse), - Cint, - (realtype, SUNMatrix, SUNMatrix), - c, - A, - B, - ) + ccall((:SUNMatScaleAdd_Sparse, libsundials_sunmatrixsparse), Cint, (realtype, SUNMatrix, SUNMatrix), c, A, B) end function SUNMatScaleAddI_Sparse(c::realtype, A::SUNMatrix) - ccall( - (:SUNMatScaleAddI_Sparse, libsundials_sunmatrixsparse), - Cint, - (realtype, SUNMatrix), - c, - A, - ) + ccall((:SUNMatScaleAddI_Sparse, libsundials_sunmatrixsparse), Cint, (realtype, SUNMatrix), c, A) end function SUNMatMatvec_Sparse(A::SUNMatrix, x::N_Vector, y::N_Vector) - ccall( - (:SUNMatMatvec_Sparse, libsundials_sunmatrixsparse), - Cint, - (SUNMatrix, N_Vector, N_Vector), - A, - x, - y, - ) + ccall((:SUNMatMatvec_Sparse, libsundials_sunmatrixsparse), Cint, (SUNMatrix, N_Vector, N_Vector), A, x, y) end function SUNMatMatvec_Sparse(A, x, y) @@ -526,12 +279,5 @@ function SUNMatMatvec_Sparse(A, x, y) end function SUNMatSpace_Sparse(A::SUNMatrix, lenrw, leniw) - ccall( - (:SUNMatSpace_Sparse, libsundials_sunmatrixsparse), - Cint, - (SUNMatrix, Ptr{Clong}, Ptr{Clong}), - A, - lenrw, - leniw, - ) + ccall((:SUNMatSpace_Sparse, libsundials_sunmatrixsparse), Cint, (SUNMatrix, Ptr{Clong}, Ptr{Clong}), A, lenrw, leniw) end diff --git a/src/API/sunnonlinsol.jl b/src/API/sunnonlinsol.jl index 2e950bd2..b17607d3 100644 --- a/src/API/sunnonlinsol.jl +++ b/src/API/sunnonlinsol.jl @@ -1,14 +1,9 @@ # Julia wrapper for header: sunnonlinsol_fixedpoint.h # Automatically generated using Clang.jl + function SUNNonlinSol_FixedPoint(y::N_Vector, m::Cint) - ccall( - (:SUNNonlinSol_FixedPoint, libsundials_sunnonlinsolfixedpoint), - SUNNonlinearSolver, - (N_Vector, Cint), - y, - m, - ) + ccall((:SUNNonlinSol_FixedPoint, libsundials_sunnonlinsolfixedpoint), SUNNonlinearSolver, (N_Vector, Cint), y, m) end function SUNNonlinSol_FixedPoint(y, m) @@ -17,131 +12,47 @@ function SUNNonlinSol_FixedPoint(y, m) end function SUNNonlinSol_FixedPointSens(count::Cint, y::N_Vector, m::Cint) - ccall( - (:SUNNonlinSol_FixedPointSens, libsundials_sunnonlinsolfixedpoint), - SUNNonlinearSolver, - (Cint, N_Vector, Cint), - count, - y, - m, - ) + ccall((:SUNNonlinSol_FixedPointSens, libsundials_sunnonlinsolfixedpoint), SUNNonlinearSolver, (Cint, N_Vector, Cint), count, y, m) end function SUNNonlinSol_FixedPointSens(count, y, m) __y = convert(NVector, y) - SUNNonlinSol_FixedPointSens( - convert(Cint, count), - convert(N_Vector, __y), - convert(Cint, m), - ) + SUNNonlinSol_FixedPointSens(convert(Cint, count), convert(N_Vector, __y), convert(Cint, m)) end function SUNNonlinSolGetType_FixedPoint(NLS::SUNNonlinearSolver) - ccall( - (:SUNNonlinSolGetType_FixedPoint, libsundials_sunnonlinsolfixedpoint), - SUNNonlinearSolver_Type, - (SUNNonlinearSolver,), - NLS, - ) + ccall((:SUNNonlinSolGetType_FixedPoint, libsundials_sunnonlinsolfixedpoint), SUNNonlinearSolver_Type, (SUNNonlinearSolver,), NLS) end function SUNNonlinSolInitialize_FixedPoint(NLS::SUNNonlinearSolver) - ccall( - (:SUNNonlinSolInitialize_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver,), - NLS, - ) -end - -function SUNNonlinSolSolve_FixedPoint( - NLS::SUNNonlinearSolver, - y0::N_Vector, - y::N_Vector, - w::N_Vector, - tol::realtype, - callSetup::Cint, - mem, -) - ccall( - (:SUNNonlinSolSolve_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), - NLS, - y0, - y, - w, - tol, - callSetup, - mem, - ) -end - -function SUNNonlinSolSolve_FixedPoint( - NLS::SUNNonlinearSolver, - y0, - y, - w, - tol, - callSetup, - mem, -) + ccall((:SUNNonlinSolInitialize_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver,), NLS) +end + +function SUNNonlinSolSolve_FixedPoint(NLS::SUNNonlinearSolver, y0::N_Vector, y::N_Vector, w::N_Vector, tol::realtype, callSetup::Cint, mem) + ccall((:SUNNonlinSolSolve_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), NLS, y0, y, w, tol, callSetup, mem) +end + +function SUNNonlinSolSolve_FixedPoint(NLS::SUNNonlinearSolver, y0, y, w, tol, callSetup, mem) __y0 = convert(NVector, y0) __y = convert(NVector, y) __w = convert(NVector, w) - SUNNonlinSolSolve_FixedPoint( - NLS, - convert(N_Vector, __y0), - convert(N_Vector, __y), - convert(N_Vector, __w), - tol, - convert(Cint, callSetup), - mem, - ) + SUNNonlinSolSolve_FixedPoint(NLS, convert(N_Vector, __y0), convert(N_Vector, __y), convert(N_Vector, __w), tol, convert(Cint, callSetup), mem) end function SUNNonlinSolFree_FixedPoint(NLS::SUNNonlinearSolver) - ccall( - (:SUNNonlinSolFree_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver,), - NLS, - ) + ccall((:SUNNonlinSolFree_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver,), NLS) end function SUNNonlinSolSetSysFn_FixedPoint(NLS::SUNNonlinearSolver, SysFn::SUNNonlinSolSysFn) - ccall( - (:SUNNonlinSolSetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, SUNNonlinSolSysFn), - NLS, - SysFn, - ) -end - -function SUNNonlinSolSetConvTestFn_FixedPoint( - NLS::SUNNonlinearSolver, - CTestFn::SUNNonlinSolConvTestFn, - ctest_data, -) - ccall( - (:SUNNonlinSolSetConvTestFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), - NLS, - CTestFn, - ctest_data, - ) + ccall((:SUNNonlinSolSetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, SUNNonlinSolSysFn), NLS, SysFn) +end + +function SUNNonlinSolSetConvTestFn_FixedPoint(NLS::SUNNonlinearSolver, CTestFn::SUNNonlinSolConvTestFn, ctest_data) + ccall((:SUNNonlinSolSetConvTestFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), NLS, CTestFn, ctest_data) end function SUNNonlinSolSetMaxIters_FixedPoint(NLS::SUNNonlinearSolver, maxiters::Cint) - ccall( - (:SUNNonlinSolSetMaxIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, Cint), - NLS, - maxiters, - ) + ccall((:SUNNonlinSolSetMaxIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Cint), NLS, maxiters) end function SUNNonlinSolSetMaxIters_FixedPoint(NLS, maxiters) @@ -149,64 +60,30 @@ function SUNNonlinSolSetMaxIters_FixedPoint(NLS, maxiters) end function SUNNonlinSolSetDamping_FixedPoint(NLS::SUNNonlinearSolver, beta::realtype) - ccall( - (:SUNNonlinSolSetDamping_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, realtype), - NLS, - beta, - ) + ccall((:SUNNonlinSolSetDamping_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, realtype), NLS, beta) end function SUNNonlinSolGetNumIters_FixedPoint(NLS::SUNNonlinearSolver, niters) - ccall( - (:SUNNonlinSolGetNumIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, Ptr{Clong}), - NLS, - niters, - ) + ccall((:SUNNonlinSolGetNumIters_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, niters) end function SUNNonlinSolGetCurIter_FixedPoint(NLS::SUNNonlinearSolver, iter) - ccall( - (:SUNNonlinSolGetCurIter_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, Ptr{Cint}), - NLS, - iter, - ) + ccall((:SUNNonlinSolGetCurIter_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{Cint}), NLS, iter) end function SUNNonlinSolGetNumConvFails_FixedPoint(NLS::SUNNonlinearSolver, nconvfails) - ccall( - (:SUNNonlinSolGetNumConvFails_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, Ptr{Clong}), - NLS, - nconvfails, - ) + ccall((:SUNNonlinSolGetNumConvFails_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, nconvfails) end function SUNNonlinSolGetSysFn_FixedPoint(NLS::SUNNonlinearSolver, SysFn) - ccall( - (:SUNNonlinSolGetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), - Cint, - (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), - NLS, - SysFn, - ) + ccall((:SUNNonlinSolGetSysFn_FixedPoint, libsundials_sunnonlinsolfixedpoint), Cint, (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), NLS, SysFn) end # Julia wrapper for header: sunnonlinsol_newton.h # Automatically generated using Clang.jl + function SUNNonlinSol_Newton(y::N_Vector) - ccall( - (:SUNNonlinSol_Newton, libsundials_sunnonlinsolnewton), - SUNNonlinearSolver, - (N_Vector,), - y, - ) + ccall((:SUNNonlinSol_Newton, libsundials_sunnonlinsolnewton), SUNNonlinearSolver, (N_Vector,), y) end function SUNNonlinSol_Newton(y) @@ -215,13 +92,7 @@ function SUNNonlinSol_Newton(y) end function SUNNonlinSol_NewtonSens(count::Cint, y::N_Vector) - ccall( - (:SUNNonlinSol_NewtonSens, libsundials_sunnonlinsolnewton), - SUNNonlinearSolver, - (Cint, N_Vector), - count, - y, - ) + ccall((:SUNNonlinSol_NewtonSens, libsundials_sunnonlinsolnewton), SUNNonlinearSolver, (Cint, N_Vector), count, y) end function SUNNonlinSol_NewtonSens(count, y) @@ -230,129 +101,46 @@ function SUNNonlinSol_NewtonSens(count, y) end function SUNNonlinSolGetType_Newton(NLS::SUNNonlinearSolver) - ccall( - (:SUNNonlinSolGetType_Newton, libsundials_sunnonlinsolnewton), - SUNNonlinearSolver_Type, - (SUNNonlinearSolver,), - NLS, - ) + ccall((:SUNNonlinSolGetType_Newton, libsundials_sunnonlinsolnewton), SUNNonlinearSolver_Type, (SUNNonlinearSolver,), NLS) end function SUNNonlinSolInitialize_Newton(NLS::SUNNonlinearSolver) - ccall( - (:SUNNonlinSolInitialize_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver,), - NLS, - ) -end - -function SUNNonlinSolSolve_Newton( - NLS::SUNNonlinearSolver, - y0::N_Vector, - y::N_Vector, - w::N_Vector, - tol::realtype, - callLSetup::Cint, - mem, -) - ccall( - (:SUNNonlinSolSolve_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), - NLS, - y0, - y, - w, - tol, - callLSetup, - mem, - ) + ccall((:SUNNonlinSolInitialize_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver,), NLS) +end + +function SUNNonlinSolSolve_Newton(NLS::SUNNonlinearSolver, y0::N_Vector, y::N_Vector, w::N_Vector, tol::realtype, callLSetup::Cint, mem) + ccall((:SUNNonlinSolSolve_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, N_Vector, N_Vector, N_Vector, realtype, Cint, Ptr{Cvoid}), NLS, y0, y, w, tol, callLSetup, mem) end function SUNNonlinSolSolve_Newton(NLS, y0, y, w, tol, callLSetup, mem) __y0 = convert(NVector, y0) __y = convert(NVector, y) __w = convert(NVector, w) - SUNNonlinSolSolve_Newton( - NLS, - convert(N_Vector, __y0), - convert(N_Vector, __y), - convert(N_Vector, __w), - tol, - convert(Cint, callLSetup), - mem, - ) + SUNNonlinSolSolve_Newton(NLS, convert(N_Vector, __y0), convert(N_Vector, __y), convert(N_Vector, __w), tol, convert(Cint, callLSetup), mem) end function SUNNonlinSolFree_Newton(NLS::SUNNonlinearSolver) - ccall( - (:SUNNonlinSolFree_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver,), - NLS, - ) + ccall((:SUNNonlinSolFree_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver,), NLS) end function SUNNonlinSolSetSysFn_Newton(NLS::SUNNonlinearSolver, SysFn::SUNNonlinSolSysFn) - ccall( - (:SUNNonlinSolSetSysFn_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, SUNNonlinSolSysFn), - NLS, - SysFn, - ) -end - -function SUNNonlinSolSetLSetupFn_Newton( - NLS::SUNNonlinearSolver, - LSetupFn::SUNNonlinSolLSetupFn, -) - ccall( - (:SUNNonlinSolSetLSetupFn_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, SUNNonlinSolLSetupFn), - NLS, - LSetupFn, - ) -end - -function SUNNonlinSolSetLSolveFn_Newton( - NLS::SUNNonlinearSolver, - LSolveFn::SUNNonlinSolLSolveFn, -) - ccall( - (:SUNNonlinSolSetLSolveFn_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, SUNNonlinSolLSolveFn), - NLS, - LSolveFn, - ) -end - -function SUNNonlinSolSetConvTestFn_Newton( - NLS::SUNNonlinearSolver, - CTestFn::SUNNonlinSolConvTestFn, - ctest_data, -) - ccall( - (:SUNNonlinSolSetConvTestFn_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), - NLS, - CTestFn, - ctest_data, - ) + ccall((:SUNNonlinSolSetSysFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolSysFn), NLS, SysFn) +end + +function SUNNonlinSolSetLSetupFn_Newton(NLS::SUNNonlinearSolver, LSetupFn::SUNNonlinSolLSetupFn) + ccall((:SUNNonlinSolSetLSetupFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolLSetupFn), NLS, LSetupFn) +end + +function SUNNonlinSolSetLSolveFn_Newton(NLS::SUNNonlinearSolver, LSolveFn::SUNNonlinSolLSolveFn) + ccall((:SUNNonlinSolSetLSolveFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolLSolveFn), NLS, LSolveFn) +end + +function SUNNonlinSolSetConvTestFn_Newton(NLS::SUNNonlinearSolver, CTestFn::SUNNonlinSolConvTestFn, ctest_data) + ccall((:SUNNonlinSolSetConvTestFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, SUNNonlinSolConvTestFn, Ptr{Cvoid}), NLS, CTestFn, ctest_data) end function SUNNonlinSolSetMaxIters_Newton(NLS::SUNNonlinearSolver, maxiters::Cint) - ccall( - (:SUNNonlinSolSetMaxIters_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, Cint), - NLS, - maxiters, - ) + ccall((:SUNNonlinSolSetMaxIters_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Cint), NLS, maxiters) end function SUNNonlinSolSetMaxIters_Newton(NLS, maxiters) @@ -360,41 +148,17 @@ function SUNNonlinSolSetMaxIters_Newton(NLS, maxiters) end function SUNNonlinSolGetNumIters_Newton(NLS::SUNNonlinearSolver, niters) - ccall( - (:SUNNonlinSolGetNumIters_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, Ptr{Clong}), - NLS, - niters, - ) + ccall((:SUNNonlinSolGetNumIters_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, niters) end function SUNNonlinSolGetCurIter_Newton(NLS::SUNNonlinearSolver, iter) - ccall( - (:SUNNonlinSolGetCurIter_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, Ptr{Cint}), - NLS, - iter, - ) + ccall((:SUNNonlinSolGetCurIter_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{Cint}), NLS, iter) end function SUNNonlinSolGetNumConvFails_Newton(NLS::SUNNonlinearSolver, nconvfails) - ccall( - (:SUNNonlinSolGetNumConvFails_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, Ptr{Clong}), - NLS, - nconvfails, - ) + ccall((:SUNNonlinSolGetNumConvFails_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{Clong}), NLS, nconvfails) end function SUNNonlinSolGetSysFn_Newton(NLS::SUNNonlinearSolver, SysFn) - ccall( - (:SUNNonlinSolGetSysFn_Newton, libsundials_sunnonlinsolnewton), - Cint, - (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), - NLS, - SysFn, - ) + ccall((:SUNNonlinSolGetSysFn_Newton, libsundials_sunnonlinsolnewton), Cint, (SUNNonlinearSolver, Ptr{SUNNonlinSolSysFn}), NLS, SysFn) end diff --git a/src/API/types_and_consts.jl b/src/API/types_and_consts.jl index 3bd0ab5f..9768b7b5 100644 --- a/src/API/types_and_consts.jl +++ b/src/API/types_and_consts.jl @@ -173,6 +173,7 @@ CEnum.@cenum MRISTEP_ID::UInt32 begin MRISTEP_ARKSTEP = 0 end + const MRIStepPreInnerFn = Ptr{Cvoid} const MRIStepPostInnerFn = Ptr{Cvoid} const CV_ADAMS = Cint(1) @@ -699,6 +700,8 @@ CEnum.@cenum SUNLinearSolver_ID::UInt32 begin SUNLINEARSOLVER_CUSTOM = 13 end + + struct _generic_SUNLinearSolver_Ops gettype::Ptr{Cvoid} getid::Ptr{Cvoid} @@ -739,6 +742,7 @@ const SUNMAT_MEM_FAIL = Cint(-702) const SUNMAT_OPERATION_FAIL = Cint(-703) const SUNMAT_MATVEC_SETUP_REQUIRED = Cint(-704) + CEnum.@cenum SUNMatrix_ID::UInt32 begin SUNMATRIX_DENSE = 0 SUNMATRIX_BAND = 1 @@ -747,6 +751,7 @@ CEnum.@cenum SUNMatrix_ID::UInt32 begin SUNMATRIX_CUSTOM = 4 end + struct _generic_SUNMatrix_Ops getid::Ptr{Cvoid} clone::Ptr{Cvoid} @@ -832,6 +837,7 @@ CEnum.@cenum N_Vector_ID::UInt32 begin SUNDIALS_NVEC_CUSTOM = 13 end + const N_Vector_S = Ptr{N_Vector} # Skipping MacroDefinition: RCONST ( x ) x