From 38c29061e18ba071d878ea26b759b1937000df60 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/systems/nonlinear/nonlinearsystem.jl b/src/systems/nonlinear/nonlinearsystem.jl index e31638a452..1b9f9faa53 100644 --- a/src/systems/nonlinear/nonlinearsystem.jl +++ b/src/systems/nonlinear/nonlinearsystem.jl @@ -698,6 +698,10 @@ 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 return SCCNonlinearProblem(subprobs, explicitfuns, sys, p) end