From: Wolfgang Bangerth Date: Thu, 8 Jun 2023 22:36:10 +0000 (-0600) Subject: Simplify code. X-Git-Tag: v9.5.0-rc1~130^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eafe2dd2409e4e8134cef395e00c7d1ff8c4d2a9;p=dealii.git Simplify code. --- 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); }