Skip to content

Commit 88d79e7

Browse files
committed
adds is_integrator_adaptive
1 parent ee0c100 commit 88d79e7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/callbacks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ end
765765

766766
function apply_callback!(integrator,callback::Union{ContinuousCallback,VectorContinuousCallback},cb_time,prev_sign,event_idx)
767767

768-
if integrator.opts.adaptive
768+
if is_integrator_adaptive(integrator)
769769
set_proposed_dt!(integrator, max(nextfloat(integrator.opts.dtmin), callback.dtrelax * integrator.dt))
770770
end
771771

src/integrator_interface.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,3 +574,10 @@ function step!(integ::DEIntegrator, dt::Real, stop_at_tdt = false)
574574
end
575575

576576
has_destats(i::DEIntegrator) = false
577+
578+
"""
579+
is_integrator_adaptive(i::DEIntegrator)
580+
581+
Checks if the integrator is adaptive
582+
"""
583+
is_integrator_adaptive(integrator::DEIntegrator) = integrator.opts.adaptive

0 commit comments

Comments
 (0)