]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let a function return its product, rather than use a reference argument.
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 18 Jul 2017 23:26:06 +0000 (17:26 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 18 Jul 2017 23:26:06 +0000 (17:26 -0600)
This is the same patch as the previous commit, except for the multilevel
version of the function: p::d::Triangulation::fill_level_vertices_with_ghost_neighbors().

include/deal.II/distributed/tria.h
source/distributed/tria.cc

index 893c5747e16fb778c75776a18be6c76274a2f1f8..8f98907d97d1f82060ecdfb97c83b69b5f3eb6e5 100644 (file)
@@ -866,15 +866,12 @@ namespace parallel
       compute_vertices_with_ghost_neighbors () const;
 
       /**
-       * Fills a map that, for each vertex, lists all the processors whose
+       * Return a map that, for each vertex, lists all the processors whose
        * subdomains are adjacent to that vertex on the given level for the
        * multigrid hierarchy. Used by DoFHandler::Policy::ParallelDistributed.
        */
-      void
-      fill_level_vertices_with_ghost_neighbors
-      (const int level,
-       std::map<unsigned int, std::set<dealii::types::subdomain_id> >
-       &vertices_with_ghost_neighbors);
+      std::map<unsigned int, std::set<dealii::types::subdomain_id> >
+      compute_level_vertices_with_ghost_neighbors (const int level) const;
 
       /**
        * This method returns a bit vector of length tria.n_vertices()
@@ -994,11 +991,8 @@ namespace parallel
        * Like above, this method, which is only implemented for dim = 2 or 3,
        * needs a stub because it is used in dof_handler_policy.cc
        */
-      void
-      fill_level_vertices_with_ghost_neighbors
-      (const unsigned int level,
-       std::map<unsigned int, std::set<dealii::types::subdomain_id> >
-       &vertices_with_ghost_neighbors);
+      std::map<unsigned int, std::set<dealii::types::subdomain_id> >
+      compute_level_vertices_with_ghost_neighbors (const unsigned int level) const;
 
       /**
        * Like above, this method, which is only implemented for dim = 2 or 3,
index a1488d4365b5ae6619b5ac32f78b2c4d18e0f06b..f113f8cc071391472977aa0aad77fdda28548b9b 100644 (file)
@@ -3410,13 +3410,13 @@ namespace parallel
      * on the given multigrid level
      */
     template <int dim, int spacedim>
-    void
+    std::map<unsigned int, std::set<dealii::types::subdomain_id> >
     Triangulation<dim,spacedim>::
-    fill_level_vertices_with_ghost_neighbors
-    (const int level,
-     std::map<unsigned int, std::set<dealii::types::subdomain_id> >
-     &vertices_with_ghost_neighbors)
+    compute_level_vertices_with_ghost_neighbors (const int level) const
     {
+      std::map<unsigned int, std::set<dealii::types::subdomain_id> >
+      vertices_with_ghost_neighbors;
+
       const std::vector<bool> locally_active_vertices =
         mark_locally_active_vertices_on_level(level);
       cell_iterator cell = this->begin(level),
@@ -3462,14 +3462,16 @@ namespace parallel
                 }
             }
         }
+
+      return vertices_with_ghost_neighbors;
     }
 
 
 
     template <int dim, int spacedim>
     std::vector<bool>
-    Triangulation<dim,spacedim>
-    ::mark_locally_active_vertices_on_level (const int level) const
+    Triangulation<dim,spacedim>::
+    mark_locally_active_vertices_on_level (const int level) const
     {
       Assert (dim>1, ExcNotImplemented());
 
@@ -3910,14 +3912,13 @@ namespace parallel
     }
 
     template <int spacedim>
-    void
+    std::map<unsigned int, std::set<dealii::types::subdomain_id> >
     Triangulation<1,spacedim>::
-    fill_level_vertices_with_ghost_neighbors
-    (const unsigned int /*level*/,
-     std::map<unsigned int, std::set<dealii::types::subdomain_id> >
-     &/*vertices_with_ghost_neighbors*/)
+    compute_level_vertices_with_ghost_neighbors (const unsigned int /*level*/) const
     {
       Assert (false, ExcNotImplemented());
+
+      return std::map<unsigned int, std::set<dealii::types::subdomain_id> >();
     }
 
     template <int spacedim>

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.