Skip to content

Commit e57294b

Browse files
Merge pull request #840 from SciML/defaults
Improve defaults and reexport LinearSolve
2 parents 45b61ea + e0fb0eb commit e57294b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/DifferentialEquations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module DifferentialEquations
1919
using LinearAlgebra
2020

2121
import DiffEqBase: solve
22-
import LinearSolve
22+
@reexport using LinearSolve
2323

2424
include("default_solve.jl")
2525
include("default_arg_parsing.jl")

src/ode_default_alg.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@ function default_algorithm(prob::DiffEqBase.AbstractODEProblem{uType,tType,inpla
4141
alg = BS3()
4242
end
4343
elseif :stiff alg_hints || mm # The problem is stiff
44-
if length(prob.u0) > 2000
44+
if length(prob.u0) > 500
4545
# Use Krylov method when huge!
46-
if callbacks && !m
46+
if !mm
4747
alg = CVODE_BDF(linear_solver=:GMRES)
48-
elseif !callbacks
49-
alg = QNDF(autodiff=false,linsolve=IterativeSolversJL_GMRES())
50-
else
51-
alg = Rodas4(autodiff=false)
48+
elseif mm
49+
alg = Rodas4(autodiff=false,linsolve=LinearSolve.KrylovJL_GMRES())
5250
end
53-
elseif length(prob.u0) > 100
54-
if callbacks && !m
51+
elseif length(prob.u0) > 50
52+
if callbacks && !mm
5553
alg = CVODE_BDF()
5654
elseif !callbacks
5755
alg = QNDF(autodiff=false)
@@ -72,7 +70,9 @@ function default_algorithm(prob::DiffEqBase.AbstractODEProblem{uType,tType,inpla
7270
alg = AutoVern9(Rodas5(autodiff=false),lazy=!callbacks)
7371
end
7472
elseif tol_level == :low_tol
75-
if length(prob.u0) > 100
73+
if length(prob.u0) > 500
74+
alg = AutoVern7(Rodas4(autodiff=false,linsolve=LinearSolve.KrylovJL_GMRES()),lazy=!callbacks)
75+
elseif length(prob.u0) > 50
7676
alg = AutoVern7(TRBDF2(autodiff=false),lazy=!callbacks)
7777
else
7878
alg = AutoVern7(Rodas4(autodiff=false),lazy=!callbacks)

0 commit comments

Comments
 (0)