]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use CA specializations in places where we don't expect an answer. 13826/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 25 May 2022 22:58:04 +0000 (16:58 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 26 May 2022 19:13:47 +0000 (13:13 -0600)
include/deal.II/fe/fe_tools_extrapolate.templates.h
source/grid/tria_description.cc

index 3688b3a6941dde996fdce61363da82b50fdc5587..ed3a1b9c964f7046ca377dacddcc5a9a388b385c 100644 (file)
@@ -1150,40 +1150,23 @@ namespace FETools
         return cells_for_this_destination;
       };
 
-      const auto answer_request =
+      const auto process_request =
         [&received_cells](const unsigned int           other_rank,
-                          const std::vector<CellData> &request) -> int {
-        // We got a message from 'other_rank', so let us decode the
-        // message in the same way as we have assembled it above.
-        // Note that the cells just received do not contain
-        // information where they came from, and we have to add that
-        // ourselves for later use.
-        for (CellData cell_data : request)
-          {
-            cell_data.receiver = other_rank;
-            received_cells.emplace_back(std::move(cell_data));
-          }
-
-        // Nothing left to do here, we don't actually need to provide an
-        // answer:
-        return 0;
-      };
-
-      const auto read_answer = [](const unsigned int /*other_rank*/,
-                                  const int &answer) {
-        // We don't put anything into the answers, so nothing should
-        // have been coming out at this end either that differs from
-        // the default-sent zero integer:
-        (void)answer;
-        Assert(answer == 0, ExcInternalError());
-      };
+                          const std::vector<CellData> &request) {
+          // We got a message from 'other_rank', so let us decode the
+          // message in the same way as we have assembled it above.
+          // Note that the cells just received do not contain
+          // information where they came from, and we have to add that
+          // ourselves for later use.
+          for (CellData cell_data : request)
+            {
+              cell_data.receiver = other_rank;
+              received_cells.emplace_back(std::move(cell_data));
+            }
+        };
 
-      Utilities::MPI::ConsensusAlgorithms::selector<std::vector<CellData>, int>(
-        destinations,
-        create_request,
-        answer_request,
-        read_answer,
-        communicator);
+      Utilities::MPI::ConsensusAlgorithms::selector<std::vector<CellData>>(
+        destinations, create_request, process_request, communicator);
     }
 
 
index bdeaec046bc0322b03fc70816d71448162b6d562..2d3d6334f6b0bd38c1b457814522d01574dbb7aa 100644 (file)
@@ -126,16 +126,17 @@ namespace TriangulationDescription
             return description_temp[other_rank_index];
           };
 
-          const auto answer_request =
+          const auto process_request =
             [&](const unsigned int,
                 const DescriptionTemp<dim, spacedim> &request) {
               this->merge(request, vertices_have_unique_ids);
-              return char{};
             };
 
           dealii::Utilities::MPI::ConsensusAlgorithms::selector<
-            DescriptionTemp<dim, spacedim>,
-            char>(relevant_processes, create_request, answer_request, {}, comm);
+            DescriptionTemp<dim, spacedim>>(relevant_processes,
+                                            create_request,
+                                            process_request,
+                                            comm);
         }
 
         /**

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.