diff --git a/src/DifferentialEquations.jl b/src/DifferentialEquations.jl index 1c1f1c452..5c48cfed5 100644 --- a/src/DifferentialEquations.jl +++ b/src/DifferentialEquations.jl @@ -19,7 +19,7 @@ module DifferentialEquations using LinearAlgebra import DiffEqBase: solve - import LinearSolve + @reexport using LinearSolve include("default_solve.jl") include("default_arg_parsing.jl") diff --git a/src/ode_default_alg.jl b/src/ode_default_alg.jl index 539ca03e5..31aab779d 100644 --- a/src/ode_default_alg.jl +++ b/src/ode_default_alg.jl @@ -41,17 +41,15 @@ function default_algorithm(prob::DiffEqBase.AbstractODEProblem{uType,tType,inpla alg = BS3() end elseif :stiff ∈ alg_hints || mm # The problem is stiff - if length(prob.u0) > 2000 + if length(prob.u0) > 500 # Use Krylov method when huge! - if callbacks && !m + if !mm alg = CVODE_BDF(linear_solver=:GMRES) - elseif !callbacks - alg = QNDF(autodiff=false,linsolve=IterativeSolversJL_GMRES()) - else - alg = Rodas4(autodiff=false) + elseif mm + alg = Rodas4(autodiff=false,linsolve=LinearSolve.KrylovJL_GMRES()) end - elseif length(prob.u0) > 100 - if callbacks && !m + elseif length(prob.u0) > 50 + if callbacks && !mm alg = CVODE_BDF() elseif !callbacks alg = QNDF(autodiff=false) @@ -72,7 +70,9 @@ function default_algorithm(prob::DiffEqBase.AbstractODEProblem{uType,tType,inpla alg = AutoVern9(Rodas5(autodiff=false),lazy=!callbacks) end elseif tol_level == :low_tol - if length(prob.u0) > 100 + if length(prob.u0) > 500 + alg = AutoVern7(Rodas4(autodiff=false,linsolve=LinearSolve.KrylovJL_GMRES()),lazy=!callbacks) + elseif length(prob.u0) > 50 alg = AutoVern7(TRBDF2(autodiff=false),lazy=!callbacks) else alg = AutoVern7(Rodas4(autodiff=false),lazy=!callbacks)