From 8cf92fb7df9c0584299bb925511a99d00ab98f89 Mon Sep 17 00:00:00 2001 From: Alberto Mercurio Date: Sat, 16 Nov 2024 14:28:54 +0100 Subject: [PATCH] Simplify definition of affect! in PresetTimeCallback --- src/preset_time.jl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/preset_time.jl b/src/preset_time.jl index e0e2a125..417386bb 100644 --- a/src/preset_time.jl +++ b/src/preset_time.jl @@ -40,12 +40,6 @@ function PresetTimeCallback(tstops, user_affect!; end end - # Call f, update tnext, and make sure we stop at the new tnext - affect! = function (integrator) - user_affect!(integrator) - nothing - end - # Initialization: first call to `f` should be *before* any time steps have been taken: initialize_preset = function (c, u, t, integrator) initialize(c, u, t, integrator) @@ -64,7 +58,7 @@ function PresetTimeCallback(tstops, user_affect!; user_affect!(integrator) end end - DiscreteCallback(condition, affect!; initialize = initialize_preset, kwargs...) + DiscreteCallback(condition, user_affect!; initialize = initialize_preset, kwargs...) end export PresetTimeCallback