]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do not build DoF distribution maps that are distributed evenly across all processors...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 18 Oct 2008 04:11:11 +0000 (04:11 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 18 Oct 2008 04:11:11 +0000 (04:11 +0000)
git-svn-id: https://svn.dealii.org/trunk@17275 0785d39b-7218-0410-832d-ea1e28bc413d

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

index d1b125f44ecbd6e3e14c2b6d17afa5fde511c119..60ecac683372331c7f80632c7a54fb88d50d5bdc 100644 (file)
@@ -620,9 +620,20 @@ void BoussinesqFlowProblem<dim>::setup_dofs ()
 
   stokes_partitioner.clear();
   {
-    Epetra_Map map_u(n_u, 0, trilinos_communicator);
+    std::vector<unsigned int> local_dofs (dim+1);
+    DoFTools::
+      count_dofs_with_subdomain_association (stokes_dof_handler,
+                                            trilinos_communicator.MyPID(),
+                                            local_dofs);
+    unsigned int n_local_velocities = 0;
+    for (unsigned int c=0; c<dim; ++c)
+      n_local_velocities += local_dofs[c];
+
+    const unsigned int n_local_pressures = local_dofs[dim];
+
+    Epetra_Map map_u(n_u, n_local_velocities, 0, trilinos_communicator);
     stokes_partitioner.push_back (map_u);
-    Epetra_Map map_p(n_p, 0, trilinos_communicator);
+    Epetra_Map map_p(n_p, n_local_pressures, 0, trilinos_communicator);
     stokes_partitioner.push_back (map_p);
   }
   {
@@ -690,7 +701,13 @@ void BoussinesqFlowProblem<dim>::setup_dofs ()
 
   }
 
-  temperature_partitioner = Epetra_Map (n_T, 0, trilinos_communicator);
+  temperature_partitioner
+    = Epetra_Map (n_T,
+                 DoFTools::count_dofs_with_subdomain_association
+                 (temperature_dof_handler,
+                  trilinos_communicator.MyPID()),
+                 0,
+                 trilinos_communicator);
   {
     temperature_mass_matrix.clear ();
     temperature_stiffness_matrix.clear ();

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.