Skip to content

Commit

Permalink
Merge pull request #2507 from BenChung/affect-preinitialization
Browse files Browse the repository at this point in the history
Allow configuration of the initialization done after interpolation while applying an affect
  • Loading branch information
ChrisRackauckas authored Nov 7, 2024
2 parents df45e58 + f46d651 commit 6278571
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Hence, we need to have two separate functions.

function _change_t_via_interpolation!(integrator, t,
modify_save_endpoint::Type{Val{T}}) where {T}
modify_save_endpoint::Type{Val{T}}, reinitialize_alg=nothing) where {T}
# Can get rid of an allocation here with a function
# get_tmp_arr(integrator.cache) which gives a pointer to some
# cache array which can be modified.
Expand All @@ -17,7 +17,7 @@ function _change_t_via_interpolation!(integrator, t,
end
integrator.t = t
integrator.dt = integrator.t - integrator.tprev
DiffEqBase.reeval_internals_due_to_modification!(integrator)
DiffEqBase.reeval_internals_due_to_modification!(integrator; callback_initializealg=reinitialize_alg)
if T
solution_endpoint_match_cur_integrator!(integrator)
end
Expand All @@ -28,10 +28,10 @@ function DiffEqBase.change_t_via_interpolation!(integrator::ODEIntegrator,
t,
modify_save_endpoint::Type{Val{T}} = Val{
false,
}) where {
}, reinitialize_alg=nothing) where {
T,
}
_change_t_via_interpolation!(integrator, t, modify_save_endpoint)
_change_t_via_interpolation!(integrator, t, modify_save_endpoint, reinitialize_alg)
return nothing
end

Expand Down

0 comments on commit 6278571

Please sign in to comment.