]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Cleanup: only revert the global-to-local numbering in the parallel case.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 12 Jun 2015 01:00:03 +0000 (20:00 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 12 Jun 2015 02:31:12 +0000 (21:31 -0500)
source/dofs/dof_renumbering.cc

index d197d5178afe98aa91c6cbb97db8aba85ac9f2f7..d0cd8f6d4f722bb00db2e389bf796f1b57973349 100644 (file)
@@ -422,7 +422,7 @@ namespace DoFRenumbering
         for (unsigned int i=0; i<locally_owned.n_elements(); ++i)
           {
             const types::global_dof_index row = locally_owned.nth_index_in_set(i);
-            row_entries.resize(0);
+            row_entries.clear();
             for (DynamicSparsityPattern::iterator it =
                    dsp.begin(row); it != dsp.end(row); ++it)
               if (it->column() != row && locally_owned.is_element(it->column()))
@@ -431,23 +431,24 @@ namespace DoFRenumbering
                                  true);
           }
 
-        AssertDimension(new_indices.size(), sparsity.n_rows());
+        AssertDimension(new_indices.size(), locally_owned.n_elements());
         SparsityTools::reorder_Cuthill_McKee (sparsity, new_indices,
                                               starting_indices);
+        if (reversed_numbering)
+          new_indices = Utilities::reverse_permutation (new_indices);
+
+        // convert indices back to global index space
+        for (std::size_t i=0; i<new_indices.size(); ++i)
+          new_indices[i] = locally_owned.nth_index_in_set(new_indices[i]);
       }
     else
       {
         AssertDimension(new_indices.size(), dsp.n_rows());
         SparsityTools::reorder_Cuthill_McKee (dsp, new_indices,
                                               starting_indices);
+        if (reversed_numbering)
+          new_indices = Utilities::reverse_permutation (new_indices);
       }
-
-    if (reversed_numbering)
-      new_indices = Utilities::reverse_permutation (new_indices);
-
-    // convert indices back to global index space
-    for (std::size_t i=0; i<new_indices.size(); ++i)
-      new_indices[i] = locally_owned.nth_index_in_set(new_indices[i]);
   }
 
 

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.