]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use std::all_of 14329/head
authorPeter Munch <peterrmuench@gmail.com>
Sun, 2 Oct 2022 10:39:04 +0000 (12:39 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 2 Oct 2022 10:39:04 +0000 (12:39 +0200)
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h

index 6fe22ecdcc6c619606284751db0aae9da9ab04f8..71444b4e54410e339ebcff2437315887790eb59a 100644 (file)
@@ -1779,26 +1779,22 @@ namespace internal
       transfer.n_components =
         dof_handler_fine.get_fe_collection().n_components();
 
-      // TODO: replace with std::all_of once FECellection supports range-based
-      // iterations
-      const auto all_of = [](const auto &fe_collection, const auto &fu) {
-        for (unsigned int i = 0; i < fe_collection.size(); ++i)
-          if (fu(fe_collection[i]) == false)
-            return false;
-
-        return true;
-      };
-
       transfer.fine_element_is_continuous =
-        all_of(dof_handler_fine.get_fe_collection(), [](const auto &fe) {
-          return fe.n_dofs_per_cell() == 0 || fe.n_dofs_per_vertex() > 0;
-        });
+        std::all_of(dof_handler_fine.get_fe_collection().begin(),
+                    dof_handler_fine.get_fe_collection().end(),
+                    [](const auto &fe) {
+                      return fe.n_dofs_per_cell() == 0 ||
+                             fe.n_dofs_per_vertex() > 0;
+                    });
 
 #if DEBUG
       const bool fine_element_is_discontinuous =
-        all_of(dof_handler_fine.get_fe_collection(), [](const auto &fe) {
-          return fe.n_dofs_per_cell() == 0 || fe.n_dofs_per_vertex() == 0;
-        });
+        std::all_of(dof_handler_fine.get_fe_collection().begin(),
+                    dof_handler_fine.get_fe_collection().end(),
+                    [](const auto &fe) {
+                      return fe.n_dofs_per_cell() == 0 ||
+                             fe.n_dofs_per_vertex() == 0;
+                    });
 
       Assert(transfer.fine_element_is_continuous !=
                fine_element_is_discontinuous,

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.