From: Wolfgang Bangerth Date: Sun, 16 Jan 2022 18:31:13 +0000 (-0700) Subject: Use std::count_if(). X-Git-Tag: v9.4.0-rc1~590^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13073%2Fhead;p=dealii.git Use std::count_if(). --- diff --git a/source/distributed/repartitioning_policy_tools.cc b/source/distributed/repartitioning_policy_tools.cc index f22756fa8a..8462fda9b4 100644 --- a/source/distributed/repartitioning_policy_tools.cc +++ b/source/distributed/repartitioning_policy_tools.cc @@ -206,10 +206,11 @@ namespace RepartitioningPolicyTools // step 1) check if all processes have enough cells - const auto locally_owned_cells = - tria_in.active_cell_iterators() | IteratorFilters::LocallyOwnedCell(); const unsigned int n_locally_owned_active_cells = - std::distance(locally_owned_cells.begin(), locally_owned_cells.end()); + std::count_if(tria_in.begin_active(), + typename Triangulation::active_cell_iterator( + tria_in.end()), + [](const auto &cell) { return cell.is_locally_owned(); }); const auto comm = tria_in.get_communicator();