Skip to content

Commit 8a8b0d4

Browse files
Merge pull request #2560 from SciML/linear_interp
Refactor & Generalize: System for opting alg into linear interpolation
2 parents 4b29bab + 42b98fc commit 8a8b0d4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/OrdinaryDiffEqCore/src/alg_utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,6 @@ function Base.show(io::IO, ::MIME"text/plain", alg::OrdinaryDiffEqAlgorithm)
444444
end
445445
print(io, ")")
446446
end
447+
448+
# Defaults in the current system: currently opt out DAEAlgorithms until complete
449+
default_linear_interpolation(alg, prob) = alg isa DAEAlgorithm || prob isa DiscreteProblem

lib/OrdinaryDiffEqCore/src/solve.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ function DiffEqBase.__init(
2626
saveat isa Number || prob.tspan[1] in saveat,
2727
save_end = nothing,
2828
callback = nothing,
29-
dense = save_everystep &&
30-
!(alg isa DAEAlgorithm) && !(prob isa DiscreteProblem) &&
31-
isempty(saveat),
29+
dense = save_everystep && isempty(saveat) && !default_linear_interpolation(prob, alg),
3230
calck = (callback !== nothing && callback !== CallbackSet()) ||
3331
(dense) || !isempty(saveat), # and no dense output
3432
dt = isdiscretealg(alg) && isempty(tstops) ?

0 commit comments

Comments
 (0)