From: Wolfgang Bangerth Date: Sat, 15 Jan 2022 14:15:09 +0000 (-0700) Subject: Keep a sorted vector instead of a std::set. X-Git-Tag: v9.4.0-rc1~597^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36293029d5452e3c2c2e3279b6abb2a85edcabdd;p=dealii.git Keep a sorted vector instead of a std::set. --- 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,