Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/integrator_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,29 @@ end
addsteps!(i::DEIntegrator, args...) = nothing

"""
reeval_internals_due_to_modification!(integrator::DEIntegrator, continuous_modification=true)
reeval_internals_due_to_modification!(integrator::DEIntegrator, continuous_modification::Bool=true;
callback_initializealg = nothing)

Update DE integrator after changes by callbacks.
For DAEs (either implicit or semi-explicit), this requires re-solving alebraic variables.
If continuous_modification is true (or unspecified), this should also recalculate interpolation data.
Otherwise the integrator is allowed to skip recalculating the interpolation.

# Arguments

- `continuous_modification`: determines whether the modification is due to a continuous change (continuous callback)
or a discrete callback. For a continuous change, this can include a change to time which requires a re-evaluation
of the interpolations.
- `callback_initializealg`: the initialization algorithm provided by the callback. For DAEs, this is the choice for the
initialization that is done post callback. The default value of `nothing` means that the initialization choice
used for the DAE should be performed post-callback.
Comment on lines +334 to +339
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
- `continuous_modification`: determines whether the modification is due to a continuous change (continuous callback)
or a discrete callback. For a continuous change, this can include a change to time which requires a re-evaluation
of the interpolations.
- `callback_initializealg`: the initialization algorithm provided by the callback. For DAEs, this is the choice for the
initialization that is done post callback. The default value of `nothing` means that the initialization choice
used for the DAE should be performed post-callback.
- `continuous_modification`: determines whether the modification is due to a continuous change (continuous callback)
or a discrete callback. For a continuous change, this can include a change to time which requires a re-evaluation
of the interpolations.
- `callback_initializealg`: the initialization algorithm provided by the callback. For DAEs, this is the choice for the
initialization that is done post callback. The default value of `nothing` means that the initialization choice
used for the DAE should be performed post-callback.

"""
function reeval_internals_due_to_modification!(
integrator::DEIntegrator, continuous_modification)
integrator::DEIntegrator, continuous_modification::Bool;
callback_initializealg = nothing)
reeval_internals_due_to_modification!(integrator::DEIntegrator)
end
reeval_internals_due_to_modification!(integrator::DEIntegrator) = nothing
reeval_internals_due_to_modification!(integrator::DEIntegrator; callback_initializealg = nothing) = nothing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
reeval_internals_due_to_modification!(integrator::DEIntegrator; callback_initializealg = nothing) = nothing
function reeval_internals_due_to_modification!(
integrator::DEIntegrator; callback_initializealg = nothing)
nothing
end


"""
set_t!(integrator::DEIntegrator, t)
Expand Down
Loading