From fdc0a17806ccb57c80b83648f655c6e2ad47efaf Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 9 Jan 2021 05:12:56 -0500 Subject: [PATCH] Add test for the sparse Jacobian usage The issue you had was that you didn't utilize a sparse Jacobian solver. --- test/DiffEqsWrappersTests/DiffEqsTests.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/DiffEqsWrappersTests/DiffEqsTests.jl b/test/DiffEqsWrappersTests/DiffEqsTests.jl index 3576748..eaf1203 100644 --- a/test/DiffEqsWrappersTests/DiffEqsTests.jl +++ b/test/DiffEqsWrappersTests/DiffEqsTests.jl @@ -93,6 +93,14 @@ prob_iip = DAEProblem{true}(f_iip, u0, u0, tspan, differential_vars = [true,true # sol_iip = Sundials.solve(prob_iip, IDA(), reltol = 1e-8, abstol = 1e-8) # @show sol_iip.u +# To explore the Sundials solver options, e.g., BE with fixed time step dtd +f_iip = DAEFunction{true}(res!; jac = jac!, jac_prototype=J) +# jac_prototype is the way to pass my pre-allocated jacobian matrix +prob_iip = DAEProblem{true}(f_iip, u0, u0, tspan, differential_vars = trues(length(u0))) + +sol_iip = Sundials.solve(prob_iip, IDA(linear_solver=:KLU), reltol = 1e-8, abstol = 1e-8) +#@show sol_iip.u + # or iterator version # integ = init(prob_iip, IDA(), reltol = 1e-8, abstol = 1e-8) # step!(integ)