Skip to content

Commit 23da7db

Browse files
Update callbacks.jl
1 parent df4fea8 commit 23da7db

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/callbacks.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ function find_callback_time(integrator,callback)
111111
end
112112
callback.condition(integrator.tprev+Θ*integrator.dt,tmp,integrator)
113113
end
114-
Θ = prevfloat(prevfloat(find_zero(zero_func,(bottom_θ,top_Θ),FalsePosition(),abstol = callback.abstol/10)))
115-
# 2 prevfloat guerentees that the new time is either 1 or 2 floating point
116-
# numbers just before the event, but not after. If there's a barrier
117-
# which is never supposed to be crossed, then this will ensure that
114+
Θ = prevfloat(find_zero(zero_func,(bottom_θ,top_Θ),FalsePosition(),abstol = callback.abstol/10))
115+
#Θ = prevfloat(...)
116+
# prevfloat guerentees that the new time is either 1 floating point
117+
# numbers just before the event or directly at zero, but not after.
118+
# If there's a barrier which is never supposed to be crossed,
119+
# then this will ensure that
118120
# The item never leaves the domain. Otherwise Roots.jl can return
119121
# a float which is slightly after, making it out of the domain, causing
120122
# havoc.

0 commit comments

Comments
 (0)