]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Keep a sorted vector instead of a std::set.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 15 Jan 2022 14:15:09 +0000 (07:15 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 15 Jan 2022 14:24:22 +0000 (07:24 -0700)
include/deal.II/fe/fe_tools_extrapolate.templates.h

index 578045de14aceaa9080e3f639b9fcc40bcba824b..787047db308963ccf444492a926b076272110594 100644 (file)
@@ -1182,19 +1182,19 @@ 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::set<types::subdomain_id> destinations;
+      std::vector<types::subdomain_id> destinations;
       for (const auto &cell : cells_to_send)
-        destinations.insert(cell.receiver);
+        destinations.emplace_back(cell.receiver);
+      std::sort(destinations.begin(), destinations.end());
+      destinations.erase(std::unique(destinations.begin(), destinations.end()),
+                         destinations.end());
 
       // Then set up the send/receive operation. This is best done through
       // the 'consensus algorithm' setup that is used for point-to-point
       // communication of information in cases where we do not know up
       // front which processes (and from how many processes) we have to
       // expect information from.
-      const auto get_destinations = [&destinations]() {
-        return std::vector<unsigned int>(destinations.begin(),
-                                         destinations.end());
-      };
+      const auto get_destinations = [&destinations]() { return destinations; };
 
       const auto create_request =
         [&cells_to_send](const types::subdomain_id other_rank,

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.