From 03133a0bea8c6758e2a7df59bec9121e2ac67c99 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 26 Nov 2024 23:54:58 +0530 Subject: [PATCH] fix: reorder system in `SCCNonlinearProblem` --- src/systems/nonlinear/nonlinearsystem.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/systems/nonlinear/nonlinearsystem.jl b/src/systems/nonlinear/nonlinearsystem.jl index 9dfb37c3d7..8ff4104944 100644 --- a/src/systems/nonlinear/nonlinearsystem.jl +++ b/src/systems/nonlinear/nonlinearsystem.jl @@ -703,6 +703,11 @@ function SciMLBase.SCCNonlinearProblem{iip}(sys::NonlinearSystem, u0map, push!(subprobs, prob) end + new_dvs = dvs[reduce(vcat, var_sccs)] + new_eqs = eqs[reduce(vcat, eq_sccs)] + @set! sys.unknowns = new_dvs + @set! sys.eqs = new_eqs + sys = complete(sys) return SCCNonlinearProblem(subprobs, explicitfuns, sys, p) end