diff --git a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl index e351ab54c3..ba69a057e5 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl @@ -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 @@ -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 @@ -1003,4 +1004,4 @@ function resize_J_W!(cache, integrator, i) end nothing -end \ No newline at end of file +end diff --git a/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl b/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl index 443ebca5fa..4e77d66fc9 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl @@ -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)))