Skip to content

Commit

Permalink
Merge pull request #840 from SciML/defaults
Browse files Browse the repository at this point in the history
Improve defaults and reexport LinearSolve
  • Loading branch information
ChrisRackauckas authored Jan 11, 2022
2 parents 45b61ea + e0fb0eb commit e57294b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/DifferentialEquations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
18 changes: 9 additions & 9 deletions src/ode_default_alg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit e57294b

Please sign in to comment.