]> https://gitweb.dealii.org/ - dealii.git/commitdiff
merge fix for BlockSparsityPattern::column_number to mainline
authorTimo Heister <timo.heister@gmail.com>
Sun, 16 Jun 2013 20:07:38 +0000 (20:07 +0000)
committerTimo Heister <timo.heister@gmail.com>
Sun, 16 Jun 2013 20:07:38 +0000 (20:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@29826 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_sparsity_pattern.h

index d520376d1757613c9242d9bafdf2777a3a8b6ad6..46d196eeb370f6683c9d8c1dcf5d3c396b6911f3 100644 (file)
@@ -1350,12 +1350,14 @@ BlockCompressedSimpleSparsityPattern::column_number (const size_type row,
   Assert(index<row_length(row), ExcIndexRange(index, 0, row_length(row)));
 
   size_type c = 0;
+  size_type block_columns = 0; //sum of n_cols for all blocks to the left
   for (unsigned int b=0; b<columns; ++b)
     {
       unsigned int rowlen = sub_objects[row_index.first][b]->row_length (row_index.second);
       if (index<c+rowlen)
-        return c+sub_objects[row_index.first][b]->column_number(row_index.second, index-c);
+        return block_columns+sub_objects[row_index.first][b]->column_number(row_index.second, index-c);
       c += rowlen;
+      block_columns += sub_objects[row_index.first][b]->n_cols();
     }
 
   Assert(false, ExcInternalError());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.