]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement condensing the sparsity pattern straight away
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 4 Jun 2007 10:04:57 +0000 (10:04 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 4 Jun 2007 10:04:57 +0000 (10:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@14751 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-27/step-27.cc

index 9193b533b818996ba63342d28dfc1ffb62aed853..4b571d2f6b5588a441b95faff4d0ef1187e7537c 100644 (file)
@@ -183,25 +183,37 @@ void LaplaceProblem<dim>::setup_system ()
       sparsity_pattern.reinit (dof_handler.n_dofs(),
                               dof_handler.n_dofs(),
                               dof_handler.max_couplings_between_dofs());
-      DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
-
       condense.reset();
-      condense.start();
-      hanging_node_constraints.condense (sparsity_pattern);
-      condense.stop();
+      if (condense_global)
+       {
+         DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
+         condense.start();
+         hanging_node_constraints.condense (sparsity_pattern);
+         condense.stop();
+       }
+      else
+       DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern,
+                                        hanging_node_constraints);
+
       sparsity_pattern.compress();      
     }
   else
     {
       CompressedSparsityPattern csp (dof_handler.n_dofs(),
                                     dof_handler.n_dofs());
-      DoFTools::make_sparsity_pattern (dof_handler, csp);
-
       condense.reset();
-      condense.start();
-      hanging_node_constraints.condense (csp);
-      condense.stop();
+      if (condense_global)
+       {
+         DoFTools::make_sparsity_pattern (dof_handler, csp);
 
+         condense.start();
+         hanging_node_constraints.condense (csp);
+         condense.stop();
+       }
+      else
+       DoFTools::make_sparsity_pattern (dof_handler, csp,
+                                        hanging_node_constraints);
+       
       sparsity_pattern.copy_from (csp);
     }
 
@@ -1285,6 +1297,7 @@ void LaplaceProblem<dim>::run ()
                << std::endl;
 
       Timer all;
+      all.reset();
       all.start();
       setup_system ();
 
@@ -1323,7 +1336,7 @@ int main ()
     {
       deallog.depth_console (0);
 
-      LaplaceProblem<3> laplace_problem (true);
+      LaplaceProblem<3> laplace_problem (false);
       laplace_problem.run ();
     }
   catch (std::exception &exc)

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.