Skip to content

Commit 6278571

Browse files
Merge pull request #2507 from BenChung/affect-preinitialization
Allow configuration of the initialization done after interpolation while applying an affect
2 parents df45e58 + f46d651 commit 6278571

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Hence, we need to have two separate functions.
44

55
function _change_t_via_interpolation!(integrator, t,
6-
modify_save_endpoint::Type{Val{T}}) where {T}
6+
modify_save_endpoint::Type{Val{T}}, reinitialize_alg=nothing) where {T}
77
# Can get rid of an allocation here with a function
88
# get_tmp_arr(integrator.cache) which gives a pointer to some
99
# cache array which can be modified.
@@ -17,7 +17,7 @@ function _change_t_via_interpolation!(integrator, t,
1717
end
1818
integrator.t = t
1919
integrator.dt = integrator.t - integrator.tprev
20-
DiffEqBase.reeval_internals_due_to_modification!(integrator)
20+
DiffEqBase.reeval_internals_due_to_modification!(integrator; callback_initializealg=reinitialize_alg)
2121
if T
2222
solution_endpoint_match_cur_integrator!(integrator)
2323
end
@@ -28,10 +28,10 @@ function DiffEqBase.change_t_via_interpolation!(integrator::ODEIntegrator,
2828
t,
2929
modify_save_endpoint::Type{Val{T}} = Val{
3030
false,
31-
}) where {
31+
}, reinitialize_alg=nothing) where {
3232
T,
3333
}
34-
_change_t_via_interpolation!(integrator, t, modify_save_endpoint)
34+
_change_t_via_interpolation!(integrator, t, modify_save_endpoint, reinitialize_alg)
3535
return nothing
3636
end
3737

0 commit comments

Comments
 (0)