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

Add subsolutions #429

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion src/ensemble/ensemble_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
typeof(sim)}(sim, elapsedTime, converged)
end

Base.reverse(sim::EnsembleSolution) = EnsembleSolution(reverse(sim.u), sim.elapsedTime, sim.converged)
function Base.reverse(sim::EnsembleSolution)
EnsembleSolution(reverse(sim.u), sim.elapsedTime, sim.converged)

Check warning on line 48 in src/ensemble/ensemble_solutions.jl

View check run for this annotation

Codecov / codecov/patch

src/ensemble/ensemble_solutions.jl#L47-L48

Added lines #L47 - L48 were not covered by tests
end

"""
$(TYPEDEF)
Expand Down
2 changes: 1 addition & 1 deletion src/problems/problem_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@
no_color)
end

Base.copy(p::SciMLBase.NullParameters) = p
Base.copy(p::SciMLBase.NullParameters) = p

Check warning on line 182 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L182

Added line #L182 was not covered by tests
13 changes: 9 additions & 4 deletions src/solutions/ode_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ https://docs.sciml.ai/DiffEqDocs/stable/basics/solution/
[the return code documentation](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes).
"""
struct ODESolution{T, N, uType, uType2, DType, tType, rateType, P, A, IType, S,
AC <: Union{Nothing, Vector{Int}}} <:
AC <: Union{Nothing, Vector{Int}}, SSS} <:
AbstractODESolution{T, N, uType}
u::uType
u_analytic::uType2
Expand All @@ -42,6 +42,7 @@ struct ODESolution{T, N, uType, uType2, DType, tType, rateType, P, A, IType, S,
stats::S
alg_choice::AC
retcode::ReturnCode.T
subsolutions::SSS
end

Base.@propagate_inbounds function Base.getproperty(x::AbstractODESolution, s::Symbol)
Expand All @@ -53,12 +54,16 @@ Base.@propagate_inbounds function Base.getproperty(x::AbstractODESolution, s::Sy
end

function ODESolution{T, N}(u, u_analytic, errors, t, k, prob, alg, interp, dense,
tslocation, stats, alg_choice, retcode) where {T, N}
tslocation, stats, alg_choice, retcode,
subsolutions = nothing) where {T, N}
return ODESolution{T, N, typeof(u), typeof(u_analytic), typeof(errors), typeof(t),
typeof(k), typeof(prob), typeof(alg), typeof(interp),
typeof(stats),
typeof(alg_choice)}(u, u_analytic, errors, t, k, prob, alg, interp,
dense, tslocation, stats, alg_choice, retcode)
typeof(alg_choice), typeof(subsolutions)}(u, u_analytic, errors, t,
k, prob, alg, interp,
dense, tslocation, stats,
alg_choice, retcode,
subsolutions)
end

function (sol::AbstractODESolution)(t, ::Type{deriv} = Val{0}; idxs = nothing,
Expand Down
2 changes: 1 addition & 1 deletion src/solutions/pde_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct PDENoTimeSolution{T, N, uType, Disc, Sol, domType, ivType, dvType, P, A,
retcode::ReturnCode.T
stats::S
end

TruncatedStacktraces.@truncate_stacktrace PDENoTimeSolution 1 2

const PDESolution{T, N, S, D} = Union{PDETimeSeriesSolution{T, N, S, D},
Expand Down
Loading