Skip to content

Commit

Permalink
Use WOperator when jac_prototype isa AbstractDiffEqLinearOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Oct 25, 2019
1 parent ff5d989 commit add5e24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/derivative_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ function build_J_W(alg,u,uprev,p,t,dt,f,uEltypeNoUnits,::Val{true})
f.jac_prototype isa SparseMatrixCSC
J = similar(f.jac_prototype)
W = similar(J)
elseif DiffEqBase.has_jac(f) && !DiffEqBase.has_Wfact(f) && f.jac_prototype !== nothing
elseif f.jac_prototype isa DiffEqBase.AbstractDiffEqLinearOperator
W = WOperator(f, dt, true)
J = W.J
else
Expand All @@ -514,7 +514,7 @@ function build_J_W(alg,u,uprev,p,t,dt,f,uEltypeNoUnits,::Val{false})
J = DiffEqArrayOperator(J)
end
W = WOperator(f.mass_matrix, dt, J, false)
elseif DiffEqBase.has_jac(f) && !DiffEqBase.has_Wfact(f) && f.jac_prototype !== nothing
elseif f.jac_prototype isa DiffEqBase.AbstractDiffEqLinearOperator
W = WOperator(f, dt, true)
J = W.J
# https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/pull/672
Expand Down

0 comments on commit add5e24

Please sign in to comment.