From 715df0c634db251e34565d8b4513d34f2c0e9128 Mon Sep 17 00:00:00 2001
From: Ferhat Mihoubi <ferhat.mihoubi@univ-evry.fr>
Date: Thu, 8 Mar 2012 15:28:17 +0100
Subject: [PATCH] Adds the index of equations (M_.blocksEQU) for a block
 decomposed model without bytecode option and use this index in resid.m to
 retrieve the residuals

---
 StaticModel.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/StaticModel.cc b/StaticModel.cc
index c3f8db06..f2870a67 100644
--- a/StaticModel.cc
+++ b/StaticModel.cc
@@ -1502,6 +1502,15 @@ StaticModel::writeOutput(ostream &output, bool block) const
 
       output << "];" << endl;
     }
+  output << "M_.blocksEQU = cell(" << nb_blocks << ", 1);" << endl;
+  for (int b = 0; b < (int) nb_blocks; b++)
+    {
+      unsigned int block_size = getBlockSize(b);
+      output << "M_.blocksEQU{" << b+1 << "} = [ ";
+      for (int i = 0; i < (int) block_size; i++)
+         output << getBlockEquationID(b, i)+1 << "; ";
+      output << "];" << endl;
+    }
 }
 
 SymbolType
-- 
GitLab