Skip to content

Commit b22e2e5

Browse files
Initialize DISCO checkpoint from the time value (#4069)
Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
1 parent bad7955 commit b22e2e5

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/OrdinaryDiffEqCore/src/solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ Base.@constprop :aggressive function _ode_init(
760760
controller_cache = setup_controller_cache(_alg, cache, controller, EEstT, disco_probs)
761761

762762
is_disco_step = false
763-
disco_checkpoint = zero(tType)
763+
disco_checkpoint = zero(t)
764764
# Seed the initial EEst on the controller cache (was previously
765765
# `integrator.EEst = oneunit(EEstT)`).
766766
set_EEst!(controller_cache, EEst)

test/Downstream/dynamicquantities_measurements.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ using Test
1010
f(u, p, t) = u / (1u"s")
1111
prob = ODEProblem(f, u0, tspan)
1212

13-
sol = solve(prob, Tsit5(); abstol = 1.0e-9, reltol = 1.0e-9)
13+
integrator = init(prob, Tsit5(); abstol = 1.0e-9, reltol = 1.0e-9)
14+
@test integrator.disco_checkpoint == zero(first(tspan))
15+
@test typeof(integrator.disco_checkpoint) == typeof(first(tspan))
16+
17+
sol = solve!(integrator)
1418

1519
@test sol.u[end] isa typeof(u0)
1620
@test eltype(sol.u) == typeof(u0)

0 commit comments

Comments
 (0)