Skip to content

Commit 740db3d

Browse files
committed
Allow storing a trace object in NonlinearSolution
1 parent f6b059c commit 740db3d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SciMLBase"
22
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
33
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com> and contributors"]
4-
version = "2.8.2"
4+
version = "2.9.0"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

src/solutions/nonlinear_solutions.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ or the steady state solution to a differential equation defined by a SteadyState
5252
- `right`: if the solver is bracketing method, this is the final right bracket value.
5353
- `stats`: statistics of the solver, such as the number of function evaluations required.
5454
"""
55-
struct NonlinearSolution{T, N, uType, R, P, A, O, uType2, S} <:
55+
struct NonlinearSolution{T, N, uType, R, P, A, O, uType2, S, Tr} <:
5656
AbstractNonlinearSolution{T, N}
5757
u::uType
5858
resid::R
@@ -63,6 +63,7 @@ struct NonlinearSolution{T, N, uType, R, P, A, O, uType2, S} <:
6363
left::uType2
6464
right::uType2
6565
stats::S
66+
trace::Tr
6667
end
6768

6869
TruncatedStacktraces.@truncate_stacktrace NonlinearSolution 1 2
@@ -78,14 +79,14 @@ function build_solution(prob::AbstractNonlinearProblem,
7879
left = nothing,
7980
right = nothing,
8081
stats = nothing,
82+
trace = nothing,
8183
kwargs...)
8284
T = eltype(eltype(u))
8385
N = ndims(u)
8486

8587
NonlinearSolution{T, N, typeof(u), typeof(resid), typeof(prob), typeof(alg),
86-
typeof(original), typeof(left), typeof(stats)}(u, resid, prob, alg,
87-
retcode, original,
88-
left, right, stats)
88+
typeof(original), typeof(left), typeof(stats), typeof(trace)}(u, resid, prob, alg,
89+
retcode, original, left, right, stats, trace)
8990
end
9091

9192
function sensitivity_solution(sol::AbstractNonlinearSolution, u)
@@ -94,6 +95,6 @@ function sensitivity_solution(sol::AbstractNonlinearSolution, u)
9495

9596
NonlinearSolution{T, N, typeof(u), typeof(sol.resid), typeof(sol.prob),
9697
typeof(sol.alg), typeof(sol.original), typeof(sol.left),
97-
typeof(sol.stats)}(u, sol.resid, sol.prob, sol.alg, sol.retcode,
98-
sol.original, sol.left, sol.right, sol.stats)
98+
typeof(sol.stats), trace(sol.trace)}(u, sol.resid, sol.prob, sol.alg, sol.retcode,
99+
sol.original, sol.left, sol.right, sol.stats, sol.trace)
99100
end

0 commit comments

Comments
 (0)