Skip to content

Commit 89e13f9

Browse files
author
Oscar Smith
authored
Merge pull request #2295 from oscardssmith/os/use-StaticW-more
use StaticW more often
2 parents 4fd5afb + 00de324 commit 89e13f9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/derivative_utils.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,8 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits},
872872
else
873873
deepcopy(f.jac_prototype)
874874
end
875-
W = if J isa StaticMatrix && alg isa OrdinaryDiffEqRosenbrockAdaptiveAlgorithm
875+
W = if J isa StaticMatrix
876876
StaticWOperator(J, false)
877-
elseif J isa StaticMatrix
878-
ArrayInterface.lu_instance(J)
879877
else
880878
__f = if IIP
881879
(du, u, p, t) -> _f(du, u, p, t)
@@ -898,7 +896,7 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits},
898896
J
899897
elseif IIP
900898
similar(J)
901-
elseif J isa StaticMatrix && alg isa OrdinaryDiffEqRosenbrockAdaptiveAlgorithm
899+
elseif J isa StaticMatrix
902900
StaticWOperator(J, false)
903901
else
904902
ArrayInterface.lu_instance(J)

test/interface/static_array_tests.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ f = (u, p, t) -> u
4040
ode = ODEProblem(f, u0, (0.0, 1.0))
4141
sol = solve(ode, Euler(), dt = 1e-2)
4242
@test !any(iszero.(sol(1.0))) && !any(sol(1.0) .== u0)
43-
integrator = init(ode, ImplicitEuler())
44-
@test OrdinaryDiffEq.get_W(integrator.cache.nlsolver) isa StaticArrays.LU
4543
sol = solve(ode, ImplicitEuler())
4644
@test !any(iszero.(sol(1.0))) && !any(sol(1.0) .== u0)
4745
sol = solve(ode, ImplicitEuler(nlsolve = NLAnderson()))

0 commit comments

Comments
 (0)