]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use new compute_locally_owned_dofs_per_processor
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 3 Jun 2019 12:10:02 +0000 (14:10 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 7 Jun 2019 09:42:36 +0000 (11:42 +0200)
source/dofs/dof_renumbering.cc
source/multigrid/mg_transfer_internal.cc
source/multigrid/mg_transfer_prebuilt.cc

index 777250c0b1c08e5d179add7e38dee00317c093dd..8487699a8d5bebf7497b5acc19545587b46a5580 100644 (file)
@@ -1372,14 +1372,16 @@ namespace DoFRenumbering
           dynamic_cast<const parallel::Triangulation<dim, spacedim> *>(
             &dof_handler.get_triangulation()))
       {
-        const std::vector<types::global_dof_index>
-          &n_locally_owned_dofs_per_processor =
-            dof_handler.n_locally_owned_dofs_per_processor();
-        my_starting_index =
-          std::accumulate(n_locally_owned_dofs_per_processor.begin(),
-                          n_locally_owned_dofs_per_processor.begin() +
-                            tria->locally_owned_subdomain(),
-                          types::global_dof_index(0));
+#ifdef DEAL_II_WITH_MPI
+        types::global_dof_index local_size =
+          dof_handler.locally_owned_dofs().n_elements();
+        MPI_Exscan(&local_size,
+                   &my_starting_index,
+                   1,
+                   DEAL_II_DOF_INDEX_MPI_TYPE,
+                   MPI_SUM,
+                   tria->get_communicator());
+#endif
       }
 
     if (const parallel::distributed::Triangulation<dim, spacedim> *tria =
index 34fa8a6c08cdb9d6a230713020840b6e39d1b78c..71918c5e41c0e7ad823dc29a35d1b57a403ba0a4 100644 (file)
@@ -191,7 +191,7 @@ namespace internal
             locally_owned_mg_dofs_per_processor;
           for (unsigned int l = 0; l < tria->n_global_levels(); ++l)
             locally_owned_mg_dofs_per_processor.push_back(
-              mg_dof.locally_owned_mg_dofs_per_processor(l));
+              mg_dof.compute_locally_owned_mg_dofs_per_processor(l));
 
           const std::set<types::subdomain_id> &neighbors =
             tria->level_ghost_owners();
index 0217ff46d425c7815efac2a8c7703accfb6916dc..3649998289e2ed9a2ab0838961d7f2ea89288969 100644 (file)
@@ -284,7 +284,7 @@ MGTransferPrebuilt<VectorType>::build_matrices(
           // Compute # of locally owned MG dofs / processor for distribution
           const std::vector<::dealii::IndexSet>
             locally_owned_mg_dofs_per_processor =
-              mg_dof.locally_owned_mg_dofs_per_processor(level + 1);
+              mg_dof.compute_locally_owned_mg_dofs_per_processor(level + 1);
           std::vector<::dealii::types::global_dof_index>
             n_locally_owned_mg_dofs_per_processor(
               locally_owned_mg_dofs_per_processor.size(), 0);

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.