Skip to content

Commit

Permalink
make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Sep 4, 2024
1 parent 01f867c commit 77ed1ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits},
# Thus setup JacVec and a concrete J, using sparsity when possible
_f = islin ? (isode ? f.f : f.f1.f) : f
J = if f.jac_prototype === nothing
ArrayInterface.undefmatrix(u)
ArrayInterface.zeromatrix(u)
else
deepcopy(f.jac_prototype)
end
Expand All @@ -907,10 +907,11 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, ::Type{uEltypeNoUnits},
f.jac(uprev, p, t)
end
elseif f.jac_prototype === nothing
ArrayInterface.undefmatrix(u)
ArrayInterface.zeromatrix(u)
else
deepcopy(f.jac_prototype)
end

W = if alg isa DAEAlgorithm
J
elseif IIP
Expand Down Expand Up @@ -1003,4 +1004,4 @@ function resize_J_W!(cache, integrator, i)
end

nothing
end
end
2 changes: 1 addition & 1 deletion lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end

function wrapprecs(linsolver, W, weight)
if isnothing(linsolver)
linsolver = LinearSolve.defaultalg(W, weight, LinearSolve.OperatorAssumptions(true))
linsolver = LinearSolve.LUFactorization()
end
if hasproperty(linsolver, :precs) && isnothing(linsolver.precs)
Pl = LinearSolve.InvPreconditioner(Diagonal(_vec(weight)))
Expand Down

0 comments on commit 77ed1ac

Please sign in to comment.