Skip to content

Commit

Permalink
Use std::count_if().
Browse files Browse the repository at this point in the history
  • Loading branch information
bangerth committed Jan 18, 2022
1 parent ca4baff commit d41403a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/distributed/repartitioning_policy_tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<dim, spacedim>::active_cell_iterator(
tria_in.end()),
[](const auto &cell) { return cell->is_locally_owned(); });

const auto comm = tria_in.get_communicator();

Expand Down

0 comments on commit d41403a

Please sign in to comment.