From 36293029d5452e3c2c2e3279b6abb2a85edcabdd Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 15 Jan 2022 07:15:09 -0700 Subject: [PATCH] Keep a sorted vector instead of a std::set. --- include/deal.II/fe/fe_tools_extrapolate.templates.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 578045de14..787047db30 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -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 destinations; + std::vector 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(destinations.begin(), - destinations.end()); - }; + const auto get_destinations = [&destinations]() { return destinations; }; const auto create_request = [&cells_to_send](const types::subdomain_id other_rank, -- 2.39.5