From 143a1c16a956f27f910235a59e7e689023458df9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 16 Jan 2022 11:31:13 -0700 Subject: [PATCH] Use std::count_if(). --- source/distributed/repartitioning_policy_tools.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(); -- 2.39.5