Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More general history function #201

Merged
merged 3 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DelayDiffEq"
uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb"
authors = ["Chris Rackauckas <[email protected]>"]
version = "5.28.1"
version = "5.28.2"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
4 changes: 2 additions & 2 deletions src/history_function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function (f::HistoryFunction)(p, t, ::Type{Val{deriv}}=Val{0}; idxs=nothing) whe
# handle extrapolations at initial time point
return constant_extrapolant(t, integrator, idxs, Val{deriv})
else
return OrdinaryDiffEq.current_interpolant(t, integrator, idxs, Val{deriv})
return integrator(t, Val{deriv}; idxs=idxs)
end
end

Expand Down Expand Up @@ -87,6 +87,6 @@ function (f::HistoryFunction)(val, p, t, ::Type{Val{deriv}}=Val{0}; idxs=nothing
# handle extrapolations at initial time point
return constant_extrapolant!(val, t, integrator, idxs, Val{deriv})
else
return OrdinaryDiffEq.current_interpolant!(val, t, integrator, idxs, Val{deriv})
return integrator(val, t, Val{deriv}; idxs=idxs)
end
end
10 changes: 10 additions & 0 deletions src/integrators/type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ mutable struct HistoryODEIntegrator{algType,IIP,uType,tType,tdirType,ksEltype,So
cache::CacheType
end

function (integrator::HistoryODEIntegrator)(t, deriv::Type=Val{0}; idxs=nothing)
OrdinaryDiffEq.current_interpolant(t, integrator, idxs, deriv)
end

function (integrator::HistoryODEIntegrator)(
val::AbstractArray, t::Union{Number,AbstractArray}, deriv::Type=Val{0}; idxs=nothing
)
OrdinaryDiffEq.current_interpolant!(val, t, integrator, idxs, deriv)
end

mutable struct DDEIntegrator{algType,IIP,uType,tType,P,eigenType,tTypeNoUnits,tdirType,
ksEltype,SolType,F,CacheType,IType,FP,O,dAbsType,dRelType,H,
tstopsType,discType,FSALType,EventErrorType,CallbackCacheType} <: AbstractDDEIntegrator{algType,IIP,uType,tType}
Expand Down