]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove DoFHandlerType from dofs/dof_renumbering 10587/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 23 Jun 2020 21:23:50 +0000 (23:23 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Wed, 24 Jun 2020 13:01:07 +0000 (15:01 +0200)
include/deal.II/dofs/dof_renumbering.h
source/dofs/dof_renumbering.cc
source/dofs/dof_renumbering.inst.in

index a6c1d0bb55a2481b418c6da957660237e505f114..0ee1e4fb8c8c3f967d67f4e0169269df31af9155 100644 (file)
@@ -436,21 +436,21 @@ namespace DoFRenumbering
      * comparison of various algorithms in the documentation of the
      * DoFRenumbering namespace.
      */
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
-    Cuthill_McKee(DoFHandlerType &dof_handler,
-                  const bool      reversed_numbering = false,
-                  const bool      use_constraints    = false);
+    Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+                  const bool                 reversed_numbering = false,
+                  const bool                 use_constraints    = false);
 
     /**
      * Compute the renumbering vector needed by the Cuthill_McKee() function.
      * Does not perform the renumbering on the DoFHandler dofs but returns the
      * renumbering vector.
      */
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
     compute_Cuthill_McKee(std::vector<types::global_dof_index> &new_dof_indices,
-                          const DoFHandlerType &,
+                          const DoFHandler<dim, spacedim> &,
                           const bool reversed_numbering = false,
                           const bool use_constraints    = false);
 
@@ -466,20 +466,20 @@ namespace DoFRenumbering
      *
      * This algorithm is used in step-22.
      */
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
-    king_ordering(DoFHandlerType &dof_handler,
-                  const bool      reversed_numbering = false,
-                  const bool      use_constraints    = false);
+    king_ordering(DoFHandler<dim, spacedim> &dof_handler,
+                  const bool                 reversed_numbering = false,
+                  const bool                 use_constraints    = false);
 
     /**
      * Compute the renumbering for the King algorithm but do not actually
      * renumber the degrees of freedom in the DoF handler argument.
      */
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
     compute_king_ordering(std::vector<types::global_dof_index> &new_dof_indices,
-                          const DoFHandlerType &,
+                          const DoFHandler<dim, spacedim> &,
                           const bool reversed_numbering = false,
                           const bool use_constraints    = false);
 
@@ -494,21 +494,21 @@ namespace DoFRenumbering
      * comparison of various algorithms in the documentation of the
      * DoFRenumbering namespace.
      */
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
-    minimum_degree(DoFHandlerType &dof_handler,
-                   const bool      reversed_numbering = false,
-                   const bool      use_constraints    = false);
+    minimum_degree(DoFHandler<dim, spacedim> &dof_handler,
+                   const bool                 reversed_numbering = false,
+                   const bool                 use_constraints    = false);
 
     /**
      * Compute the renumbering for the minimum degree algorithm but do not
      * actually renumber the degrees of freedom in the DoF handler argument.
      */
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
     compute_minimum_degree(
       std::vector<types::global_dof_index> &new_dof_indices,
-      const DoFHandlerType &,
+      const DoFHandler<dim, spacedim> &,
       const bool reversed_numbering = false,
       const bool use_constraints    = false);
   } // namespace boost
@@ -577,11 +577,11 @@ namespace DoFRenumbering
    * starting indices even though it can only renumber them on a given
    * processor if they are also locally owned.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  Cuthill_McKee(DoFHandlerType &dof_handler,
-                const bool      reversed_numbering = false,
-                const bool      use_constraints    = false,
+  Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+                const bool                 reversed_numbering = false,
+                const bool                 use_constraints    = false,
                 const std::vector<types::global_dof_index> &starting_indices =
                   std::vector<types::global_dof_index>());
 
@@ -592,11 +592,11 @@ namespace DoFRenumbering
    *
    * See the Cuthill_McKee() function for an explanation of the arguments.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_Cuthill_McKee(
     std::vector<types::global_dof_index> &new_dof_indices,
-    const DoFHandlerType &,
+    const DoFHandler<dim, spacedim> &,
     const bool                                  reversed_numbering = false,
     const bool                                  use_constraints    = false,
     const std::vector<types::global_dof_index> &starting_indices =
@@ -615,11 +615,11 @@ namespace DoFRenumbering
    * See the general documentation of this class for details on the different
    * methods.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  Cuthill_McKee(DoFHandlerType &   dof_handler,
-                const unsigned int level,
-                const bool         reversed_numbering = false,
+  Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+                const unsigned int         level,
+                const bool                 reversed_numbering = false,
                 const std::vector<types::global_dof_index> &starting_indices =
                   std::vector<types::global_dof_index>());
 
@@ -654,9 +654,9 @@ namespace DoFRenumbering
    * For finite elements with only one component, or a single non-primitive
    * base element, this function is the identity operation.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  component_wise(DoFHandlerType &                 dof_handler,
+  component_wise(DoFHandler<dim, spacedim> &      dof_handler,
                  const std::vector<unsigned int> &target_component =
                    std::vector<unsigned int>());
 
@@ -667,9 +667,9 @@ namespace DoFRenumbering
    * multilevel discretization. The non-multigrid part of the DoFHandler
    * is not touched.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  component_wise(DoFHandlerType &                 dof_handler,
+  component_wise(DoFHandler<dim, spacedim> &      dof_handler,
                  const unsigned int               level,
                  const std::vector<unsigned int> &target_component =
                    std::vector<unsigned int>());
@@ -715,9 +715,9 @@ namespace DoFRenumbering
    * number of blocks and that subsequent blocks in one element have the same
    * meaning as in another element.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  block_wise(DoFHandlerType &dof_handler);
+  block_wise(DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Sort the degrees of freedom by vector block. It does the same thing as
@@ -725,9 +725,9 @@ namespace DoFRenumbering
    * multilevel discretization. The non-multigrid part of the DoFHandler
    * is not touched.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  block_wise(DoFHandlerType &dof_handler, const unsigned int level);
+  block_wise(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level);
 
   /**
    * Compute the renumbering vector needed by the block_wise() functions.
@@ -822,9 +822,9 @@ namespace DoFRenumbering
    * have been produced by a previous call to a renumbering function is
    * ignored.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  hierarchical(DoFHandlerType &dof_handler);
+  hierarchical(DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Renumber degrees of freedom by cell. The function takes a vector of cell
@@ -850,11 +850,12 @@ namespace DoFRenumbering
    * iterator of that triangulation needs to be present in @p cell_order exactly
    * once.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  cell_wise(DoFHandlerType &dof_handler,
-            const std::vector<typename DoFHandlerType::active_cell_iterator>
-              &cell_order);
+  cell_wise(
+    DoFHandler<dim, spacedim> &dof_handler,
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+      &cell_order);
 
   /**
    * Compute a renumbering of degrees of freedom by cell. The function takes a
@@ -891,38 +892,39 @@ namespace DoFRenumbering
    * <code>renumbering[inverse_renumbering[i]] ==
    * dof_handler.locally_owned_dofs().nth_index_in_set(i)</code> will hold.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_cell_wise(
     std::vector<types::global_dof_index> &renumbering,
     std::vector<types::global_dof_index> &inverse_renumbering,
-    const DoFHandlerType &                dof_handler,
-    const std::vector<typename DoFHandlerType::active_cell_iterator>
+    const DoFHandler<dim, spacedim> &     dof_handler,
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
       &cell_order);
 
   /**
    * Like the other cell_wise() function, but for one level of a multilevel
    * enumeration of degrees of freedom.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  cell_wise(DoFHandlerType &   dof_handler,
-            const unsigned int level,
-            const std::vector<typename DoFHandlerType::level_cell_iterator>
-              &cell_order);
+  cell_wise(
+    DoFHandler<dim, spacedim> &dof_handler,
+    const unsigned int         level,
+    const std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
+      &cell_order);
 
   /**
    * Like the other compute_cell_wise() function, but for one level of a
    * multilevel enumeration of degrees of freedom.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_cell_wise(
     std::vector<types::global_dof_index> &renumbering,
     std::vector<types::global_dof_index> &inverse_renumbering,
-    const DoFHandlerType &                dof_handler,
+    const DoFHandler<dim, spacedim> &     dof_handler,
     const unsigned int                    level,
-    const std::vector<typename DoFHandlerType::level_cell_iterator>
+    const std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
       &cell_order);
 
   /**
@@ -960,11 +962,11 @@ namespace DoFRenumbering
    * downstream location (e.g. those parallel to the flow direction, or
    * several dofs within a FESystem) will be unaffected.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  downstream(DoFHandlerType &                                  dof_handler,
-             const Tensor<1, DoFHandlerType::space_dimension> &direction,
-             const bool dof_wise_renumbering = false);
+  downstream(DoFHandler<dim, spacedim> &dof_handler,
+             const Tensor<1, spacedim> &direction,
+             const bool                 dof_wise_renumbering = false);
 
 
   /**
@@ -972,41 +974,39 @@ namespace DoFRenumbering
    * on one level of a multigrid hierarchy. See the other function with the same
    * name.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  downstream(DoFHandlerType &                                  dof_handler,
-             const unsigned int                                level,
-             const Tensor<1, DoFHandlerType::space_dimension> &direction,
-             const bool dof_wise_renumbering = false);
+  downstream(DoFHandler<dim, spacedim> &dof_handler,
+             const unsigned int         level,
+             const Tensor<1, spacedim> &direction,
+             const bool                 dof_wise_renumbering = false);
 
   /**
    * Compute the set of renumbering indices needed by the downstream() function.
    * Does not perform the renumbering on the DoFHandler dofs but returns the
    * renumbering vector.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  compute_downstream(
-    std::vector<types::global_dof_index> &            new_dof_indices,
-    std::vector<types::global_dof_index> &            reverse,
-    const DoFHandlerType &                            dof_handler,
-    const Tensor<1, DoFHandlerType::space_dimension> &direction,
-    const bool                                        dof_wise_renumbering);
+  compute_downstream(std::vector<types::global_dof_index> &new_dof_indices,
+                     std::vector<types::global_dof_index> &reverse,
+                     const DoFHandler<dim, spacedim> &     dof_handler,
+                     const Tensor<1, spacedim> &           direction,
+                     const bool dof_wise_renumbering);
 
   /**
    * Compute the set of renumbering indices needed by the downstream() function.
    * Does not perform the renumbering on the DoFHandler dofs but returns the
    * renumbering vector.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  compute_downstream(
-    std::vector<types::global_dof_index> &            new_dof_indices,
-    std::vector<types::global_dof_index> &            reverse,
-    const DoFHandlerType &                            dof_handler,
-    const unsigned int                                level,
-    const Tensor<1, DoFHandlerType::space_dimension> &direction,
-    const bool                                        dof_wise_renumbering);
+  compute_downstream(std::vector<types::global_dof_index> &new_dof_indices,
+                     std::vector<types::global_dof_index> &reverse,
+                     const DoFHandler<dim, spacedim> &     dof_handler,
+                     const unsigned int                    level,
+                     const Tensor<1, spacedim> &           direction,
+                     const bool dof_wise_renumbering);
 
   /**
    * Cell-wise clockwise numbering.
@@ -1016,34 +1016,34 @@ namespace DoFRenumbering
    * only works with Discontinuous Galerkin Finite Elements, i.e. all degrees
    * of freedom have to be associated with the interior of the cell.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  clockwise_dg(DoFHandlerType &                              dof_handler,
-               const Point<DoFHandlerType::space_dimension> &center,
-               const bool                                    counter = false);
+  clockwise_dg(DoFHandler<dim, spacedim> &dof_handler,
+               const Point<spacedim> &    center,
+               const bool                 counter = false);
 
   /**
    * Cell-wise clockwise numbering on one level of a multigrid
    * hierarchy. See the other function with the same name.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  clockwise_dg(DoFHandlerType &                              dof_handler,
-               const unsigned int                            level,
-               const Point<DoFHandlerType::space_dimension> &center,
-               const bool                                    counter = false);
+  clockwise_dg(DoFHandler<dim, spacedim> &dof_handler,
+               const unsigned int         level,
+               const Point<spacedim> &    center,
+               const bool                 counter = false);
 
   /**
    * Compute the renumbering vector needed by the clockwise_dg() functions.
    * Does not perform the renumbering on the DoFHandler dofs but returns the
    * renumbering vector.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_clockwise_dg(std::vector<types::global_dof_index> &new_dof_indices,
-                       const DoFHandlerType &                dof_handler,
-                       const Point<DoFHandlerType::space_dimension> &center,
-                       const bool                                    counter);
+                       const DoFHandler<dim, spacedim> &     dof_handler,
+                       const Point<spacedim> &               center,
+                       const bool                            counter);
 
   /**
    * @}
@@ -1063,10 +1063,10 @@ namespace DoFRenumbering
    * @pre The @p selected_dofs array must have as many elements as the @p
    * dof_handler has degrees of freedom.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  sort_selected_dofs_back(DoFHandlerType &         dof_handler,
-                          const std::vector<bool> &selected_dofs);
+  sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+                          const std::vector<bool> &  selected_dofs);
 
   /**
    * Sort those degrees of freedom which are tagged with @p true in the @p
@@ -1078,11 +1078,11 @@ namespace DoFRenumbering
    * @pre The @p selected_dofs array must have as many elements as the @p
    * dof_handler has degrees of freedom on the given level.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  sort_selected_dofs_back(DoFHandlerType &         dof_handler,
-                          const std::vector<bool> &selected_dofs,
-                          const unsigned int       level);
+  sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+                          const std::vector<bool> &  selected_dofs,
+                          const unsigned int         level);
 
   /**
    * Compute the renumbering vector needed by the sort_selected_dofs_back()
@@ -1092,11 +1092,11 @@ namespace DoFRenumbering
    * @pre The @p selected_dofs array must have as many elements as the @p
    * dof_handler has degrees of freedom.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_sort_selected_dofs_back(
     std::vector<types::global_dof_index> &new_dof_indices,
-    const DoFHandlerType &                dof_handler,
+    const DoFHandler<dim, spacedim> &     dof_handler,
     const std::vector<bool> &             selected_dofs);
 
   /**
@@ -1108,11 +1108,11 @@ namespace DoFRenumbering
    * @pre The @p selected_dofs array must have as many elements as the @p
    * dof_handler has degrees of freedom on the given level.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_sort_selected_dofs_back(
     std::vector<types::global_dof_index> &new_dof_indices,
-    const DoFHandlerType &                dof_handler,
+    const DoFHandler<dim, spacedim> &     dof_handler,
     const std::vector<bool> &             selected_dofs,
     const unsigned int                    level);
 
@@ -1126,9 +1126,9 @@ namespace DoFRenumbering
    * before this function (or, for that matter, whether other threads running
    * concurrently to this function also draw random numbers).
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  random(DoFHandlerType &dof_handler);
+  random(DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Renumber the degrees of freedom in a random way. It does the same thing as
@@ -1136,9 +1136,9 @@ namespace DoFRenumbering
    * multilevel discretization. The non-multigrid part of the DoFHandler
    * is not touched.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  random(DoFHandlerType &dof_handler, const unsigned int level);
+  random(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level);
 
   /**
    * Compute the renumbering vector needed by the random() function. See
@@ -1147,20 +1147,20 @@ namespace DoFRenumbering
    * This function does not perform the renumbering on the DoFHandler dofs but
    * returns the renumbering vector.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_random(std::vector<types::global_dof_index> &new_dof_indices,
-                 const DoFHandlerType &                dof_handler);
+                 const DoFHandler<dim, spacedim> &     dof_handler);
 
   /**
    * Compute the renumbering vector needed by the random() function. Same
    * as the above function but for a single level of a multilevel
    * discretization.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_random(std::vector<types::global_dof_index> &new_dof_indices,
-                 const DoFHandlerType &                dof_handler,
+                 const DoFHandler<dim, spacedim> &     dof_handler,
                  const unsigned int                    level);
 
   /**
@@ -1194,19 +1194,19 @@ namespace DoFRenumbering
    * belong to the same subdomain, then they will be in this order also after
    * reordering.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  subdomain_wise(DoFHandlerType &dof_handler);
+  subdomain_wise(DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Compute the renumbering vector needed by the subdomain_wise() function.
    * Does not perform the renumbering on the @p DoFHandler dofs but returns
    * the renumbering vector.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_subdomain_wise(std::vector<types::global_dof_index> &new_dof_indices,
-                         const DoFHandlerType &                dof_handler);
+                         const DoFHandler<dim, spacedim> &     dof_handler);
 
   /**
    * @}
index 7577eca222fdfcbaf4d39a3984169d5544ac29ac..80932f51f461356d51cff8af8917e66cfaaaa1cc 100644 (file)
@@ -88,11 +88,11 @@ namespace DoFRenumbering
 
     namespace internal
     {
-      template <typename DoFHandlerType>
+      template <int dim, int spacedim>
       void
-      create_graph(const DoFHandlerType &dof_handler,
-                   const bool            use_constraints,
-                   boosttypes::Graph &   graph,
+      create_graph(const DoFHandler<dim, spacedim> &dof_handler,
+                   const bool                       use_constraints,
+                   boosttypes::Graph &              graph,
                    boosttypes::property_map<boosttypes::Graph,
                                             boosttypes::vertex_degree_t>::type
                      &graph_degree)
@@ -123,11 +123,11 @@ namespace DoFRenumbering
     } // namespace internal
 
 
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
-    Cuthill_McKee(DoFHandlerType &dof_handler,
-                  const bool      reversed_numbering,
-                  const bool      use_constraints)
+    Cuthill_McKee(DoFHandler<dim, spacedim> &dof_handler,
+                  const bool                 reversed_numbering,
+                  const bool                 use_constraints)
     {
       std::vector<types::global_dof_index> renumbering(
         dof_handler.n_dofs(), numbers::invalid_dof_index);
@@ -143,10 +143,10 @@ namespace DoFRenumbering
     }
 
 
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
     compute_Cuthill_McKee(std::vector<types::global_dof_index> &new_dof_indices,
-                          const DoFHandlerType &                dof_handler,
+                          const DoFHandler<dim, spacedim> &     dof_handler,
                           const bool reversed_numbering,
                           const bool use_constraints)
     {
@@ -185,11 +185,11 @@ namespace DoFRenumbering
 
 
 
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
-    king_ordering(DoFHandlerType &dof_handler,
-                  const bool      reversed_numbering,
-                  const bool      use_constraints)
+    king_ordering(DoFHandler<dim, spacedim> &dof_handler,
+                  const bool                 reversed_numbering,
+                  const bool                 use_constraints)
     {
       std::vector<types::global_dof_index> renumbering(
         dof_handler.n_dofs(), numbers::invalid_dof_index);
@@ -205,10 +205,10 @@ namespace DoFRenumbering
     }
 
 
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
     compute_king_ordering(std::vector<types::global_dof_index> &new_dof_indices,
-                          const DoFHandlerType &                dof_handler,
+                          const DoFHandler<dim, spacedim> &     dof_handler,
                           const bool reversed_numbering,
                           const bool use_constraints)
     {
@@ -241,11 +241,11 @@ namespace DoFRenumbering
 
 
 
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
-    minimum_degree(DoFHandlerType &dof_handler,
-                   const bool      reversed_numbering,
-                   const bool      use_constraints)
+    minimum_degree(DoFHandler<dim, spacedim> &dof_handler,
+                   const bool                 reversed_numbering,
+                   const bool                 use_constraints)
     {
       std::vector<types::global_dof_index> renumbering(
         dof_handler.n_dofs(), numbers::invalid_dof_index);
@@ -261,11 +261,11 @@ namespace DoFRenumbering
     }
 
 
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
     compute_minimum_degree(
       std::vector<types::global_dof_index> &new_dof_indices,
-      const DoFHandlerType &                dof_handler,
+      const DoFHandler<dim, spacedim> &     dof_handler,
       const bool                            reversed_numbering,
       const bool                            use_constraints)
     {
@@ -291,11 +291,7 @@ namespace DoFRenumbering
 
       std::vector<dealii::types::global_dof_index> dofs_on_this_cell;
 
-      typename DoFHandlerType::active_cell_iterator cell = dof_handler
-                                                             .begin_active(),
-                                                    endc = dof_handler.end();
-
-      for (; cell != endc; ++cell)
+      for (const auto &cell : dof_handler.active_cell_iterators())
         {
           const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
 
@@ -364,9 +360,9 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  Cuthill_McKee(DoFHandlerType &                            dof_handler,
+  Cuthill_McKee(DoFHandler<dim, spacedim> &                 dof_handler,
                 const bool                                  reversed_numbering,
                 const bool                                  use_constraints,
                 const std::vector<types::global_dof_index> &starting_indices)
@@ -388,11 +384,11 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_Cuthill_McKee(
     std::vector<types::global_dof_index> &      new_indices,
-    const DoFHandlerType &                      dof_handler,
+    const DoFHandler<dim, spacedim> &           dof_handler,
     const bool                                  reversed_numbering,
     const bool                                  use_constraints,
     const std::vector<types::global_dof_index> &starting_indices)
@@ -599,9 +595,9 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  Cuthill_McKee(DoFHandlerType &                            dof_handler,
+  Cuthill_McKee(DoFHandler<dim, spacedim> &                 dof_handler,
                 const unsigned int                          level,
                 const bool                                  reversed_numbering,
                 const std::vector<types::global_dof_index> &starting_indices)
@@ -628,22 +624,20 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  component_wise(DoFHandlerType &                 dof_handler,
+  component_wise(DoFHandler<dim, spacedim> &      dof_handler,
                  const std::vector<unsigned int> &component_order_arg)
   {
     std::vector<types::global_dof_index> renumbering(
       dof_handler.n_locally_owned_dofs(), numbers::invalid_dof_index);
 
-    typename DoFHandlerType::active_cell_iterator start =
-      dof_handler.begin_active();
-    const typename DoFHandlerType::level_cell_iterator end = dof_handler.end();
-
     const types::global_dof_index result =
-      compute_component_wise<DoFHandlerType::dimension,
-                             DoFHandlerType::space_dimension>(
-        renumbering, start, end, component_order_arg, false);
+      compute_component_wise<dim, spacedim>(renumbering,
+                                            dof_handler.begin_active(),
+                                            dof_handler.end(),
+                                            component_order_arg,
+                                            false);
     if (result == 0)
       return;
 
@@ -664,9 +658,9 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  component_wise(DoFHandlerType &                 dof_handler,
+  component_wise(DoFHandler<dim, spacedim> &      dof_handler,
                  const unsigned int               level,
                  const std::vector<unsigned int> &component_order_arg)
   {
@@ -677,13 +671,13 @@ namespace DoFRenumbering
       dof_handler.locally_owned_mg_dofs(level).n_elements(),
       numbers::invalid_dof_index);
 
-    typename DoFHandlerType::level_cell_iterator start =
+    typename DoFHandler<dim, spacedim>::level_cell_iterator start =
       dof_handler.begin(level);
-    typename DoFHandlerType::level_cell_iterator end = dof_handler.end(level);
+    typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+      dof_handler.end(level);
 
     const types::global_dof_index result =
-      compute_component_wise<DoFHandlerType::dimension,
-                             DoFHandlerType::space_dimension>(
+      compute_component_wise<dim, spacedim>(
         renumbering, start, end, component_order_arg, true);
 
     if (result == 0)
@@ -946,23 +940,19 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  block_wise(DoFHandlerType &dof_handler)
+  block_wise(DoFHandler<dim, spacedim> &dof_handler)
   {
     std::vector<types::global_dof_index> renumbering(
       dof_handler.n_locally_owned_dofs(), numbers::invalid_dof_index);
 
-    typename DoFHandlerType::active_cell_iterator start =
-      dof_handler.begin_active();
-    const typename DoFHandlerType::level_cell_iterator end = dof_handler.end();
-
-    const types::global_dof_index result =
-      compute_block_wise<DoFHandlerType::dimension,
-                         DoFHandlerType::space_dimension,
-                         typename DoFHandlerType::active_cell_iterator,
-                         typename DoFHandlerType::level_cell_iterator>(
-        renumbering, start, end, false);
+    const types::global_dof_index result = compute_block_wise<
+      dim,
+      spacedim,
+      typename DoFHandler<dim, spacedim>::active_cell_iterator,
+      typename DoFHandler<dim, spacedim>::level_cell_iterator>(
+      renumbering, dof_handler.begin_active(), dof_handler.end(), false);
     if (result == 0)
       return;
 
@@ -983,9 +973,9 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  block_wise(DoFHandlerType &dof_handler, const unsigned int level)
+  block_wise(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level)
   {
     Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcDoFHandlerNotInitialized());
@@ -994,16 +984,19 @@ namespace DoFRenumbering
       dof_handler.locally_owned_mg_dofs(level).n_elements(),
       numbers::invalid_dof_index);
 
-    typename DoFHandlerType::level_cell_iterator start =
+    typename DoFHandler<dim, spacedim>::level_cell_iterator start =
       dof_handler.begin(level);
-    typename DoFHandlerType::level_cell_iterator end = dof_handler.end(level);
-
-    const types::global_dof_index result =
-      compute_block_wise<DoFHandlerType::dimension,
-                         DoFHandlerType::space_dimension,
-                         typename DoFHandlerType::level_cell_iterator,
-                         typename DoFHandlerType::level_cell_iterator>(
-        renumbering, start, end, true);
+    typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+      dof_handler.end(level);
+
+    const types::global_dof_index result = compute_block_wise<
+      dim,
+      spacedim,
+      typename DoFHandler<dim, spacedim>::level_cell_iterator,
+      typename DoFHandler<dim, spacedim>::level_cell_iterator>(renumbering,
+                                                               start,
+                                                               end,
+                                                               true);
 
     if (result == 0)
       return;
@@ -1308,13 +1301,10 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  hierarchical(DoFHandlerType &dof_handler)
+  hierarchical(DoFHandler<dim, spacedim> &dof_handler)
   {
-    const int dim      = DoFHandlerType::dimension;
-    const int spacedim = DoFHandlerType::space_dimension;
-
     std::vector<types::global_dof_index> renumbering(
       dof_handler.n_locally_owned_dofs(), numbers::invalid_dof_index);
 
@@ -1364,8 +1354,8 @@ namespace DoFRenumbering
             const unsigned int coarse_cell_index =
               tria->get_p4est_tree_to_coarse_cell_permutation()[c];
 
-            const typename DoFHandlerType::level_cell_iterator this_cell(
-              tria, 0, coarse_cell_index, &dof_handler);
+            const typename DoFHandler<dim, spacedim>::level_cell_iterator
+              this_cell(tria, 0, coarse_cell_index, &dof_handler);
 
             next_free_dof_offset =
               compute_hierarchical_recursive<dim>(next_free_dof_offset,
@@ -1382,7 +1372,8 @@ namespace DoFRenumbering
       {
         // this is not a distributed Triangulation, so we can traverse coarse
         // cells in the normal order
-        for (typename DoFHandlerType::cell_iterator cell = dof_handler.begin(0);
+        for (typename DoFHandler<dim, spacedim>::cell_iterator cell =
+               dof_handler.begin(0);
              cell != dof_handler.end(0);
              ++cell)
           next_free_dof_offset =
@@ -1413,10 +1404,10 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  sort_selected_dofs_back(DoFHandlerType &         dof_handler,
-                          const std::vector<bool> &selected_dofs)
+  sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+                          const std::vector<bool> &  selected_dofs)
   {
     std::vector<types::global_dof_index> renumbering(
       dof_handler.n_dofs(), numbers::invalid_dof_index);
@@ -1427,11 +1418,11 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  sort_selected_dofs_back(DoFHandlerType &         dof_handler,
-                          const std::vector<bool> &selected_dofs,
-                          const unsigned int       level)
+  sort_selected_dofs_back(DoFHandler<dim, spacedim> &dof_handler,
+                          const std::vector<bool> &  selected_dofs,
+                          const unsigned int         level)
   {
     Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcDoFHandlerNotInitialized());
@@ -1448,11 +1439,11 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_sort_selected_dofs_back(
     std::vector<types::global_dof_index> &new_indices,
-    const DoFHandlerType &                dof_handler,
+    const DoFHandler<dim, spacedim> &     dof_handler,
     const std::vector<bool> &             selected_dofs)
   {
     const types::global_dof_index n_dofs = dof_handler.n_dofs();
@@ -1486,11 +1477,11 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_sort_selected_dofs_back(
     std::vector<types::global_dof_index> &new_indices,
-    const DoFHandlerType &                dof_handler,
+    const DoFHandler<dim, spacedim> &     dof_handler,
     const std::vector<bool> &             selected_dofs,
     const unsigned int                    level)
   {
@@ -1528,11 +1519,12 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   cell_wise(
-    DoFHandlerType &                                                  dof,
-    const std::vector<typename DoFHandlerType::active_cell_iterator> &cells)
+    DoFHandler<dim, spacedim> &dof,
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+      &cells)
   {
     std::vector<types::global_dof_index> renumbering(
       dof.n_locally_owned_dofs());
@@ -1543,20 +1535,18 @@ namespace DoFRenumbering
   }
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_cell_wise(
     std::vector<types::global_dof_index> &new_indices,
     std::vector<types::global_dof_index> &reverse,
-    const DoFHandlerType &                dof,
-    const typename std::vector<typename DoFHandlerType::active_cell_iterator>
-      &cells)
+    const DoFHandler<dim, spacedim> &     dof,
+    const typename std::vector<
+      typename DoFHandler<dim, spacedim>::active_cell_iterator> &cells)
   {
-    if (const parallel::TriangulationBase<DoFHandlerType::dimension,
-                                          DoFHandlerType::space_dimension> *p =
-          dynamic_cast<const parallel::TriangulationBase<
-            DoFHandlerType::dimension,
-            DoFHandlerType::space_dimension> *>(&dof.get_triangulation()))
+    if (const parallel::TriangulationBase<dim, spacedim> *p =
+          dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
+            &dof.get_triangulation()))
       {
         AssertDimension(cells.size(), p->n_locally_owned_active_cells());
       }
@@ -1619,13 +1609,12 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  cell_wise(
-    DoFHandlerType &   dof,
-    const unsigned int level,
-    const typename std::vector<typename DoFHandlerType::level_cell_iterator>
-      &cells)
+  cell_wise(DoFHandler<dim, spacedim> &dof,
+            const unsigned int         level,
+            const typename std::vector<
+              typename DoFHandler<dim, spacedim>::level_cell_iterator> &cells)
   {
     Assert(dof.n_dofs(level) != numbers::invalid_dof_index,
            ExcDoFHandlerNotInitialized());
@@ -1639,15 +1628,15 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_cell_wise(
     std::vector<types::global_dof_index> &new_order,
     std::vector<types::global_dof_index> &reverse,
-    const DoFHandlerType &                dof,
+    const DoFHandler<dim, spacedim> &     dof,
     const unsigned int                    level,
-    const typename std::vector<typename DoFHandlerType::level_cell_iterator>
-      &cells)
+    const typename std::vector<
+      typename DoFHandler<dim, spacedim>::level_cell_iterator> &cells)
   {
     Assert(cells.size() == dof.get_triangulation().n_cells(level),
            ExcDimensionMismatch(cells.size(),
@@ -1693,11 +1682,11 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  downstream(DoFHandlerType &                                  dof,
-             const Tensor<1, DoFHandlerType::space_dimension> &direction,
-             const bool dof_wise_renumbering)
+  downstream(DoFHandler<dim, spacedim> &dof,
+             const Tensor<1, spacedim> &direction,
+             const bool                 dof_wise_renumbering)
   {
     std::vector<types::global_dof_index> renumbering(dof.n_dofs());
     std::vector<types::global_dof_index> reverse(dof.n_dofs());
@@ -1709,39 +1698,31 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  compute_downstream(
-    std::vector<types::global_dof_index> &            new_indices,
-    std::vector<types::global_dof_index> &            reverse,
-    const DoFHandlerType &                            dof,
-    const Tensor<1, DoFHandlerType::space_dimension> &direction,
-    const bool                                        dof_wise_renumbering)
+  compute_downstream(std::vector<types::global_dof_index> &new_indices,
+                     std::vector<types::global_dof_index> &reverse,
+                     const DoFHandler<dim, spacedim> &     dof,
+                     const Tensor<1, spacedim> &           direction,
+                     const bool                            dof_wise_renumbering)
   {
-    Assert(
-      (dynamic_cast<
-         const parallel::TriangulationBase<DoFHandlerType::dimension,
-                                           DoFHandlerType::space_dimension> *>(
-         &dof.get_triangulation()) == nullptr),
-      ExcNotImplemented());
+    Assert((dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
+              &dof.get_triangulation()) == nullptr),
+           ExcNotImplemented());
 
     if (dof_wise_renumbering == false)
       {
-        std::vector<typename DoFHandlerType::active_cell_iterator>
+        std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
           ordered_cells;
         ordered_cells.reserve(dof.get_triangulation().n_active_cells());
-        const CompareDownstream<typename DoFHandlerType::active_cell_iterator,
-                                DoFHandlerType::space_dimension>
+        const CompareDownstream<
+          typename DoFHandler<dim, spacedim>::active_cell_iterator,
+          spacedim>
           comparator(direction);
 
-        typename DoFHandlerType::active_cell_iterator p   = dof.begin_active();
-        typename DoFHandlerType::active_cell_iterator end = dof.end();
+        for (const auto &cell : dof.active_cell_iterators())
+          ordered_cells.push_back(cell);
 
-        while (p != end)
-          {
-            ordered_cells.push_back(p);
-            ++p;
-          }
         std::sort(ordered_cells.begin(), ordered_cells.end(), comparator);
 
         compute_cell_wise(new_indices, reverse, dof, ordered_cells);
@@ -1750,50 +1731,42 @@ namespace DoFRenumbering
       {
         // similar code as for
         // DoFTools::map_dofs_to_support_points, but
-        // need to do this for general DoFHandlerType classes and
+        // need to do this for general DoFHandler<dim, spacedim> classes and
         // want to be able to sort the result
         // (otherwise, could use something like
         // DoFTools::map_support_points_to_dofs)
         const unsigned int n_dofs = dof.n_dofs();
-        std::vector<
-          std::pair<Point<DoFHandlerType::space_dimension>, unsigned int>>
+        std::vector<std::pair<Point<spacedim>, unsigned int>>
           support_point_list(n_dofs);
 
-        const hp::FECollection<DoFHandlerType::dimension> &fe_collection =
-          dof.get_fe_collection();
+        const hp::FECollection<dim> &fe_collection = dof.get_fe_collection();
         Assert(fe_collection[0].has_support_points(),
-               typename FiniteElement<
-                 DoFHandlerType::dimension>::ExcFEHasNoSupportPoints());
-        hp::QCollection<DoFHandlerType::dimension> quadrature_collection;
+               typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
+        hp::QCollection<dim> quadrature_collection;
         for (unsigned int comp = 0; comp < fe_collection.size(); ++comp)
           {
             Assert(fe_collection[comp].has_support_points(),
-                   typename FiniteElement<
-                     DoFHandlerType::dimension>::ExcFEHasNoSupportPoints());
+                   typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
             quadrature_collection.push_back(
-              Quadrature<DoFHandlerType::dimension>(
-                fe_collection[comp].get_unit_support_points()));
+              Quadrature<dim>(fe_collection[comp].get_unit_support_points()));
           }
-        hp::FEValues<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
-          hp_fe_values(fe_collection,
-                       quadrature_collection,
-                       update_quadrature_points);
+        hp::FEValues<dim, spacedim> hp_fe_values(fe_collection,
+                                                 quadrature_collection,
+                                                 update_quadrature_points);
 
         std::vector<bool> already_touched(n_dofs, false);
 
-        std::vector<types::global_dof_index>          local_dof_indices;
-        typename DoFHandlerType::active_cell_iterator begin =
-          dof.begin_active();
-        typename DoFHandlerType::active_cell_iterator end = dof.end();
-        for (; begin != end; ++begin)
+        std::vector<types::global_dof_index> local_dof_indices;
+
+        for (const auto &cell : dof.active_cell_iterators())
           {
-            const unsigned int dofs_per_cell = begin->get_fe().dofs_per_cell;
+            const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell;
             local_dof_indices.resize(dofs_per_cell);
-            hp_fe_values.reinit(begin);
-            const FEValues<DoFHandlerType::dimension> &fe_values =
+            hp_fe_values.reinit(cell);
+            const FEValues<dim> &fe_values =
               hp_fe_values.get_present_fe_values();
-            begin->get_active_or_mg_dof_indices(local_dof_indices);
-            const std::vector<Point<DoFHandlerType::space_dimension>> &points =
+            cell->get_active_or_mg_dof_indices(local_dof_indices);
+            const std::vector<Point<spacedim>> &points =
               fe_values.get_quadrature_points();
             for (unsigned int i = 0; i < dofs_per_cell; ++i)
               if (!already_touched[local_dof_indices[i]])
@@ -1805,8 +1778,7 @@ namespace DoFRenumbering
                 }
           }
 
-        ComparePointwiseDownstream<DoFHandlerType::space_dimension> comparator(
-          direction);
+        ComparePointwiseDownstream<spacedim> comparator(direction);
         std::sort(support_point_list.begin(),
                   support_point_list.end(),
                   comparator);
@@ -1817,12 +1789,12 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  downstream(DoFHandlerType &                                  dof,
-             const unsigned int                                level,
-             const Tensor<1, DoFHandlerType::space_dimension> &direction,
-             const bool dof_wise_renumbering)
+  downstream(DoFHandler<dim, spacedim> &dof,
+             const unsigned int         level,
+             const Tensor<1, spacedim> &direction,
+             const bool                 dof_wise_renumbering)
   {
     std::vector<types::global_dof_index> renumbering(dof.n_dofs(level));
     std::vector<types::global_dof_index> reverse(dof.n_dofs(level));
@@ -1834,26 +1806,29 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  compute_downstream(
-    std::vector<types::global_dof_index> &            new_indices,
-    std::vector<types::global_dof_index> &            reverse,
-    const DoFHandlerType &                            dof,
-    const unsigned int                                level,
-    const Tensor<1, DoFHandlerType::space_dimension> &direction,
-    const bool                                        dof_wise_renumbering)
+  compute_downstream(std::vector<types::global_dof_index> &new_indices,
+                     std::vector<types::global_dof_index> &reverse,
+                     const DoFHandler<dim, spacedim> &     dof,
+                     const unsigned int                    level,
+                     const Tensor<1, spacedim> &           direction,
+                     const bool                            dof_wise_renumbering)
   {
     if (dof_wise_renumbering == false)
       {
-        std::vector<typename DoFHandlerType::level_cell_iterator> ordered_cells;
+        std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
+          ordered_cells;
         ordered_cells.reserve(dof.get_triangulation().n_cells(level));
-        const CompareDownstream<typename DoFHandlerType::level_cell_iterator,
-                                DoFHandlerType::space_dimension>
+        const CompareDownstream<
+          typename DoFHandler<dim, spacedim>::level_cell_iterator,
+          spacedim>
           comparator(direction);
 
-        typename DoFHandlerType::level_cell_iterator p   = dof.begin(level);
-        typename DoFHandlerType::level_cell_iterator end = dof.end(level);
+        typename DoFHandler<dim, spacedim>::level_cell_iterator p =
+          dof.begin(level);
+        typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+          dof.end(level);
 
         while (p != end)
           {
@@ -1867,33 +1842,31 @@ namespace DoFRenumbering
     else
       {
         Assert(dof.get_fe().has_support_points(),
-               typename FiniteElement<
-                 DoFHandlerType::dimension>::ExcFEHasNoSupportPoints());
+               typename FiniteElement<dim>::ExcFEHasNoSupportPoints());
         const unsigned int n_dofs = dof.n_dofs(level);
-        std::vector<
-          std::pair<Point<DoFHandlerType::space_dimension>, unsigned int>>
+        std::vector<std::pair<Point<spacedim>, unsigned int>>
           support_point_list(n_dofs);
 
-        Quadrature<DoFHandlerType::dimension> q_dummy(
-          dof.get_fe().get_unit_support_points());
-        FEValues<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
-          fe_values(dof.get_fe(), q_dummy, update_quadrature_points);
+        Quadrature<dim>         q_dummy(dof.get_fe().get_unit_support_points());
+        FEValues<dim, spacedim> fe_values(dof.get_fe(),
+                                          q_dummy,
+                                          update_quadrature_points);
 
         std::vector<bool> already_touched(dof.n_dofs(), false);
 
         const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
         std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
-        typename DoFHandlerType::level_cell_iterator begin = dof.begin(level);
-        typename DoFHandlerType::level_cell_iterator end   = dof.end(level);
+        typename DoFHandler<dim, spacedim>::level_cell_iterator begin =
+          dof.begin(level);
+        typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+          dof.end(level);
         for (; begin != end; ++begin)
           {
-            const typename Triangulation<
-              DoFHandlerType::dimension,
-              DoFHandlerType::space_dimension>::cell_iterator &begin_tria =
-              begin;
+            const typename Triangulation<dim, spacedim>::cell_iterator
+              &begin_tria = begin;
             begin->get_active_or_mg_dof_indices(local_dof_indices);
             fe_values.reinit(begin_tria);
-            const std::vector<Point<DoFHandlerType::space_dimension>> &points =
+            const std::vector<Point<spacedim>> &points =
               fe_values.get_quadrature_points();
             for (unsigned int i = 0; i < dofs_per_cell; ++i)
               if (!already_touched[local_dof_indices[i]])
@@ -1905,8 +1878,7 @@ namespace DoFRenumbering
                 }
           }
 
-        ComparePointwiseDownstream<DoFHandlerType::space_dimension> comparator(
-          direction);
+        ComparePointwiseDownstream<spacedim> comparator(direction);
         std::sort(support_point_list.begin(),
                   support_point_list.end(),
                   comparator);
@@ -1991,11 +1963,11 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  clockwise_dg(DoFHandlerType &                              dof,
-               const Point<DoFHandlerType::space_dimension> &center,
-               const bool                                    counter)
+  clockwise_dg(DoFHandler<dim, spacedim> &dof,
+               const Point<spacedim> &    center,
+               const bool                 counter)
   {
     std::vector<types::global_dof_index> renumbering(dof.n_dofs());
     compute_clockwise_dg(renumbering, dof, center, counter);
@@ -2005,26 +1977,21 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_clockwise_dg(std::vector<types::global_dof_index> &new_indices,
-                       const DoFHandlerType &                dof,
-                       const Point<DoFHandlerType::space_dimension> &center,
-                       const bool                                    counter)
+                       const DoFHandler<dim, spacedim> &     dof,
+                       const Point<spacedim> &               center,
+                       const bool                            counter)
   {
-    std::vector<typename DoFHandlerType::active_cell_iterator> ordered_cells;
+    std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+      ordered_cells;
     ordered_cells.reserve(dof.get_triangulation().n_active_cells());
-    internal::ClockCells<DoFHandlerType::space_dimension> comparator(center,
-                                                                     counter);
+    internal::ClockCells<spacedim> comparator(center, counter);
 
-    typename DoFHandlerType::active_cell_iterator p   = dof.begin_active();
-    typename DoFHandlerType::active_cell_iterator end = dof.end();
+    for (const auto &cell : dof.active_cell_iterators())
+      ordered_cells.push_back(cell);
 
-    while (p != end)
-      {
-        ordered_cells.push_back(p);
-        ++p;
-      }
     std::sort(ordered_cells.begin(), ordered_cells.end(), comparator);
 
     std::vector<types::global_dof_index> reverse(new_indices.size());
@@ -2033,20 +2000,22 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  clockwise_dg(DoFHandlerType &                              dof,
-               const unsigned int                            level,
-               const Point<DoFHandlerType::space_dimension> &center,
-               const bool                                    counter)
+  clockwise_dg(DoFHandler<dim, spacedim> &dof,
+               const unsigned int         level,
+               const Point<spacedim> &    center,
+               const bool                 counter)
   {
-    std::vector<typename DoFHandlerType::level_cell_iterator> ordered_cells;
+    std::vector<typename DoFHandler<dim, spacedim>::level_cell_iterator>
+      ordered_cells;
     ordered_cells.reserve(dof.get_triangulation().n_active_cells());
-    internal::ClockCells<DoFHandlerType::space_dimension> comparator(center,
-                                                                     counter);
+    internal::ClockCells<spacedim> comparator(center, counter);
 
-    typename DoFHandlerType::level_cell_iterator p   = dof.begin(level);
-    typename DoFHandlerType::level_cell_iterator end = dof.end(level);
+    typename DoFHandler<dim, spacedim>::level_cell_iterator p =
+      dof.begin(level);
+    typename DoFHandler<dim, spacedim>::level_cell_iterator end =
+      dof.end(level);
 
     while (p != end)
       {
@@ -2060,9 +2029,9 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  random(DoFHandlerType &dof_handler)
+  random(DoFHandler<dim, spacedim> &dof_handler)
   {
     std::vector<types::global_dof_index> renumbering(
       dof_handler.n_dofs(), numbers::invalid_dof_index);
@@ -2073,9 +2042,9 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  random(DoFHandlerType &dof_handler, const unsigned int level)
+  random(DoFHandler<dim, spacedim> &dof_handler, const unsigned int level)
   {
     Assert(dof_handler.n_dofs(level) != numbers::invalid_dof_index,
            ExcDoFHandlerNotInitialized());
@@ -2091,10 +2060,10 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_random(std::vector<types::global_dof_index> &new_indices,
-                 const DoFHandlerType &                dof_handler)
+                 const DoFHandler<dim, spacedim> &     dof_handler)
   {
     const types::global_dof_index n_dofs = dof_handler.n_dofs();
     Assert(new_indices.size() == n_dofs,
@@ -2124,10 +2093,10 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_random(std::vector<types::global_dof_index> &new_indices,
-                 const DoFHandlerType &                dof_handler,
+                 const DoFHandler<dim, spacedim> &     dof_handler,
                  const unsigned int                    level)
   {
     const types::global_dof_index n_dofs = dof_handler.n_dofs(level);
@@ -2158,14 +2127,12 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  subdomain_wise(DoFHandlerType &dof_handler)
+  subdomain_wise(DoFHandler<dim, spacedim> &dof_handler)
   {
     Assert(
-      (!dynamic_cast<
-        const parallel::TriangulationBase<DoFHandlerType::dimension,
-                                          DoFHandlerType::space_dimension> *>(
+      (!dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
         &dof_handler.get_triangulation())),
       ExcMessage(
         "Parallel triangulations are already enumerated according to their MPI process id."));
@@ -2179,10 +2146,10 @@ namespace DoFRenumbering
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   compute_subdomain_wise(std::vector<types::global_dof_index> &new_dof_indices,
-                         const DoFHandlerType &                dof_handler)
+                         const DoFHandler<dim, spacedim> &     dof_handler)
   {
     const types::global_dof_index n_dofs = dof_handler.n_dofs();
     Assert(new_dof_indices.size() == n_dofs,
index 6c6cc7bea5e92a32d84d3e5fe3f2f7eb09feb85a..064de36baa3bf3fc83a193861abb3b895fb787f5 100644 (file)
@@ -14,8 +14,7 @@
 // ---------------------------------------------------------------------
 
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
-     deal_II_space_dimension : SPACE_DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
     namespace DoFRenumbering
@@ -28,15 +27,14 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
 
       // non-boost functions:
       template void
-      Cuthill_McKee<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      Cuthill_McKee<deal_II_dimension, deal_II_space_dimension>(
         DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const bool,
         const bool,
         const std::vector<types::global_dof_index> &);
 
       template void
-      compute_Cuthill_McKee<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      compute_Cuthill_McKee<deal_II_dimension, deal_II_space_dimension>(
         std::vector<types::global_dof_index> &,
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const bool,
@@ -44,16 +42,16 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
         const std::vector<types::global_dof_index> &);
 
       template void
-      component_wise<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      component_wise<deal_II_dimension, deal_II_space_dimension>(
         DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const std::vector<unsigned int> &);
 
       template void
-      block_wise<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      block_wise<deal_II_dimension, deal_II_space_dimension>(
         DoFHandler<deal_II_dimension, deal_II_space_dimension> &);
 
       template void
-      subdomain_wise<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      subdomain_wise<deal_II_dimension, deal_II_space_dimension>(
         DoFHandler<deal_II_dimension, deal_II_space_dimension> &);
 
       template void
@@ -72,8 +70,7 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
 // TODO[SP]: replace <deal_II_dimension> by <deal_II_dimension,
 // deal_II_space_dimension>
 // where applicable and move to codimension cases above also when applicable
-for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
-     deal_II_space_dimension : SPACE_DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
   {
 #if deal_II_dimension == deal_II_space_dimension
     namespace DoFRenumbering
@@ -118,17 +115,17 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
                      const std::vector<unsigned int> &);
 
       template void
-      block_wise<DoFHandler<deal_II_dimension>>(DoFHandler<deal_II_dimension> &,
-                                                unsigned int);
+      block_wise<deal_II_dimension>(DoFHandler<deal_II_dimension> &,
+                                    unsigned int);
 
       template void
-      cell_wise<DoFHandler<deal_II_dimension>>(
+      cell_wise<deal_II_dimension>(
         DoFHandler<deal_II_dimension> &,
         const std::vector<DoFHandler<deal_II_dimension>::active_cell_iterator>
           &);
 
       template void
-      compute_cell_wise<DoFHandler<deal_II_dimension>>(
+      compute_cell_wise<deal_II_dimension>(
         std::vector<types::global_dof_index> &,
         std::vector<types::global_dof_index> &,
         const DoFHandler<deal_II_dimension> &,
@@ -136,14 +133,14 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
           &);
 
       template void
-      cell_wise<DoFHandler<deal_II_dimension>>(
+      cell_wise<deal_II_dimension>(
         DoFHandler<deal_II_dimension> &,
         unsigned int,
         const std::vector<DoFHandler<deal_II_dimension>::level_cell_iterator>
           &);
 
       template void
-      compute_cell_wise<DoFHandler<deal_II_dimension>>(
+      compute_cell_wise<deal_II_dimension>(
         std::vector<types::global_dof_index> &,
         std::vector<types::global_dof_index> &,
         const DoFHandler<deal_II_dimension> &,
@@ -152,7 +149,7 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
           &);
 
       template void
-      compute_downstream<DoFHandler<deal_II_dimension>>(
+      compute_downstream<deal_II_dimension>(
         std::vector<types::global_dof_index> &,
         std::vector<types::global_dof_index> &,
         const DoFHandler<deal_II_dimension> &,
@@ -160,13 +157,12 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
         const bool);
 
       template void
-      clockwise_dg<DoFHandler<deal_II_dimension>>(
-        DoFHandler<deal_II_dimension> &,
-        const Point<deal_II_dimension> &,
-        bool);
+      clockwise_dg<deal_II_dimension>(DoFHandler<deal_II_dimension> &,
+                                      const Point<deal_II_dimension> &,
+                                      bool);
 
       template void
-      compute_clockwise_dg<DoFHandler<deal_II_dimension>>(
+      compute_clockwise_dg<deal_II_dimension>(
         std::vector<types::global_dof_index> &,
         const DoFHandler<deal_II_dimension> &,
         const Point<deal_II_dimension> &,
@@ -199,36 +195,34 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
       // Generic numbering schemes
 
       template void
-      random<DoFHandler<deal_II_dimension>>(DoFHandler<deal_II_dimension> &);
+      random<deal_II_dimension>(DoFHandler<deal_II_dimension> &);
 
       template void
-      compute_random<DoFHandler<deal_II_dimension>>(
-        std::vector<types::global_dof_index> &,
-        const DoFHandler<deal_II_dimension> &);
+      compute_random<deal_II_dimension>(std::vector<types::global_dof_index> &,
+                                        const DoFHandler<deal_II_dimension> &);
 
       template void
-      random<DoFHandler<deal_II_dimension>>(DoFHandler<deal_II_dimension> &,
-                                            const unsigned int);
+      random<deal_II_dimension>(DoFHandler<deal_II_dimension> &,
+                                const unsigned int);
 
       template void
-      compute_random<DoFHandler<deal_II_dimension>>(
-        std::vector<types::global_dof_index> &,
-        const DoFHandler<deal_II_dimension> &,
-        const unsigned int);
+      compute_random<deal_II_dimension>(std::vector<types::global_dof_index> &,
+                                        const DoFHandler<deal_II_dimension> &,
+                                        const unsigned int);
 
       template void
-      sort_selected_dofs_back<DoFHandler<deal_II_dimension>>(
+      sort_selected_dofs_back<deal_II_dimension>(
         DoFHandler<deal_II_dimension> &,
         const std::vector<bool> &);
 
       template void
-      compute_sort_selected_dofs_back<DoFHandler<deal_II_dimension>>(
+      compute_sort_selected_dofs_back<deal_II_dimension>(
         std::vector<types::global_dof_index> &,
         const DoFHandler<deal_II_dimension> &,
         const std::vector<bool> &);
 
       template void
-      Cuthill_McKee<DoFHandler<deal_II_dimension>>(
+      Cuthill_McKee<deal_II_dimension>(
         DoFHandler<deal_II_dimension> &,
         const unsigned int,
         const bool,

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.