From e49655bceb2da4c9db95132297213046a1722148 Mon Sep 17 00:00:00 2001 From: Benjamin Chung Date: Thu, 31 Oct 2024 15:51:11 -0700 Subject: [PATCH 1/2] Allow configuration of the initialization done during the pre-affect phase --- .../src/integrators/integrator_interface.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl b/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl index b629a81141..74ce70d8c3 100644 --- a/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl +++ b/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl @@ -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}}, reinitialization_method=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. @@ -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=reinitialization_method) if T solution_endpoint_match_cur_integrator!(integrator) end @@ -28,10 +28,10 @@ function DiffEqBase.change_t_via_interpolation!(integrator::ODEIntegrator, t, modify_save_endpoint::Type{Val{T}} = Val{ false, - }) where { + }, reinitialization_method=nothing) where { T, } - _change_t_via_interpolation!(integrator, t, modify_save_endpoint) + _change_t_via_interpolation!(integrator, t, modify_save_endpoint, reinitialization_method) return nothing end From f46d65132669c327bd8fd058d45a6dba98944c35 Mon Sep 17 00:00:00 2001 From: Benjamin Chung Date: Mon, 4 Nov 2024 15:04:08 -0800 Subject: [PATCH 2/2] Change reinitialization_method to reinitialize_alg --- .../src/integrators/integrator_interface.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl b/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl index 74ce70d8c3..e64e03dc39 100644 --- a/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl +++ b/lib/OrdinaryDiffEqCore/src/integrators/integrator_interface.jl @@ -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}}, reinitialization_method=nothing) 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. @@ -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; callback_initializealg=reinitialization_method) + DiffEqBase.reeval_internals_due_to_modification!(integrator; callback_initializealg=reinitialize_alg) if T solution_endpoint_match_cur_integrator!(integrator) end @@ -28,10 +28,10 @@ function DiffEqBase.change_t_via_interpolation!(integrator::ODEIntegrator, t, modify_save_endpoint::Type{Val{T}} = Val{ false, - }, reinitialization_method=nothing) where { + }, reinitialize_alg=nothing) where { T, } - _change_t_via_interpolation!(integrator, t, modify_save_endpoint, reinitialization_method) + _change_t_via_interpolation!(integrator, t, modify_save_endpoint, reinitialize_alg) return nothing end