From: Wolfgang Bangerth Date: Tue, 18 Jul 2017 23:26:06 +0000 (-0600) Subject: Let a function return its product, rather than use a reference argument. X-Git-Tag: v9.0.0-rc1~1407^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac137adb399b4b696514dddfa8d8913b6a33b7ca;p=dealii.git Let a function return its product, rather than use a reference argument. 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(). --- diff --git a/include/deal.II/distributed/tria.h b/include/deal.II/distributed/tria.h index 893c5747e1..8f98907d97 100644 --- a/include/deal.II/distributed/tria.h +++ b/include/deal.II/distributed/tria.h @@ -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 > - &vertices_with_ghost_neighbors); + std::map > + 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 > - &vertices_with_ghost_neighbors); + std::map > + compute_level_vertices_with_ghost_neighbors (const unsigned int level) const; /** * Like above, this method, which is only implemented for dim = 2 or 3, diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index a1488d4365..f113f8cc07 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -3410,13 +3410,13 @@ namespace parallel * on the given multigrid level */ template - void + std::map > Triangulation:: - fill_level_vertices_with_ghost_neighbors - (const int level, - std::map > - &vertices_with_ghost_neighbors) + compute_level_vertices_with_ghost_neighbors (const int level) const { + std::map > + vertices_with_ghost_neighbors; + const std::vector 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 std::vector - Triangulation - ::mark_locally_active_vertices_on_level (const int level) const + Triangulation:: + mark_locally_active_vertices_on_level (const int level) const { Assert (dim>1, ExcNotImplemented()); @@ -3910,14 +3912,13 @@ namespace parallel } template - void + std::map > Triangulation<1,spacedim>:: - fill_level_vertices_with_ghost_neighbors - (const unsigned int /*level*/, - std::map > - &/*vertices_with_ghost_neighbors*/) + compute_level_vertices_with_ghost_neighbors (const unsigned int /*level*/) const { Assert (false, ExcNotImplemented()); + + return std::map >(); } template