]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify code.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 8 Jun 2023 22:36:10 +0000 (16:36 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 10 Jun 2023 03:30:11 +0000 (21:30 -0600)
include/deal.II/fe/fe_tools_extrapolate.templates.h

index 27e2813d7007dd7200b4f6829d3e5be29f0adef2..9f51948a89912e2a92fb362565145df7e5ff886e 100644 (file)
@@ -1127,13 +1127,9 @@ namespace FETools
       // in the input argument to this function might be destined for
       // the same process, so we have to only look at the unique set of
       // destinations:
-      std::vector<types::subdomain_id> destinations;
-      destinations.reserve(cells_to_send.size());
+      std::set<types::subdomain_id> destinations;
       for (const auto &cell : cells_to_send)
-        destinations.emplace_back(cell.receiver);
-      std::sort(destinations.begin(), destinations.end());
-      destinations.erase(std::unique(destinations.begin(), destinations.end()),
-                         destinations.end());
+        destinations.insert(cell.receiver);
 
       // Then set up the send/receive operation. This is best done through
       // the 'consensus algorithm' setup that is used for point-to-point
@@ -1167,7 +1163,11 @@ namespace FETools
         };
 
       Utilities::MPI::ConsensusAlgorithms::selector<std::vector<CellData>>(
-        destinations, create_request, process_request, communicator);
+        std::vector<types::subdomain_id>(destinations.begin(),
+                                         destinations.end()),
+        create_request,
+        process_request,
+        communicator);
     }
 
 

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.