From 32733836b9404ae779c63308f789e44d121c89d7 Mon Sep 17 00:00:00 2001 From: Utkarsh Date: Tue, 2 Feb 2021 01:00:55 +0530 Subject: [PATCH 1/3] Add left & right params for Bracketing methods --- src/solutions/nonlinear_solutions.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/solutions/nonlinear_solutions.jl b/src/solutions/nonlinear_solutions.jl index 3006986f8..cd7cf8fec 100644 --- a/src/solutions/nonlinear_solutions.jl +++ b/src/solutions/nonlinear_solutions.jl @@ -8,6 +8,8 @@ struct NonlinearSolution{T,N,uType,R,P,A,O} <: AbstractNonlinearSolution{T,N} alg::A retcode::Symbol original::O + left::uType + right::uType end const SteadyStateSolution = NonlinearSolution @@ -16,6 +18,8 @@ function build_solution(prob::AbstractNonlinearProblem, alg,u,resid;calculate_error = true, retcode = :Default, original = nothing, + left = nothing, + right = nothing, kwargs...) T = eltype(eltype(u)) From 4d76908c24481370ae73c0d71ef31bbc1af0a308 Mon Sep 17 00:00:00 2001 From: Utkarsh Date: Tue, 2 Feb 2021 01:11:48 +0530 Subject: [PATCH 2/3] Pass params to constructor --- src/solutions/nonlinear_solutions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solutions/nonlinear_solutions.jl b/src/solutions/nonlinear_solutions.jl index cd7cf8fec..3d48f7e2c 100644 --- a/src/solutions/nonlinear_solutions.jl +++ b/src/solutions/nonlinear_solutions.jl @@ -27,7 +27,7 @@ function build_solution(prob::AbstractNonlinearProblem, NonlinearSolution{T,N,typeof(u),typeof(resid), typeof(prob),typeof(alg),typeof(original)}( - u,resid,prob,alg,retcode,original) + u,resid,prob,alg,retcode,original,left,right) end function sensitivity_solution(sol::AbstractNonlinearProblem,u) From 7c3a4f6ffac3de69f2730b2b17f8d7a4a27a8d1f Mon Sep 17 00:00:00 2001 From: Utkarsh Date: Tue, 2 Feb 2021 01:39:48 +0530 Subject: [PATCH 3/3] Minor fixes --- src/solutions/nonlinear_solutions.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/solutions/nonlinear_solutions.jl b/src/solutions/nonlinear_solutions.jl index 3d48f7e2c..32aabde27 100644 --- a/src/solutions/nonlinear_solutions.jl +++ b/src/solutions/nonlinear_solutions.jl @@ -1,15 +1,15 @@ """ $(TYPEDEF) """ -struct NonlinearSolution{T,N,uType,R,P,A,O} <: AbstractNonlinearSolution{T,N} +struct NonlinearSolution{T,N,uType,R,P,A,O,uType2} <: AbstractNonlinearSolution{T,N} u::uType resid::R prob::P alg::A retcode::Symbol original::O - left::uType - right::uType + left::uType2 + right::uType2 end const SteadyStateSolution = NonlinearSolution @@ -26,16 +26,16 @@ function build_solution(prob::AbstractNonlinearProblem, N = length((size(prob.u0)...,)) NonlinearSolution{T,N,typeof(u),typeof(resid), - typeof(prob),typeof(alg),typeof(original)}( + typeof(prob),typeof(alg),typeof(original),typeof(left)}( u,resid,prob,alg,retcode,original,left,right) end -function sensitivity_solution(sol::AbstractNonlinearProblem,u) +function sensitivity_solution(sol::AbstractNonlinearSolution,u) T = eltype(eltype(u)) N = length((size(sol.prob.u0)...,)) NonlinearSolution{T,N,typeof(u),typeof(sol.resid), typeof(sol.prob),typeof(sol.alg), - typeof(sol.original)}( - u,sol.resid,sol.prob,sol.alg,sol.retcode,sol.original) + typeof(sol.original),typeof(sol.left)}( + u,sol.resid,sol.prob,sol.alg,sol.retcode,sol.original,sol.left,sol.right) end