@@ -9,6 +9,19 @@ operation is performed.
99"""
1010abstract type UpdateSignal end
1111
12+ """
13+ UpdateSignalHandler
14+
15+ Updates a value upon receiving an appropriate `UpdateSignal`. This is done by
16+ calling `run!(::UpdateSignalHandler, cache, ::UpdateSignal, f!, args...)`, where
17+ `f!` is function such that `f!(args...)` modifies the desired value in-place.
18+ The `cache` can be obtained with `allocate_cache(::UpdateSignalHandler, FT)`,
19+ where `FT` is the floating-point type of the integrator.
20+ """
21+ abstract type UpdateSignalHandler end
22+
23+ run! (:: UpdateSignalHandler , cache, :: UpdateSignal , f!, args... ) = nothing
24+
1225"""
1326 NewTimeStep(t)
1427
@@ -33,17 +46,6 @@ The signal for a new iteration of Newton's method.
3346"""
3447struct NewNewtonIteration <: UpdateSignal end
3548
36- """
37- UpdateSignalHandler
38-
39- Updates a value upon receiving an appropriate `UpdateSignal`. This is done by
40- calling `run!(::UpdateSignalHandler, cache, ::UpdateSignal, f!, args...)`, where
41- `f!` is function such that `f!(args...)` modifies the desired value in-place.
42- The `cache` can be obtained with `allocate_cache(::UpdateSignalHandler, FT)`,
43- where `FT` is the floating-point type of the integrator.
44- """
45- abstract type UpdateSignalHandler end
46-
4749"""
4850 UpdateEvery(update_signal_type)
4951
@@ -53,7 +55,9 @@ An `UpdateSignalHandler` that performs the update whenever it is `run!` with an
5355struct UpdateEvery{U <: UpdateSignal } <: UpdateSignalHandler end
5456UpdateEvery (:: Type{U} ) where {U} = UpdateEvery {U} ()
5557
56- run! (alg:: UpdateEvery{U} , cache, :: U , f!, args... ) where {U} = f! (args... )
58+ allocate_cache (:: UpdateEvery , _) = nothing
59+
60+ run! (alg:: UpdateEvery{U} , cache, :: U , f!, args... ) where {U <: UpdateSignal } = f! (args... )
5761
5862"""
5963 UpdateEveryN(n, update_signal_type, reset_signal_type = Nothing)
0 commit comments