From eafe2dd2409e4e8134cef395e00c7d1ff8c4d2a9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 8 Jun 2023 16:36:10 -0600 Subject: [PATCH] Simplify code. --- .../deal.II/fe/fe_tools_extrapolate.templates.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 27e2813d70..9f51948a89 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -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 destinations; - destinations.reserve(cells_to_send.size()); + std::set 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>( - destinations, create_request, process_request, communicator); + std::vector(destinations.begin(), + destinations.end()), + create_request, + process_request, + communicator); } -- 2.39.5