Skip to content

Commit fdf946b

Browse files
author
oscarddssmith
committed
disable autodiff
1 parent ba897b9 commit fdf946b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/solve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,10 @@ function DiffEqBase.__init(
533533
end
534534

535535
function DiffEqBase.__init(prob::ODEProblem, ::Nothing, args...; kwargs...)
536-
DiffEqBase.init(prob, DefaultODEAlgorithm(), args...; kwargs...)
536+
DiffEqBase.init(prob, DefaultODEAlgorithm(autodiff=false), args...; kwargs...)
537537
end
538538
function DiffEqBase.__solve(prob::ODEProblem, ::Nothing, args...; kwargs...)
539-
DiffEqBase.solve(prob, DefaultODEAlgorithm(), args...; kwargs...)
539+
DiffEqBase.solve(prob, DefaultODEAlgorithm(autodiff=false), args...; kwargs...)
540540
end
541541

542542
function DiffEqBase.solve!(integrator::ODEIntegrator)

test/interface/default_solver_tests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function rober(u, p, t)
2727
end
2828
prob_rober = ODEProblem(rober, [1.0,0.0,0.0],(0.0,1e3),(0.04,3e7,1e4))
2929
sol = solve(prob_rober)
30-
rosensol = solve(prob_rober, AutoTsit5(Rosenbrock23()))
30+
rosensol = solve(prob_rober, AutoTsit5(Rosenbrock23(autodiff=false)))
3131
# test that default has the same performance as AutoTsit5(Rosenbrock23()) (which we expect it to use for this).
3232
@test sol.stats.naccept == rosensol.stats.naccept
3333
@test sol.stats.nf == rosensol.stats.nf
@@ -36,7 +36,7 @@ rosensol = solve(prob_rober, AutoTsit5(Rosenbrock23()))
3636
@test sol.alg_choice[end] == 3
3737

3838
sol = solve(prob_rober, reltol=1e-7, abstol=1e-7)
39-
rosensol = solve(prob_rober, AutoVern7(Rodas5P()), reltol=1e-7, abstol=1e-7)
39+
rosensol = solve(prob_rober, AutoVern7(Rodas5P(autodiff=false)), reltol=1e-7, abstol=1e-7)
4040
# test that default has the same performance as AutoTsit5(Rosenbrock23()) (which we expect it to use for this).
4141
@test sol.stats.naccept == rosensol.stats.naccept
4242
@test sol.stats.nf == rosensol.stats.nf
@@ -60,7 +60,7 @@ for n in (100, ) # 600 should be added but currently is broken for unknown reaso
6060

6161
prob_ex_rober = ODEProblem(ODEFunction(exrober; jac_prototype), vcat([1.0,0.0,0.0], ones(n)),(0.0,100.0),(0.04,3e7,1e4))
6262
sol = solve(prob_ex_rober)
63-
fsol = solve(prob_ex_rober, AutoTsit5(FBDF(;linsolve)))
63+
fsol = solve(prob_ex_rober, AutoTsit5(FBDF(;autodiff=false, linsolve)))
6464
# test that default has the same performance as AutoTsit5(Rosenbrock23()) (which we expect it to use for this).
6565
@test sol.stats.naccept == fsol.stats.naccept
6666
@test sol.stats.nf == fsol.stats.nf

0 commit comments

Comments
 (0)