diff --git a/src/initialization.jl b/src/initialization.jl index 605300a61..993d10686 100644 --- a/src/initialization.jl +++ b/src/initialization.jl @@ -32,7 +32,8 @@ struct OverrideInitData{IProb, UIProb, IProbMap, IProbPmap} function OverrideInitData(initprob::I, update_initprob!::J, initprobmap::K, initprobpmap::L) where {I, J, K, L} - @assert initprob isa Union{NonlinearProblem, NonlinearLeastSquaresProblem} + @assert initprob isa + Union{SCCNonlinearProblem, NonlinearProblem, NonlinearLeastSquaresProblem} return new{I, J, K, L}(initprob, update_initprob!, initprobmap, initprobpmap) end end diff --git a/src/problems/nonlinear_problems.jl b/src/problems/nonlinear_problems.jl index 43c6e5f9c..b2a9989c4 100644 --- a/src/problems/nonlinear_problems.jl +++ b/src/problems/nonlinear_problems.jl @@ -472,7 +472,8 @@ mutable struct SCCNonlinearProblem{uType, iip, P, E, I, Par} <: function SCCNonlinearProblem{P, E, I, Par}( probs::P, funs::E, indp::I, pobj::Par, alias::Bool) where {P, E, I, Par} - u0 = mapreduce(state_values, vcat, probs) + u0 = mapreduce( + state_values, vcat, probs; init = similar(state_values(first(probs)), 0)) uType = typeof(u0) new{uType, false, P, E, I, Par}(probs, funs, indp, pobj, alias) end @@ -501,7 +502,8 @@ function SymbolicIndexingInterface.parameter_values(prob::SCCNonlinearProblem) prob.parameter_object end function SymbolicIndexingInterface.state_values(prob::SCCNonlinearProblem) - mapreduce(state_values, vcat, prob.probs) + mapreduce( + state_values, vcat, prob.probs; init = similar(state_values(first(prob.probs)), 0)) end function SymbolicIndexingInterface.set_state!(prob::SCCNonlinearProblem, val, idx)