diff --git a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl index a5babda26f..da627a55f8 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl @@ -335,7 +335,7 @@ function Base.convert(::Type{AbstractMatrix}, W::WOperator{IIP}) where {IIP} else # Non-allocating already updated #_W = W._concrete_form - #jacobian2W!(_W, W.mass_matrix, W.gamma, W.J, W.transform) + #jacobian2W!(_W, W.mass_matrix, W.gamma, convert(AbstractMatrix, W.J), W.transform) end return W._concrete_form end @@ -455,7 +455,11 @@ function do_newJW(integrator, alg, nlsolver, repeat_step)::NTuple{2, Bool} integrator.iter <= 1 && return true, true # at least one JW eval at the start repeat_step && return false, false islin, _ = islinearfunction(integrator) - islin && return false, false # no further JW eval when it's linear + if islin + # no further J eval when it's linear + # W eval needed if not adaptive + return false, !integrator.opts.adaptive + end !integrator.opts.adaptive && return true, true # Not adaptive will always refactorize errorfail = integrator.EEst > one(integrator.EEst) if alg isa DAEAlgorithm