]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Improved sparsity pattern generation.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Jun 2013 14:19:15 +0000 (14:19 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Jun 2013 14:19:15 +0000 (14:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@29816 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/dofs/dof_renumbering.cc

index 979cd02e91a8b21c01667888da3c71bc2b0bfe34..0d0410bdb60eb9c6a24922d7f9d84001dfc8d084 100644 (file)
@@ -437,12 +437,24 @@ namespace DoFRenumbering
   {
     Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcNotInitialized());
-//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;
+    if (DH::dimension < 2)
+      {
+        sparsity.reinit (dof_handler.n_dofs(),
+                         dof_handler.n_dofs(),
+                         dof_handler.max_couplings_between_dofs());
+        MGTools::make_sparsity_pattern (dof_handler, sparsity, level);
+        sparsity.compress();
+      }
+    else
+      {
+        CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(level),
+                                             dof_handler.n_dofs(level));
+        MGTools::make_sparsity_pattern (dof_handler, csp, level);
+        sparsity.copy_from (csp);
+      }
 
     std::vector<types::global_dof_index> 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.