Skip to content

Commit a56e2ab

Browse files
change to tuple form
1 parent 539af20 commit a56e2ab

File tree

2 files changed

+3
-43
lines changed

2 files changed

+3
-43
lines changed

src/problems/nonlinear_problems.jl

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -370,46 +370,6 @@ For specifying Jacobians and mass matrices, see the
370370
* `p`: The parameters for the problem. Defaults to `NullParameters`.
371371
* `kwargs`: The keyword arguments passed on to the solvers.
372372
"""
373-
mutable struct SCCNonlinearProblem{uType, isinplace, P, F, K, PT} <:
374-
AbstractNonlinearProblem{uType, isinplace}
375-
f::F
376-
u0::uType
377-
p::P
378-
problem_type::PT
379-
kwargs::K
380-
@add_kwonly function SCCNonlinearProblem{iip}(f::Union{AbstractVector,Tuple},
381-
u0::Union{AbstractVector,Tuple},
382-
p = NullParameters(),
383-
problem_type = StandardNonlinearProblem();
384-
kwargs...) where {iip}
385-
if !(eltype(f) <: AbstractNonlinearFunction)
386-
f = NonlinearFunction{iip}.(f)
387-
end
388-
389-
eltype(u0) <: AbstractVector || error("!(eltype(u0) <: AbstractVector) detected. SCC states must be vector.")
390-
length(f) != length(u0) && error("Number of SCCs undefined. length(f) = $(length(f)) != $(length(u0)) == length(u0)")
391-
392-
if haskey(kwargs, :p)
393-
error("`p` specified as a keyword argument `p = $(kwargs[:p])` to `NonlinearProblem`. This is not supported.")
394-
end
395-
warn_paramtype(p)
396-
new{typeof(u0), iip, typeof(p), typeof(f),
397-
typeof(kwargs), typeof(problem_type)}(f,
398-
u0,
399-
p,
400-
problem_type,
401-
kwargs)
402-
end
373+
mutable struct SCCNonlinearProblem{P}
374+
probs::P
403375
end
404-
405-
"""
406-
$(SIGNATURES)
407-
"""
408-
function SCCNonlinearProblem(f::Union{AbstractVector,Tuple}, u0::Union{AbstractVector,Tuple}, p = NullParameters(); kwargs...)
409-
if !(eltype(f) <: AbstractNonlinearFunction)
410-
f = NonlinearFunction.(f)
411-
end
412-
all(isinplace,f) || all(!inplace,f) || error("All SCC Functions must match in-placeness")
413-
iip = isinplace(f[1])
414-
SCCNonlinearProblem{iip}(f, u0, p; kwargs...)
415-
end

src/solutions/nonlinear_solutions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const SteadyStateSolution = NonlinearSolution
7070

7171
get_p(p::AbstractNonlinearSolution) = p.prob.p
7272

73-
function build_solution(prob::AbstractNonlinearProblem,
73+
function build_solution(prob::Union{AbstractNonlinearProblem, SCCNonlinearProblem},
7474
alg, u, resid; calculate_error = true,
7575
retcode = ReturnCode.Default,
7676
original = nothing,

0 commit comments

Comments
 (0)