Skip to content

Commit 1c5b34a

Browse files
Fix downstream AD tests
This is because the norm on (u=tracked, t=tracked) returns a tracked value, which is required for differentiating appropriately w.r.t. callback time. However, this value is just being saved for non-differentiable logic in order to know whether to include the first interval or not in the search process, and so it should be dropped.
1 parent 5de3824 commit 1c5b34a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/callbacks.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ function find_callback_time(integrator, callback::ContinuousCallback, counter)
432432
end
433433
Θ = bisection(zero_func, (bottom_t, top_t), isone(integrator.tdir),
434434
callback.rootfind, callback.abstol, callback.reltol)
435-
integrator.last_event_error = ODE_DEFAULT_NORM(zero_func(Θ), Θ)
435+
integrator.last_event_error = DiffEqBase.value(ODE_DEFAULT_NORM(zero_func(Θ), Θ))
436436
end
437437
#Θ = prevfloat(...)
438438
# prevfloat guerentees that the new time is either 1 floating point
@@ -507,9 +507,7 @@ function find_callback_time(integrator, callback::VectorContinuousCallback, coun
507507
isone(integrator.tdir), callback.rootfind,
508508
callback.abstol, callback.reltol)
509509
if integrator.tdir * Θ < integrator.tdir * min_t
510-
integrator.last_event_error = ODE_DEFAULT_NORM(
511-
zero_func(Θ),
512-
Θ)
510+
integrator.last_event_error = DiffEqBase.value(ODE_DEFAULT_NORM(zero_func(Θ), Θ))
513511
end
514512
end
515513
if integrator.tdir * Θ < integrator.tdir * min_t

0 commit comments

Comments
 (0)