]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use std::count_if(). 13073/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 16 Jan 2022 18:31:13 +0000 (11:31 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 19 Jan 2022 03:27:40 +0000 (20:27 -0700)
source/distributed/repartitioning_policy_tools.cc

index f22756fa8ab5a3f796e0f2342b7926f15bfe74e4..8462fda9b4c9c4a07780556a78b44897adb8031d 100644 (file)
@@ -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();
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.