]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do not worry too much about the 1d case -- everything is cheap there. Conserve
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 31 Dec 2012 01:03:37 +0000 (01:03 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 31 Dec 2012 01:03:37 +0000 (01:03 +0000)
some memory also in the MG case and thereby resolve a TODO.

git-svn-id: https://svn.dealii.org/branches/branch_deprecated@27879 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_renumbering.cc

index 4b26224d4452bc1f616756dc3ed1098c01444398..439bfe6128a420494287c813912d1b1bcb4acb78 100644 (file)
@@ -456,21 +456,12 @@ namespace DoFRenumbering
     constraints.close ();
 
     SparsityPattern sparsity;
-    if (DH::dimension < 2)
-      {
-        sparsity.reinit (dof_handler.n_dofs(),
-                         dof_handler.n_dofs(),
-                         dof_handler.max_couplings_between_dofs());
-        DoFTools::make_sparsity_pattern (dof_handler, sparsity, constraints);
-        sparsity.compress();
-      }
-    else
-      {
-        CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(),
-                                             dof_handler.n_dofs());
-        DoFTools::make_sparsity_pattern (dof_handler, csp, constraints);
-        sparsity.copy_from (csp);
-      }
+    {
+      CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(),
+                                          dof_handler.n_dofs());
+      DoFTools::make_sparsity_pattern (dof_handler, csp, constraints);
+      sparsity.copy_from (csp);
+    }
 
     // constraints are not needed anymore
     constraints.clear ();
@@ -494,12 +485,13 @@ namespace DoFRenumbering
                       const bool                       reversed_numbering,
                       const std::vector<unsigned int> &starting_indices)
   {
-//TODO: we should be doing the same here as in the other compute_CMK function to preserve some memory
-
-    // make the connection graph
-    SparsityPattern sparsity (dof_handler.n_dofs(level),
-                              dof_handler.max_couplings_between_dofs());
-    MGTools::make_sparsity_pattern (dof_handler, sparsity, level);
+    SparsityPattern sparsity;
+    {
+      CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(level),
+                                          dof_handler.n_dofs(level));
+      MGDoFTools::make_sparsity_pattern (dof_handler, csp, level);
+      sparsity.copy_from (csp);
+    }
 
     std::vector<unsigned int> new_indices(sparsity.n_rows());
     SparsityTools::reorder_Cuthill_McKee (sparsity, new_indices,

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.