]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove DoFHandlerType from dofs/dof_tools 10608/head
authorPeter Munch <peterrmuench@gmail.com>
Fri, 26 Jun 2020 07:09:34 +0000 (09:09 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Fri, 26 Jun 2020 08:18:19 +0000 (10:18 +0200)
examples/step-45/step-45.cc
include/deal.II/dofs/dof_tools.h
source/dofs/dof_tools.cc
source/dofs/dof_tools.inst.in
source/dofs/dof_tools_constraints.cc
source/dofs/dof_tools_constraints.inst.in
source/dofs/dof_tools_sparsity.cc
source/dofs/dof_tools_sparsity.inst.in
source/multigrid/mg_tools.cc
tests/hp/step-13.cc

index d97f7d3994b07a4c583175960831d39e7c0c4869..606d7d544545ecb1fb0ec66a3898f747137f8434 100644 (file)
@@ -457,11 +457,11 @@ namespace Step45
       // After setting up all the information in periodicity_vector all we have
       // to do is to tell make_periodicity_constraints to create the desired
       // constraints.
-      DoFTools::make_periodicity_constraints<DoFHandler<dim>>(
-        periodicity_vector,
-        constraints,
-        fe.component_mask(velocities),
-        first_vector_components);
+      DoFTools::make_periodicity_constraints<dim, dim>(periodicity_vector,
+                                                       constraints,
+                                                       fe.component_mask(
+                                                         velocities),
+                                                       first_vector_components);
 
       VectorTools::interpolate_boundary_values(mapping,
                                                dof_handler,
index 58a1d760c01e5475e235b62a1c89a3da1d862c08..57c1c76721d980a3310b0b9b32d960940df74bff 100644 (file)
@@ -79,10 +79,10 @@ namespace DoFTools
      * lambda in the parameter list) to avoid a bug in gcc where the same lambda
      * gets defined multiple times.
      */
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     inline bool
     always_couple_on_faces(
-      const typename DoFHandlerType::active_cell_iterator &,
+      const typename DoFHandler<dim, spacedim>::active_cell_iterator &,
       const unsigned int)
     {
       return true;
@@ -426,12 +426,13 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number = double>
   void
   make_sparsity_pattern(
-    const DoFHandlerType &           dof_handler,
+    const DoFHandler<dim, spacedim> &dof_handler,
     SparsityPatternType &            sparsity_pattern,
     const AffineConstraints<number> &constraints = AffineConstraints<number>(),
     const bool                       keep_constrained_dofs = true,
@@ -502,12 +503,13 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number = double>
   void
   make_sparsity_pattern(
-    const DoFHandlerType &           dof_handler,
+    const DoFHandler<dim, spacedim> &dof_handler,
     const Table<2, Coupling> &       coupling,
     SparsityPatternType &            sparsity_pattern,
     const AffineConstraints<number> &constraints = AffineConstraints<number>(),
@@ -534,11 +536,11 @@ namespace DoFTools
    * whereas the ones that correspond to columns come from the second
    * DoFHandler.
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
-  make_sparsity_pattern(const DoFHandlerType &dof_row,
-                        const DoFHandlerType &dof_col,
-                        SparsityPatternType & sparsity);
+  make_sparsity_pattern(const DoFHandler<dim, spacedim> &dof_row,
+                        const DoFHandler<dim, spacedim> &dof_col,
+                        SparsityPatternType &            sparsity);
 
   /**
    * Compute which entries of a matrix built on the given @p dof_handler may
@@ -585,10 +587,10 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
-  make_flux_sparsity_pattern(const DoFHandlerType &dof_handler,
-                             SparsityPatternType & sparsity_pattern);
+  make_flux_sparsity_pattern(const DoFHandler<dim, spacedim> &dof_handler,
+                             SparsityPatternType &            sparsity_pattern);
 
   /**
    * This function does essentially the same as the other
@@ -598,12 +600,13 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
   make_flux_sparsity_pattern(
-    const DoFHandlerType &           dof_handler,
+    const DoFHandler<dim, spacedim> &dof_handler,
     SparsityPatternType &            sparsity_pattern,
     const AffineConstraints<number> &constraints,
     const bool                       keep_constrained_dofs = true,
@@ -629,13 +632,13 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
   make_flux_sparsity_pattern(
-    const DoFHandlerType &    dof,
-    SparsityPatternType &     sparsity,
-    const Table<2, Coupling> &cell_integrals_mask,
-    const Table<2, Coupling> &face_integrals_mask,
+    const DoFHandler<dim, spacedim> &dof,
+    SparsityPatternType &            sparsity,
+    const Table<2, Coupling> &       cell_integrals_mask,
+    const Table<2, Coupling> &       face_integrals_mask,
     const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id);
 
 
@@ -665,12 +668,13 @@ namespace DoFTools
    *    };
    * @endcode
    */
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
   make_flux_sparsity_pattern(
-    const DoFHandlerType &           dof,
+    const DoFHandler<dim, spacedim> &dof,
     SparsityPatternType &            sparsity,
     const AffineConstraints<number> &constraints,
     const bool                       keep_constrained_dofs,
@@ -678,9 +682,9 @@ namespace DoFTools
     const Table<2, Coupling> &       face_couplings,
     const types::subdomain_id        subdomain_id,
     const std::function<
-      bool(const typename DoFHandlerType::active_cell_iterator &,
+      bool(const typename DoFHandler<dim, spacedim>::active_cell_iterator &,
            const unsigned int)> &face_has_flux_coupling =
-      &internal::always_couple_on_faces<DoFHandlerType>);
+      &internal::always_couple_on_faces<dim, spacedim>);
 
   /**
    * Create the sparsity pattern for boundary matrices. See the general
@@ -691,10 +695,10 @@ namespace DoFTools
    * the matrix does not consist of domain integrals, but only of integrals
    * over the boundary of the domain.
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
   make_boundary_sparsity_pattern(
-    const DoFHandlerType &                      dof,
+    const DoFHandler<dim, spacedim> &           dof,
     const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
     SparsityPatternType &                       sparsity_pattern);
 
@@ -715,14 +719,14 @@ namespace DoFTools
    * map with the boundary indicators you want and set the function pointers to
    * null pointers).
    */
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
   make_boundary_sparsity_pattern(
-    const DoFHandlerType &dof,
-    const std::map<types::boundary_id,
-                   const Function<DoFHandlerType::space_dimension, number> *>
+    const DoFHandler<dim, spacedim> &dof,
+    const std::map<types::boundary_id, const Function<spacedim, number> *>
       &                                         boundary_ids,
     const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
     SparsityPatternType &                       sparsity);
@@ -777,10 +781,10 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
-  make_hanging_node_constraints(const DoFHandlerType &     dof_handler,
-                                AffineConstraints<number> &constraints);
+  make_hanging_node_constraints(const DoFHandler<dim, spacedim> &dof_handler,
+                                AffineConstraints<number> &      constraints);
 
   /**
    * This function is used when different variables in a problem are
@@ -1097,8 +1101,25 @@ namespace DoFTools
    * @ref GlossPeriodicConstraints "Glossary entry on periodic boundary conditions"
    * and step-45 for further information.
    */
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
+  make_periodicity_constraints(
+    const std::vector<GridTools::PeriodicFacePair<
+      typename DoFHandler<dim, spacedim>::cell_iterator>> &periodic_faces,
+    AffineConstraints<number> &                            constraints,
+    const ComponentMask &            component_mask = ComponentMask(),
+    const std::vector<unsigned int> &first_vector_components =
+      std::vector<unsigned int>(),
+    const number periodicity_factor = 1.);
+
+  /**
+   * The same as above.
+   *
+   * @deprecated Use the function that takes dim and spacedim as template
+   *   argument.
+   */
+  template <typename DoFHandlerType, typename number>
+  DEAL_II_DEPRECATED void
   make_periodicity_constraints(
     const std::vector<
       GridTools::PeriodicFacePair<typename DoFHandlerType::cell_iterator>>
@@ -1140,16 +1161,16 @@ namespace DoFTools
    * @ref GlossPeriodicConstraints "Glossary entry on periodic boundary conditions"
    * for further information.
    */
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
   make_periodicity_constraints(
-    const DoFHandlerType &     dof_handler,
-    const types::boundary_id   b_id1,
-    const types::boundary_id   b_id2,
-    const unsigned int         direction,
-    AffineConstraints<number> &constraints,
-    const ComponentMask &      component_mask     = ComponentMask(),
-    const number               periodicity_factor = 1.);
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::boundary_id         b_id1,
+    const types::boundary_id         b_id2,
+    const unsigned int               direction,
+    AffineConstraints<number> &      constraints,
+    const ComponentMask &            component_mask     = ComponentMask(),
+    const number                     periodicity_factor = 1.);
 
 
 
@@ -1178,15 +1199,15 @@ namespace DoFTools
    * @ref GlossPeriodicConstraints "Glossary entry on periodic boundary conditions"
    * for further information.
    */
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
   make_periodicity_constraints(
-    const DoFHandlerType &     dof_handler,
-    const types::boundary_id   b_id,
-    const unsigned int         direction,
-    AffineConstraints<number> &constraints,
-    const ComponentMask &      component_mask     = ComponentMask(),
-    const number               periodicity_factor = 1.);
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::boundary_id         b_id,
+    const unsigned int               direction,
+    AffineConstraints<number> &      constraints,
+    const ComponentMask &            component_mask     = ComponentMask(),
+    const number                     periodicity_factor = 1.);
 
   /**
    * @}
@@ -1215,18 +1236,18 @@ namespace DoFTools
    * @deprecated For the reason stated above, this function is deprecated in
    *   favor of the following function.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   DEAL_II_DEPRECATED void
-  extract_hanging_node_dofs(const DoFHandlerType &dof_handler,
-                            std::vector<bool> &   selected_dofs);
+  extract_hanging_node_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                            std::vector<bool> &              selected_dofs);
 
   /**
    * Same as above but return the selected DoFs as IndexSet. In particular,
    * for parallel::TriangulationBase objects this function should be preferred.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  extract_hanging_node_dofs(const DoFHandlerType &dof_handler);
+  extract_hanging_node_dofs(const DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    * Extract the indices of the degrees of freedom belonging to certain vector
@@ -1270,11 +1291,11 @@ namespace DoFTools
    *   freedom. It is consequently deprecated in favor of the following
    *   function.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   DEAL_II_DEPRECATED void
-  extract_dofs(const DoFHandlerType &dof_handler,
-               const ComponentMask & component_mask,
-               std::vector<bool> &   selected_dofs);
+  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+               const ComponentMask &            component_mask,
+               std::vector<bool> &              selected_dofs);
 
   /**
    * Extract the (locally owned) indices of the degrees of freedom belonging to
@@ -1308,10 +1329,10 @@ namespace DoFTools
    *   number of degrees of freedom. Note that the resulting object is always
    *   a subset of what DoFHandler::locally_owned_dofs() returns.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  extract_dofs(const DoFHandlerType &dof_handler,
-               const ComponentMask & component_mask);
+  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+               const ComponentMask &            component_mask);
 
   /**
    * This function is the equivalent to the DoFTools::extract_dofs() functions
@@ -1343,11 +1364,11 @@ namespace DoFTools
    *   freedom. It is consequently deprecated in favor of the following
    *   function.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   DEAL_II_DEPRECATED void
-  extract_dofs(const DoFHandlerType &dof_handler,
-               const BlockMask &     block_mask,
-               std::vector<bool> &   selected_dofs);
+  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+               const BlockMask &                block_mask,
+               std::vector<bool> &              selected_dofs);
 
   /**
    * This function is the equivalent to the DoFTools::extract_dofs() functions
@@ -1372,31 +1393,32 @@ namespace DoFTools
    *   number of degrees of freedom. Note that the resulting object is always
    *   a subset of what DoFHandler::locally_owned_dofs() returns.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  extract_dofs(const DoFHandlerType &dof_handler, const BlockMask &block_mask);
+  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+               const BlockMask &                block_mask);
 
   /**
    * Do the same thing as the corresponding extract_dofs() function for one
    * level of a multi-grid DoF numbering.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_level_dofs(const unsigned int    level,
-                     const DoFHandlerType &dof,
-                     const ComponentMask & component_mask,
-                     std::vector<bool> &   selected_dofs);
+  extract_level_dofs(const unsigned int               level,
+                     const DoFHandler<dim, spacedim> &dof,
+                     const ComponentMask &            component_mask,
+                     std::vector<bool> &              selected_dofs);
 
   /**
    * Do the same thing as the corresponding extract_dofs() function for one
    * level of a multi-grid DoF numbering.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_level_dofs(const unsigned int    level,
-                     const DoFHandlerType &dof,
-                     const BlockMask &     component_mask,
-                     std::vector<bool> &   selected_dofs);
+  extract_level_dofs(const unsigned int               level,
+                     const DoFHandler<dim, spacedim> &dof,
+                     const BlockMask &                component_mask,
+                     std::vector<bool> &              selected_dofs);
 
   /**
    * Extract all degrees of freedom which are at the boundary and belong to
@@ -1450,9 +1472,9 @@ namespace DoFTools
    * @see
    * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_boundary_dofs(const DoFHandlerType &              dof_handler,
+  extract_boundary_dofs(const DoFHandler<dim, spacedim> &   dof_handler,
                         const ComponentMask &               component_mask,
                         std::vector<bool> &                 selected_dofs,
                         const std::set<types::boundary_id> &boundary_ids =
@@ -1488,9 +1510,9 @@ namespace DoFTools
    * @see
    * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_boundary_dofs(const DoFHandlerType &              dof_handler,
+  extract_boundary_dofs(const DoFHandler<dim, spacedim> &   dof_handler,
                         const ComponentMask &               component_mask,
                         IndexSet &                          selected_dofs,
                         const std::set<types::boundary_id> &boundary_ids =
@@ -1512,10 +1534,10 @@ namespace DoFTools
    * @see
    * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   extract_dofs_with_support_on_boundary(
-    const DoFHandlerType &              dof_handler,
+    const DoFHandler<dim, spacedim> &   dof_handler,
     const ComponentMask &               component_mask,
     std::vector<bool> &                 selected_dofs,
     const std::set<types::boundary_id> &boundary_ids =
@@ -1548,12 +1570,13 @@ namespace DoFTools
    * DoFs that are associated with the locally owned or ghost cells, but are not
    * owned by the current MPI core.
    */
-  template <typename DoFHandlerType, typename number = double>
+  template <int dim, int spacedim, typename number = double>
   IndexSet
   extract_dofs_with_support_contained_within(
-    const DoFHandlerType &dof_handler,
+    const DoFHandler<dim, spacedim> &dof_handler,
     const std::function<
-      bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate,
+      bool(const typename DoFHandler<dim, spacedim>::active_cell_iterator &)>
+      &                              predicate,
     const AffineConstraints<number> &constraints = AffineConstraints<number>());
 
   /**
@@ -1589,11 +1612,11 @@ namespace DoFTools
    * The main reason for this program is the use of the null space with the
    * AMG preconditioner.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_constant_modes(const DoFHandlerType &          dof_handler,
-                         const ComponentMask &           component_mask,
-                         std::vector<std::vector<bool>> &constant_modes);
+  extract_constant_modes(const DoFHandler<dim, spacedim> &dof_handler,
+                         const ComponentMask &            component_mask,
+                         std::vector<std::vector<bool>> & constant_modes);
   //@}
 
   /**
@@ -1609,11 +1632,11 @@ namespace DoFTools
    * If you want to get a unique association of degree of freedom with
    * subdomains, use the @p get_subdomain_association function.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_subdomain_dofs(const DoFHandlerType &    dof_handler,
-                         const types::subdomain_id subdomain_id,
-                         std::vector<bool> &       selected_dofs);
+  extract_subdomain_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                         const types::subdomain_id        subdomain_id,
+                         std::vector<bool> &              selected_dofs);
 
   /**
    * Extract the set of global DoF indices that are active on the current
@@ -1629,10 +1652,10 @@ namespace DoFTools
    * from the dof_indices_with_subdomain_association() function when called
    * with the locally owned subdomain id.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_locally_active_dofs(const DoFHandlerType &dof_handler,
-                              IndexSet &            dof_set);
+  extract_locally_active_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                              IndexSet &                       dof_set);
 
   /**
    * Extract the set of global DoF indices that are active on the current
@@ -1643,10 +1666,10 @@ namespace DoFTools
    * not artificial (see
    * @ref GlossArtificialCell "the glossary").
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_locally_relevant_dofs(const DoFHandlerType &dof_handler,
-                                IndexSet &            dof_set);
+  extract_locally_relevant_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                                IndexSet &                       dof_set);
 
 
   /**
@@ -1658,11 +1681,11 @@ namespace DoFTools
    * also corresponds to the default value), then the union of the returned
    * index sets equlas what DoFHandler::locally_owned_dofs() returns.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<IndexSet>
   locally_owned_dofs_per_component(
-    const DoFHandlerType &dof_handler,
-    const ComponentMask & components = ComponentMask());
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const ComponentMask &            components = ComponentMask());
 
   /**
    * For each processor, determine the set of locally owned degrees of freedom
@@ -1677,9 +1700,10 @@ namespace DoFTools
    * locally, and consequently can not say anything definitive about the
    * degrees of freedom active on other processors' locally owned cells.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<IndexSet>
-  locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler);
+  locally_owned_dofs_per_subdomain(
+    const DoFHandler<dim, spacedim> &dof_handler);
 
   /**
    *
@@ -1695,20 +1719,22 @@ namespace DoFTools
    * locally, and consequently can not say anything definitive about the
    * degrees of freedom active on other processors' locally owned cells.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<IndexSet>
-  locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler);
+  locally_relevant_dofs_per_subdomain(
+    const DoFHandler<dim, spacedim> &dof_handler);
 
 
   /**
    * Same as extract_locally_relevant_dofs() but for multigrid DoFs for the
    * given @p level.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_locally_relevant_level_dofs(const DoFHandlerType &dof_handler,
-                                      const unsigned int    level,
-                                      IndexSet &            dof_set);
+  extract_locally_relevant_level_dofs(
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const unsigned int               level,
+    IndexSet &                       dof_set);
 
 
   /**
@@ -1741,9 +1767,9 @@ namespace DoFTools
    * subdomain are not the same the DoFHandler class identifies as those it
    * owns.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  get_subdomain_association(const DoFHandlerType &            dof_handler,
+  get_subdomain_association(const DoFHandler<dim, spacedim> & dof_handler,
                             std::vector<types::subdomain_id> &subdomain);
 
   /**
@@ -1771,10 +1797,11 @@ namespace DoFTools
    * subdomain are not the same the DoFHandler class identifies as those it
    * owns.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   unsigned int
-  count_dofs_with_subdomain_association(const DoFHandlerType &    dof_handler,
-                                        const types::subdomain_id subdomain);
+  count_dofs_with_subdomain_association(
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::subdomain_id        subdomain);
 
   /**
    * Count how many degrees of freedom are uniquely associated with the given
@@ -1795,12 +1822,12 @@ namespace DoFTools
    * subdomain are not the same the DoFHandler class identifies as those it
    * owns.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   count_dofs_with_subdomain_association(
-    const DoFHandlerType &     dof_handler,
-    const types::subdomain_id  subdomain,
-    std::vector<unsigned int> &n_dofs_on_subdomain);
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::subdomain_id        subdomain,
+    std::vector<unsigned int> &      n_dofs_on_subdomain);
 
   /**
    * Return a set of indices that denotes the degrees of freedom that live on
@@ -1823,10 +1850,11 @@ namespace DoFTools
    * subdomain are not the same the DoFHandler class identifies as those it
    * owns.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  dof_indices_with_subdomain_association(const DoFHandlerType &    dof_handler,
-                                         const types::subdomain_id subdomain);
+  dof_indices_with_subdomain_association(
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::subdomain_id        subdomain);
   // @}
   /**
    * @name DoF indices on patches of cells
@@ -1868,13 +1896,8 @@ namespace DoFTools
    * one considers the index into this array a local DoF index, then the local
    * system that results retains the block structure of the global system.
    *
-   * @tparam DoFHandlerType A type that is either DoFHandler or
-   * hp::DoFHandler. In C++, the compiler can not determine the type of
-   * <code>DoFHandlerType</code> from the function call. You need to specify
-   * it as an explicit template argument following the function name.
-   *
    * @param patch A collection of cells within an object of type
-   * DoFHandlerType
+   * DoFHandler<dim, spacedim>::active_cell_iterator
    *
    * @return A list of those global degrees of freedom located on the patch,
    * as defined above.
@@ -1887,10 +1910,22 @@ namespace DoFTools
    * degrees of freedom on these. In other words, this function can only work
    * if all cells in the patch are either locally owned or ghost cells.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<types::global_dof_index>
   get_dofs_on_patch(
-    const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+      &patch);
+
+  /**
+   * The same as above.
+   *
+   * @deprecated Use the function that takes dim and spacedim as template
+   *   argument.
+   */
+  template <typename DoFHandlerType>
+  DEAL_II_DEPRECATED std::vector<types::global_dof_index>
+                     get_dofs_on_patch(
+                       const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
 
   /**
    * Creates a sparsity pattern, which lists
@@ -1971,16 +2006,16 @@ namespace DoFTools
    * contains one vertex index for each block; if false, then the return value
    * contains one block index or <tt>invalid_unsigned_int</tt> for each vertex.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<unsigned int>
-  make_vertex_patches(SparsityPattern &     block_list,
-                      const DoFHandlerType &dof_handler,
-                      const unsigned int    level,
-                      const bool            interior_dofs_only,
-                      const bool            boundary_patches       = false,
-                      const bool            level_boundary_patches = false,
-                      const bool            single_cell_patches    = false,
-                      const bool            invert_vertex_mapping  = false);
+  make_vertex_patches(SparsityPattern &                block_list,
+                      const DoFHandler<dim, spacedim> &dof_handler,
+                      const unsigned int               level,
+                      const bool                       interior_dofs_only,
+                      const bool                       boundary_patches = false,
+                      const bool level_boundary_patches                 = false,
+                      const bool single_cell_patches                    = false,
+                      const bool invert_vertex_mapping = false);
 
   /**
    * Same as above but allows boundary dofs on blocks to be excluded
@@ -1996,16 +2031,16 @@ namespace DoFTools
    * the patch if the boolean value for the corresponding block in the
    * BlockMask of @p exclude_boundary_dofs is false.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<unsigned int>
-  make_vertex_patches(SparsityPattern &     block_list,
-                      const DoFHandlerType &dof_handler,
-                      const unsigned int    level,
-                      const BlockMask &     exclude_boundary_dofs = BlockMask(),
-                      const bool            boundary_patches      = false,
-                      const bool            level_boundary_patches = false,
-                      const bool            single_cell_patches    = false,
-                      const bool            invert_vertex_mapping  = false);
+  make_vertex_patches(SparsityPattern &                block_list,
+                      const DoFHandler<dim, spacedim> &dof_handler,
+                      const unsigned int               level,
+                      const BlockMask &exclude_boundary_dofs  = BlockMask(),
+                      const bool       boundary_patches       = false,
+                      const bool       level_boundary_patches = false,
+                      const bool       single_cell_patches    = false,
+                      const bool       invert_vertex_mapping  = false);
 
   /**
    * Create an incidence matrix that for every cell on a given level of a
@@ -2044,13 +2079,13 @@ namespace DoFTools
    * the domain, and thus need smoothing. This parameter has no effect if
    * <tt>interior_dofs_only</tt> is false.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  make_child_patches(SparsityPattern &     block_list,
-                     const DoFHandlerType &dof_handler,
-                     const unsigned int    level,
-                     const bool            interior_dofs_only,
-                     const bool            boundary_dofs = false);
+  make_child_patches(SparsityPattern &                block_list,
+                     const DoFHandler<dim, spacedim> &dof_handler,
+                     const unsigned int               level,
+                     const bool                       interior_dofs_only,
+                     const bool                       boundary_dofs = false);
 
   /**
    * Create a block list with only a single patch, which in turn contains all
@@ -2071,12 +2106,12 @@ namespace DoFTools
    * @arg <tt>interior_dofs_only</tt>: if true, exclude degrees of freedom on
    * the boundary of the domain.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  make_single_patch(SparsityPattern &     block_list,
-                    const DoFHandlerType &dof_handler,
-                    const unsigned int    level,
-                    const bool            interior_dofs_only = false);
+  make_single_patch(SparsityPattern &                block_list,
+                    const DoFHandler<dim, spacedim> &dof_handler,
+                    const unsigned int               level,
+                    const bool interior_dofs_only = false);
 
   /**
    * @}
@@ -2120,10 +2155,10 @@ namespace DoFTools
    * in @p target_component. If this is not the case, an assertion is thrown.
    * The indices not targeted by target_components are left untouched.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<types::global_dof_index>
   count_dofs_per_fe_component(
-    const DoFHandlerType &           dof_handler,
+    const DoFHandler<dim, spacedim> &dof_handler,
     const bool                       vector_valued_once = false,
     const std::vector<unsigned int> &target_component   = {});
 
@@ -2131,10 +2166,10 @@ namespace DoFTools
    * @deprecated A version of the previous function that returns its
    * information through the non-`const` second argument.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   DEAL_II_DEPRECATED void
   count_dofs_per_component(
-    const DoFHandlerType &                dof_handler,
+    const DoFHandler<dim, spacedim> &     dof_handler,
     std::vector<types::global_dof_index> &dofs_per_component,
     const bool                            vector_valued_once = false,
     const std::vector<unsigned int> &     target_component   = {});
@@ -2155,9 +2190,9 @@ namespace DoFTools
    * element used by the dof_handler argument has blocks, or alternatively as
    * many blocks as are enumerated in the target_blocks argument if given.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<types::global_dof_index>
-  count_dofs_per_fe_block(const DoFHandlerType &           dof,
+  count_dofs_per_fe_block(const DoFHandler<dim, spacedim> &dof,
                           const std::vector<unsigned int> &target_block =
                             std::vector<unsigned int>());
 
@@ -2165,9 +2200,9 @@ namespace DoFTools
    * @deprecated A version of the previous function that returns its
    * information through the non-`const` second argument.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   DEAL_II_DEPRECATED void
-  count_dofs_per_block(const DoFHandlerType &                dof,
+  count_dofs_per_block(const DoFHandler<dim, spacedim> &     dof,
                        std::vector<types::global_dof_index> &dofs_per_block,
                        const std::vector<unsigned int> &     target_block =
                          std::vector<unsigned int>());
@@ -2182,10 +2217,10 @@ namespace DoFTools
    * finite element. For a hp::DoFHandler, the values may be different,
    * though.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  get_active_fe_indices(const DoFHandlerType &     dof_handler,
-                        std::vector<unsigned int> &active_fe_indices);
+  get_active_fe_indices(const DoFHandler<dim, spacedim> &dof_handler,
+                        std::vector<unsigned int> &      active_fe_indices);
 
   /**
    * Count how many degrees of freedom live on a set of cells (i.e., a patch)
@@ -2200,13 +2235,8 @@ namespace DoFTools
    * DoFTools::get_dofs_on_patch() will then help to make the connection
    * between global degrees of freedom and the local ones.
    *
-   * @tparam DoFHandlerType A type that is either DoFHandler or
-   * hp::DoFHandler. In C++, the compiler can not determine the type of
-   * <code>DoFHandlerType</code> from the function call. You need to specify
-   * it as an explicit template argument following the function name.
-   *
    * @param patch A collection of cells within an object of type
-   * DoFHandlerType
+   * DoFHandler<dim, spacedim>
    *
    * @return The number of degrees of freedom associated with the cells of
    * this patch.
@@ -2219,8 +2249,20 @@ namespace DoFTools
    * degrees of freedom on these. In other words, this function can only work
    * if all cells in the patch are either locally owned or ghost cells.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   unsigned int
+  count_dofs_on_patch(
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+      &patch);
+
+  /**
+   * The same as above.
+   *
+   * @deprecated Use the function that takes dim and spacedim as template
+   *   argument.
+   */
+  template <typename DoFHandlerType>
+  DEAL_II_DEPRECATED unsigned int
   count_dofs_on_patch(
     const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
 
@@ -2246,9 +2288,9 @@ namespace DoFTools
    *
    * Prior content of @p mapping is deleted.
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  map_dof_to_boundary_indices(const DoFHandlerType &                dof_handler,
+  map_dof_to_boundary_indices(const DoFHandler<dim, spacedim> &     dof_handler,
                               std::vector<types::global_dof_index> &mapping);
 
   /**
@@ -2261,9 +2303,9 @@ namespace DoFTools
    * @see
    * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
    */
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  map_dof_to_boundary_indices(const DoFHandlerType &              dof_handler,
+  map_dof_to_boundary_indices(const DoFHandler<dim, spacedim> &   dof_handler,
                               const std::set<types::boundary_id> &boundary_ids,
                               std::vector<types::global_dof_index> &mapping);
 
@@ -2383,15 +2425,13 @@ namespace DoFTools
    * only the last value in the map returned by map_dofs_to_support_points() for
    * each point will be returned.
    */
-  template <typename DoFHandlerType, class Comp>
+  template <int dim, int spacedim, class Comp>
   void
   map_support_points_to_dofs(
-    const Mapping<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
-      &                   mapping,
-    const DoFHandlerType &dof_handler,
-    std::map<Point<DoFHandlerType::space_dimension>,
-             types::global_dof_index,
-             Comp> &      point_to_index_map);
+    const Mapping<dim, spacedim> &   mapping,
+    const DoFHandler<dim, spacedim> &dof_handler,
+    std::map<Point<spacedim>, types::global_dof_index, Comp>
+      &point_to_index_map);
   /**
    * @}
    */
@@ -2429,12 +2469,12 @@ namespace DoFTools
    * functions that are non-zero in more than one vector component (in deal.II
    * speak: they are non-primitive).
    */
-  template <typename DoFHandlerType, typename Number>
+  template <int dim, int spacedim, typename Number>
   void
-  distribute_cell_to_dof_vector(const DoFHandlerType &dof_handler,
-                                const Vector<Number> &cell_data,
-                                Vector<double> &      dof_data,
-                                const unsigned int    component = 0);
+  distribute_cell_to_dof_vector(const DoFHandler<dim, spacedim> &dof_handler,
+                                const Vector<Number> &           cell_data,
+                                Vector<double> &                 dof_data,
+                                const unsigned int               component = 0);
 
 
   /**
@@ -2560,16 +2600,13 @@ namespace DoFTools
    * @see
    * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
    */
-  template <int dim,
-            int spacedim,
-            template <int, int> class DoFHandlerType,
-            typename number>
+  template <int dim, int spacedim, typename number>
   void
   make_zero_boundary_constraints(
-    const DoFHandlerType<dim, spacedim> &dof,
-    const types::boundary_id             boundary_id,
-    AffineConstraints<number> &          zero_boundary_constraints,
-    const ComponentMask &                component_mask = ComponentMask());
+    const DoFHandler<dim, spacedim> &dof,
+    const types::boundary_id         boundary_id,
+    AffineConstraints<number> &      zero_boundary_constraints,
+    const ComponentMask &            component_mask = ComponentMask());
 
   /**
    * Do the same as the previous function, except do it for all parts of the
@@ -2581,15 +2618,12 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <int dim,
-            int spacedim,
-            template <int, int> class DoFHandlerType,
-            typename number>
+  template <int dim, int spacedim, typename number>
   void
   make_zero_boundary_constraints(
-    const DoFHandlerType<dim, spacedim> &dof,
-    AffineConstraints<number> &          zero_boundary_constraints,
-    const ComponentMask &                component_mask = ComponentMask());
+    const DoFHandler<dim, spacedim> &dof,
+    AffineConstraints<number> &      zero_boundary_constraints,
+    const ComponentMask &            component_mask = ComponentMask());
 
   /**
    * @}
@@ -2679,21 +2713,18 @@ namespace DoFTools
 
   // ---------------------- inline and template functions --------------------
 
-  template <typename DoFHandlerType, class Comp>
+  template <int dim, int spacedim, class Comp>
   void
   map_support_points_to_dofs(
-    const Mapping<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
-      &                   mapping,
-    const DoFHandlerType &dof_handler,
-    std::map<Point<DoFHandlerType::space_dimension>,
-             types::global_dof_index,
-             Comp> &      point_to_index_map)
+    const Mapping<dim, spacedim> &   mapping,
+    const DoFHandler<dim, spacedim> &dof_handler,
+    std::map<Point<spacedim>, types::global_dof_index, Comp>
+      &point_to_index_map)
   {
     // let the checking of arguments be
     // done by the function first
     // called
-    std::vector<Point<DoFHandlerType::space_dimension>> support_points(
-      dof_handler.n_dofs());
+    std::vector<Point<spacedim>> support_points(dof_handler.n_dofs());
     map_dofs_to_support_points(mapping, dof_handler, support_points);
     // now copy over the results of the
     // previous function into the
@@ -2702,6 +2733,50 @@ namespace DoFTools
     for (types::global_dof_index i = 0; i < dof_handler.n_dofs(); ++i)
       point_to_index_map[support_points[i]] = i;
   }
+
+
+
+  template <typename DoFHandlerType, typename number>
+  inline void
+  make_periodicity_constraints(
+    const std::vector<
+      GridTools::PeriodicFacePair<typename DoFHandlerType::cell_iterator>>
+      &                              periodic_faces,
+    AffineConstraints<number> &      constraints,
+    const ComponentMask &            component_mask,
+    const std::vector<unsigned int> &first_vector_components,
+    const number                     periodicity_factor)
+  {
+    make_periodicity_constraints<DoFHandlerType::dimension,
+                                 DoFHandlerType::space_dimension>(
+      periodic_faces,
+      constraints,
+      component_mask,
+      first_vector_components,
+      periodicity_factor);
+  }
+
+
+
+  template <typename DoFHandlerType>
+  inline std::vector<types::global_dof_index>
+  get_dofs_on_patch(
+    const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
+  {
+    return get_dofs_on_patch<DoFHandlerType::dimension,
+                             DoFHandlerType::space_dimension>(patch);
+  }
+
+
+
+  template <typename DoFHandlerType>
+  inline unsigned int
+  count_dofs_on_patch(
+    const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
+  {
+    return count_dofs_on_patch<DoFHandlerType::dimension,
+                               DoFHandlerType::space_dimension>(patch);
+  }
 } // namespace DoFTools
 
 #endif
index 05695a385c09dfafbeb6168802838457025f69d5..632236dcd18741a88f788286f8d2dbf8768292e5 100644 (file)
@@ -193,15 +193,14 @@ namespace DoFTools
     //   shape function
     // - otherwise, the shape function is assigned the first component selected
     //   in the component_mask that corresponds to this shape function
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     void
-    get_component_association(const DoFHandlerType &      dof,
-                              const ComponentMask &       component_mask,
+    get_component_association(const DoFHandler<dim, spacedim> &dof,
+                              const ComponentMask &            component_mask,
                               std::vector<unsigned char> &dofs_by_component)
     {
-      const dealii::hp::FECollection<DoFHandlerType::dimension,
-                                     DoFHandlerType::space_dimension>
-        &fe_collection = dof.get_fe_collection();
+      const dealii::hp::FECollection<dim, spacedim> &fe_collection =
+        dof.get_fe_collection();
       Assert(fe_collection.n_components() < 256, ExcNotImplemented());
       Assert(dofs_by_component.size() == dof.n_locally_owned_dofs(),
              ExcDimensionMismatch(dofs_by_component.size(),
@@ -218,9 +217,7 @@ namespace DoFTools
         fe_collection.size());
       for (unsigned int f = 0; f < fe_collection.size(); ++f)
         {
-          const FiniteElement<DoFHandlerType::dimension,
-                              DoFHandlerType::space_dimension> &fe =
-            fe_collection[f];
+          const FiniteElement<dim, spacedim> &fe = fe_collection[f];
           local_component_association[f] =
             get_local_component_association(fe, component_mask);
         }
@@ -249,14 +246,13 @@ namespace DoFTools
     // vector block. if the DoFHandler is based on a parallel distributed
     // triangulation then the output array is index by
     // dof.locally_owned_dofs().index_within_set(indices[i])
-    template <typename DoFHandlerType>
+    template <int dim, int spacedim>
     inline void
-    get_block_association(const DoFHandlerType &      dof,
-                          std::vector<unsigned char> &dofs_by_block)
+    get_block_association(const DoFHandler<dim, spacedim> &dof,
+                          std::vector<unsigned char> &     dofs_by_block)
     {
-      const dealii::hp::FECollection<DoFHandlerType::dimension,
-                                     DoFHandlerType::space_dimension>
-        &fe_collection = dof.get_fe_collection();
+      const dealii::hp::FECollection<dim, spacedim> &fe_collection =
+        dof.get_fe_collection();
       Assert(fe_collection.n_components() < 256, ExcNotImplemented());
       Assert(dofs_by_block.size() == dof.n_locally_owned_dofs(),
              ExcDimensionMismatch(dofs_by_block.size(),
@@ -273,9 +269,7 @@ namespace DoFTools
         fe_collection.size());
       for (unsigned int f = 0; f < fe_collection.size(); ++f)
         {
-          const FiniteElement<DoFHandlerType::dimension,
-                              DoFHandlerType::space_dimension> &fe =
-            fe_collection[f];
+          const FiniteElement<dim, spacedim> &fe = fe_collection[f];
           local_block_association[f].resize(fe.dofs_per_cell,
                                             static_cast<unsigned char>(-1));
           for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
@@ -307,15 +301,13 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename Number>
+  template <int dim, int spacedim, typename Number>
   void
-  distribute_cell_to_dof_vector(const DoFHandlerType &dof_handler,
-                                const Vector<Number> &cell_data,
-                                Vector<double> &      dof_data,
-                                const unsigned int    component)
+  distribute_cell_to_dof_vector(const DoFHandler<dim, spacedim> &dof_handler,
+                                const Vector<Number> &           cell_data,
+                                Vector<double> &                 dof_data,
+                                const unsigned int               component)
   {
-    const unsigned int dim                   = DoFHandlerType::dimension;
-    const unsigned int spacedim              = DoFHandlerType::space_dimension;
     const Triangulation<dim, spacedim> &tria = dof_handler.get_triangulation();
     (void)tria;
 
@@ -355,9 +347,9 @@ namespace DoFTools
     // count how often we have added a value in the sum for each dof
     std::vector<unsigned char> touch_count(dof_handler.n_dofs(), 0);
 
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     std::vector<types::global_dof_index> dof_indices;
     dof_indices.reserve(fe_collection.max_dofs_per_cell());
 
@@ -396,11 +388,11 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_dofs(const DoFHandlerType &dof,
-               const ComponentMask & component_mask,
-               std::vector<bool> &   selected_dofs)
+  extract_dofs(const DoFHandler<dim, spacedim> &dof,
+               const ComponentMask &            component_mask,
+               std::vector<bool> &              selected_dofs)
   {
     Assert(component_mask.represents_n_components(
              dof.get_fe_collection().n_components()),
@@ -443,9 +435,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  extract_dofs(const DoFHandlerType &dof, const ComponentMask &component_mask)
+  extract_dofs(const DoFHandler<dim, spacedim> &dof,
+               const ComponentMask &            component_mask)
   {
     Assert(component_mask.represents_n_components(
              dof.get_fe_collection().n_components()),
@@ -507,34 +500,35 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_dofs(const DoFHandlerType &dof,
-               const BlockMask &     block_mask,
-               std::vector<bool> &   selected_dofs)
+  extract_dofs(const DoFHandler<dim, spacedim> &dof,
+               const BlockMask &                block_mask,
+               std::vector<bool> &              selected_dofs)
   {
     // simply forward to the function that works based on a component mask
-    extract_dofs<DoFHandlerType>(
+    extract_dofs<dim, spacedim>(
       dof, dof.get_fe_collection().component_mask(block_mask), selected_dofs);
   }
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  extract_dofs(const DoFHandlerType &dof, const BlockMask &block_mask)
+  extract_dofs(const DoFHandler<dim, spacedim> &dof,
+               const BlockMask &                block_mask)
   {
     // simply forward to the function that works based on a component mask
-    return extract_dofs<DoFHandlerType>(
+    return extract_dofs<dim, spacedim>(
       dof, dof.get_fe_collection().component_mask(block_mask));
   }
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<IndexSet>
-  locally_owned_dofs_per_component(const DoFHandlerType &dof,
-                                   const ComponentMask & component_mask)
+  locally_owned_dofs_per_component(const DoFHandler<dim, spacedim> &dof,
+                                   const ComponentMask &component_mask)
   {
     const auto n_comps = dof.get_fe_collection().n_components();
     Assert(component_mask.represents_n_components(n_comps),
@@ -565,15 +559,14 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_level_dofs(const unsigned int    level,
-                     const DoFHandlerType &dof,
-                     const ComponentMask & component_mask,
-                     std::vector<bool> &   selected_dofs)
+  extract_level_dofs(const unsigned int               level,
+                     const DoFHandler<dim, spacedim> &dof,
+                     const ComponentMask &            component_mask,
+                     std::vector<bool> &              selected_dofs)
   {
-    const FiniteElement<DoFHandlerType::dimension,
-                        DoFHandlerType::space_dimension> &fe = dof.get_fe();
+    const FiniteElement<dim, spacedim> &fe = dof.get_fe();
 
     Assert(component_mask.represents_n_components(
              dof.get_fe_collection().n_components()),
@@ -611,8 +604,8 @@ namespace DoFTools
       local_selected_dofs[i] = component_mask[local_component_asssociation[i]];
 
     // then loop over all cells and do work
-    std::vector<types::global_dof_index>         indices(fe.dofs_per_cell);
-    typename DoFHandlerType::level_cell_iterator c;
+    std::vector<types::global_dof_index> indices(fe.dofs_per_cell);
+    typename DoFHandler<dim, spacedim>::level_cell_iterator c;
     for (c = dof.begin(level); c != dof.end(level); ++c)
       {
         c->get_mg_dof_indices(indices);
@@ -623,12 +616,12 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_level_dofs(const unsigned int    level,
-                     const DoFHandlerType &dof,
-                     const BlockMask &     block_mask,
-                     std::vector<bool> &   selected_dofs)
+  extract_level_dofs(const unsigned int               level,
+                     const DoFHandler<dim, spacedim> &dof,
+                     const BlockMask &                block_mask,
+                     std::vector<bool> &              selected_dofs)
   {
     // simply defer to the other extract_level_dofs() function
     extract_level_dofs(level,
@@ -639,16 +632,15 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_boundary_dofs(const DoFHandlerType &              dof_handler,
+  extract_boundary_dofs(const DoFHandler<dim, spacedim> &   dof_handler,
                         const ComponentMask &               component_mask,
                         std::vector<bool> &                 selected_dofs,
                         const std::set<types::boundary_id> &boundary_ids)
   {
-    Assert((dynamic_cast<const parallel::distributed::Triangulation<
-              DoFHandlerType::dimension,
-              DoFHandlerType::space_dimension> *>(
+    Assert((dynamic_cast<
+              const parallel::distributed::Triangulation<dim, spacedim> *>(
               &dof_handler.get_triangulation()) == nullptr),
            ExcMessage(
              "This function can not be used with distributed triangulations. "
@@ -666,9 +658,9 @@ namespace DoFTools
   }
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_boundary_dofs(const DoFHandlerType &              dof_handler,
+  extract_boundary_dofs(const DoFHandler<dim, spacedim> &   dof_handler,
                         const ComponentMask &               component_mask,
                         IndexSet &                          selected_dofs,
                         const std::set<types::boundary_id> &boundary_ids)
@@ -679,7 +671,6 @@ namespace DoFTools
     Assert(boundary_ids.find(numbers::internal_face_boundary_id) ==
              boundary_ids.end(),
            ExcInvalidBoundaryIndicator());
-    const unsigned int dim = DoFHandlerType::dimension;
 
     // first reset output argument
     selected_dofs.clear();
@@ -712,16 +703,13 @@ namespace DoFTools
       // only work on cells that are either locally owned or at least ghost
       // cells
       if (cell->is_artificial() == false)
-        for (const unsigned int face :
-             GeometryInfo<DoFHandlerType::dimension>::face_indices())
+        for (const unsigned int face : GeometryInfo<dim>::face_indices())
           if (cell->at_boundary(face))
             if (!check_boundary_id ||
                 (boundary_ids.find(cell->face(face)->boundary_id()) !=
                  boundary_ids.end()))
               {
-                const FiniteElement<DoFHandlerType::dimension,
-                                    DoFHandlerType::space_dimension> &fe =
-                  cell->get_fe();
+                const FiniteElement<dim, spacedim> &fe = cell->get_fe();
 
                 const unsigned int dofs_per_face = fe.dofs_per_face;
                 face_dof_indices.resize(dofs_per_face);
@@ -777,10 +765,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   extract_dofs_with_support_on_boundary(
-    const DoFHandlerType &              dof_handler,
+    const DoFHandler<dim, spacedim> &   dof_handler,
     const ComponentMask &               component_mask,
     std::vector<bool> &                 selected_dofs,
     const std::set<types::boundary_id> &boundary_ids)
@@ -815,16 +803,13 @@ namespace DoFTools
     // boundary line is also part of a boundary face which we will be
     // visiting sooner or later
     for (const auto &cell : dof_handler.active_cell_iterators())
-      for (const unsigned int face :
-           GeometryInfo<DoFHandlerType::dimension>::face_indices())
+      for (const unsigned int face : GeometryInfo<dim>::face_indices())
         if (cell->at_boundary(face))
           if (!check_boundary_id ||
               (boundary_ids.find(cell->face(face)->boundary_id()) !=
                boundary_ids.end()))
             {
-              const FiniteElement<DoFHandlerType::dimension,
-                                  DoFHandlerType::space_dimension> &fe =
-                cell->get_fe();
+              const FiniteElement<dim, spacedim> &fe = cell->get_fe();
 
               const unsigned int dofs_per_cell = fe.dofs_per_cell;
               cell_dof_indices.resize(dofs_per_cell);
@@ -862,20 +847,21 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   IndexSet
   extract_dofs_with_support_contained_within(
-    const DoFHandlerType &dof_handler,
+    const DoFHandler<dim, spacedim> &dof_handler,
     const std::function<
-      bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate,
-    const AffineConstraints<number> &                               cm)
+      bool(const typename DoFHandler<dim, spacedim>::active_cell_iterator &)>
+      &                              predicate,
+    const AffineConstraints<number> &cm)
   {
     const std::function<bool(
-      const typename DoFHandlerType::active_cell_iterator &)>
+      const typename DoFHandler<dim, spacedim>::active_cell_iterator &)>
       predicate_local =
-        [=](const typename DoFHandlerType::active_cell_iterator &cell) -> bool {
-      return cell->is_locally_owned() && predicate(cell);
-    };
+        [=](
+          const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell)
+      -> bool { return cell->is_locally_owned() && predicate(cell); };
 
     std::vector<types::global_dof_index> local_dof_indices;
     local_dof_indices.reserve(
@@ -884,9 +870,9 @@ namespace DoFTools
     // Get all the dofs that live on the subdomain:
     std::set<types::global_dof_index> predicate_dofs;
 
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       if (!cell->is_artificial() && predicate(cell))
         {
@@ -899,11 +885,11 @@ namespace DoFTools
     // Get halo layer and accumulate its DoFs
     std::set<types::global_dof_index> dofs_with_support_on_halo_cells;
 
-    const std::vector<typename DoFHandlerType::active_cell_iterator>
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
       halo_cells =
         GridTools::compute_active_cell_halo_layer(dof_handler, predicate_local);
-    for (typename std::vector<
-           typename DoFHandlerType::active_cell_iterator>::const_iterator it =
+    for (typename std::vector<typename DoFHandler<dim, spacedim>::
+                                active_cell_iterator>::const_iterator it =
            halo_cells.begin();
          it != halo_cells.end();
          ++it)
@@ -1075,10 +1061,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_hanging_node_dofs(const DoFHandlerType &dof_handler,
-                            std::vector<bool> &   selected_dofs)
+  extract_hanging_node_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                            std::vector<bool> &              selected_dofs)
   {
     const IndexSet selected_dofs_as_index_set =
       extract_hanging_node_dofs(dof_handler);
@@ -1092,20 +1078,20 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  extract_hanging_node_dofs(const DoFHandlerType &dof_handler)
+  extract_hanging_node_dofs(const DoFHandler<dim, spacedim> &dof_handler)
   {
     return internal::extract_hanging_node_dofs(dof_handler);
   }
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_subdomain_dofs(const DoFHandlerType &    dof_handler,
-                         const types::subdomain_id subdomain_id,
-                         std::vector<bool> &       selected_dofs)
+  extract_subdomain_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                         const types::subdomain_id        subdomain_id,
+                         std::vector<bool> &              selected_dofs)
   {
     Assert(selected_dofs.size() == dof_handler.n_dofs(),
            ExcDimensionMismatch(selected_dofs.size(), dof_handler.n_dofs()));
@@ -1119,9 +1105,9 @@ namespace DoFTools
 
     // this function is similar to the make_sparsity_pattern function, see
     // there for more information
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       if (cell->subdomain_id() == subdomain_id)
         {
@@ -1135,10 +1121,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_locally_active_dofs(const DoFHandlerType &dof_handler,
-                              IndexSet &            dof_set)
+  extract_locally_active_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                              IndexSet &                       dof_set)
   {
     // collect all the locally owned dofs
     dof_set = dof_handler.locally_owned_dofs();
@@ -1149,9 +1135,9 @@ namespace DoFTools
     std::vector<types::global_dof_index> dof_indices;
     std::set<types::global_dof_index>    global_dof_indices;
 
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       if (cell->is_locally_owned())
         {
@@ -1170,10 +1156,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_locally_relevant_dofs(const DoFHandlerType &dof_handler,
-                                IndexSet &            dof_set)
+  extract_locally_relevant_dofs(const DoFHandler<dim, spacedim> &dof_handler,
+                                IndexSet &                       dof_set)
   {
     // collect all the locally owned dofs
     dof_set = dof_handler.locally_owned_dofs();
@@ -1189,9 +1175,9 @@ namespace DoFTools
     std::vector<types::global_dof_index> dof_indices;
     std::vector<types::global_dof_index> dofs_on_ghosts;
 
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       if (cell->is_ghost())
         {
@@ -1212,11 +1198,12 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_locally_relevant_level_dofs(const DoFHandlerType &dof_handler,
-                                      const unsigned int    level,
-                                      IndexSet &            dof_set)
+  extract_locally_relevant_level_dofs(
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const unsigned int               level,
+    IndexSet &                       dof_set)
   {
     // collect all the locally owned dofs
     dof_set = dof_handler.locally_owned_mg_dofs(level);
@@ -1232,8 +1219,10 @@ namespace DoFTools
     std::vector<types::global_dof_index> dof_indices;
     std::vector<types::global_dof_index> dofs_on_ghosts;
 
-    typename DoFHandlerType::cell_iterator cell = dof_handler.begin(level),
-                                           endc = dof_handler.end(level);
+    typename DoFHandler<dim, spacedim>::cell_iterator cell = dof_handler.begin(
+                                                        level),
+                                                      endc =
+                                                        dof_handler.end(level);
     for (; cell != endc; ++cell)
       {
         const types::subdomain_id id = cell->level_subdomain_id();
@@ -1261,11 +1250,11 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  extract_constant_modes(const DoFHandlerType &          dof_handler,
-                         const ComponentMask &           component_mask,
-                         std::vector<std::vector<bool>> &constant_modes)
+  extract_constant_modes(const DoFHandler<dim, spacedim> &dof_handler,
+                         const ComponentMask &            component_mask,
+                         std::vector<std::vector<bool>> & constant_modes)
   {
     // If there are no locally owned DoFs, return with an empty
     // constant_modes object:
@@ -1304,9 +1293,8 @@ namespace DoFTools
     //
     // TODO: We might be able to extend this also for elements which do not
     // have the same constant modes, but that is messy...
-    const dealii::hp::FECollection<DoFHandlerType::dimension,
-                                   DoFHandlerType::space_dimension>
-      &                         fe_collection = dof_handler.get_fe_collection();
+    const dealii::hp::FECollection<dim, spacedim> &fe_collection =
+      dof_handler.get_fe_collection();
     std::vector<Table<2, bool>> element_constant_modes;
     std::vector<std::vector<std::pair<unsigned int, unsigned int>>>
                  constant_mode_to_component_translation(n_components);
@@ -1357,33 +1345,32 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  get_active_fe_indices(const DoFHandlerType &     dof_handler,
-                        std::vector<unsigned int> &active_fe_indices)
+  get_active_fe_indices(const DoFHandler<dim, spacedim> &dof_handler,
+                        std::vector<unsigned int> &      active_fe_indices)
   {
     AssertDimension(active_fe_indices.size(),
                     dof_handler.get_triangulation().n_active_cells());
 
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       active_fe_indices[cell->active_cell_index()] = cell->active_fe_index();
   }
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<IndexSet>
-  locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler)
+  locally_owned_dofs_per_subdomain(const DoFHandler<dim, spacedim> &dof_handler)
   {
     Assert(dof_handler.n_dofs() > 0,
            ExcMessage("The given DoFHandler has no DoFs."));
 
     // If the Triangulation is distributed, the only thing we can usefully
     // ask is for its locally owned subdomain
-    Assert((dynamic_cast<const parallel::distributed::Triangulation<
-              DoFHandlerType::dimension,
-              DoFHandlerType::space_dimension> *>(
+    Assert((dynamic_cast<
+              const parallel::distributed::Triangulation<dim, spacedim> *>(
               &dof_handler.get_triangulation()) == nullptr),
            ExcMessage(
              "For parallel::distributed::Triangulation objects and "
@@ -1411,9 +1398,7 @@ namespace DoFTools
     // collect information for each subdomain index anyway, not just for the
     // used one.)
     const unsigned int n_subdomains =
-      (dynamic_cast<const parallel::TriangulationBase<
-             DoFHandlerType::dimension,
-             DoFHandlerType::space_dimension> *>(
+      (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
          &dof_handler.get_triangulation()) == nullptr ?
          [&dof_handler]() {
            unsigned int max_subdomain_id = 0;
@@ -1423,9 +1408,7 @@ namespace DoFTools
            return max_subdomain_id + 1;
          }() :
          Utilities::MPI::n_mpi_processes(
-           dynamic_cast<const parallel::TriangulationBase<
-             DoFHandlerType::dimension,
-             DoFHandlerType::space_dimension> *>(
+           dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
              &dof_handler.get_triangulation())
              ->get_communicator()));
     Assert(n_subdomains > *std::max_element(subdomain_association.begin(),
@@ -1472,15 +1455,15 @@ namespace DoFTools
     return index_sets;
   }
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<IndexSet>
-  locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler)
+  locally_relevant_dofs_per_subdomain(
+    const DoFHandler<dim, spacedim> &dof_handler)
   {
     // If the Triangulation is distributed, the only thing we can usefully
     // ask is for its locally owned subdomain
-    Assert((dynamic_cast<const parallel::distributed::Triangulation<
-              DoFHandlerType::dimension,
-              DoFHandlerType::space_dimension> *>(
+    Assert((dynamic_cast<
+              const parallel::distributed::Triangulation<dim, spacedim> *>(
               &dof_handler.get_triangulation()) == nullptr),
            ExcMessage(
              "For parallel::distributed::Triangulation objects and "
@@ -1507,9 +1490,10 @@ namespace DoFTools
       {
         // Extract the layer of cells around this subdomain
         std::function<bool(
-          const typename DoFHandlerType::active_cell_iterator &)>
+          const typename DoFHandler<dim, spacedim>::active_cell_iterator &)>
           predicate = IteratorFilters::SubdomainEqualTo(subdomain_id);
-        const std::vector<typename DoFHandlerType::active_cell_iterator>
+        const std::vector<
+          typename DoFHandler<dim, spacedim>::active_cell_iterator>
           active_halo_layer =
             GridTools::compute_active_cell_halo_layer(dof_handler, predicate);
 
@@ -1517,13 +1501,13 @@ namespace DoFTools
         std::vector<types::global_dof_index> local_dof_indices;
         std::set<types::global_dof_index>    subdomain_halo_global_dof_indices;
         for (typename std::vector<
-               typename DoFHandlerType::active_cell_iterator>::const_iterator
-               it_cell = active_halo_layer.begin();
+               typename DoFHandler<dim, spacedim>::active_cell_iterator>::
+               const_iterator it_cell = active_halo_layer.begin();
              it_cell != active_halo_layer.end();
              ++it_cell)
           {
-            const typename DoFHandlerType::active_cell_iterator &cell =
-              *it_cell;
+            const typename DoFHandler<dim, spacedim>::active_cell_iterator
+              &cell = *it_cell;
             Assert(
               cell->subdomain_id() != subdomain_id,
               ExcMessage(
@@ -1547,17 +1531,16 @@ namespace DoFTools
     return dof_set;
   }
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   get_subdomain_association(
-    const DoFHandlerType &            dof_handler,
+    const DoFHandler<dim, spacedim> & dof_handler,
     std::vector<types::subdomain_id> &subdomain_association)
   {
     // if the Triangulation is distributed, the only thing we can usefully
     // ask is for its locally owned subdomain
-    Assert((dynamic_cast<const parallel::distributed::Triangulation<
-              DoFHandlerType::dimension,
-              DoFHandlerType::space_dimension> *>(
+    Assert((dynamic_cast<
+              const parallel::distributed::Triangulation<dim, spacedim> *>(
               &dof_handler.get_triangulation()) == nullptr),
            ExcMessage(
              "For parallel::distributed::Triangulation objects and "
@@ -1580,11 +1563,8 @@ namespace DoFTools
     // subdomain_id as stored in cell->subdomain_id().
     std::vector<types::subdomain_id> cell_owners(
       dof_handler.get_triangulation().n_active_cells());
-    if (const parallel::shared::Triangulation<DoFHandlerType::dimension,
-                                              DoFHandlerType::space_dimension>
-          *tr = (dynamic_cast<const parallel::shared::Triangulation<
-                   DoFHandlerType::dimension,
-                   DoFHandlerType::space_dimension> *>(
+    if (const parallel::shared::Triangulation<dim, spacedim> *tr =
+          (dynamic_cast<const parallel::shared::Triangulation<dim, spacedim> *>(
             &dof_handler.get_triangulation())))
       {
         cell_owners = tr->get_true_subdomain_ids_of_cells();
@@ -1594,7 +1574,7 @@ namespace DoFTools
       }
     else
       {
-        for (typename DoFHandlerType::active_cell_iterator cell =
+        for (typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
                dof_handler.begin_active();
              cell != dof_handler.end();
              cell++)
@@ -1613,9 +1593,9 @@ namespace DoFTools
 
     // loop over all cells and record which subdomain a DoF belongs to.
     // give to the smaller subdomain_id in case it is on an interface
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       {
         const types::subdomain_id subdomain_id =
@@ -1647,10 +1627,11 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   unsigned int
-  count_dofs_with_subdomain_association(const DoFHandlerType &    dof_handler,
-                                        const types::subdomain_id subdomain)
+  count_dofs_with_subdomain_association(
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::subdomain_id        subdomain)
   {
     std::vector<types::subdomain_id> subdomain_association(
       dof_handler.n_dofs());
@@ -1663,10 +1644,11 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   IndexSet
-  dof_indices_with_subdomain_association(const DoFHandlerType &    dof_handler,
-                                         const types::subdomain_id subdomain)
+  dof_indices_with_subdomain_association(
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::subdomain_id        subdomain)
   {
     // If we have a distributed::Triangulation only allow locally_owned
     // subdomain.
@@ -1692,9 +1674,9 @@ namespace DoFTools
     // more expensive than a vector
     std::vector<types::global_dof_index> subdomain_indices;
 
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
       if ((cell->is_artificial() == false) &&
           (cell->subdomain_id() == subdomain))
@@ -1721,12 +1703,12 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   count_dofs_with_subdomain_association(
-    const DoFHandlerType &     dof_handler,
-    const types::subdomain_id  subdomain,
-    std::vector<unsigned int> &n_dofs_on_subdomain)
+    const DoFHandler<dim, spacedim> &dof_handler,
+    const types::subdomain_id        subdomain,
+    std::vector<unsigned int> &      n_dofs_on_subdomain)
   {
     Assert(n_dofs_on_subdomain.size() == dof_handler.get_fe(0).n_components(),
            ExcDimensionMismatch(n_dofs_on_subdomain.size(),
@@ -1736,8 +1718,10 @@ namespace DoFTools
     // Make sure there are at least some cells with this subdomain id
     Assert(std::any_of(
              dof_handler.begin_active(),
-             typename DoFHandlerType::active_cell_iterator{dof_handler.end()},
-             [subdomain](const typename DoFHandlerType::cell_accessor &cell) {
+             typename DoFHandler<dim, spacedim>::active_cell_iterator{
+               dof_handler.end()},
+             [subdomain](
+               const typename DoFHandler<dim, spacedim>::cell_accessor &cell) {
                return cell.subdomain_id() == subdomain;
              }),
            ExcMessage("There are no cells for the given subdomain!"));
@@ -1891,10 +1875,10 @@ namespace DoFTools
 
 
   // deprecated function
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
   count_dofs_per_component(
-    const DoFHandlerType &                dof_handler,
+    const DoFHandler<dim, spacedim> &     dof_handler,
     std::vector<types::global_dof_index> &dofs_per_component,
     const bool                            only_once,
     const std::vector<unsigned int> &     target_component)
@@ -1905,10 +1889,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<types::global_dof_index>
   count_dofs_per_fe_component(
-    const DoFHandlerType &           dof_handler,
+    const DoFHandler<dim, spacedim> &dof_handler,
     const bool                       only_once,
     const std::vector<unsigned int> &target_component_)
   {
@@ -1974,8 +1958,6 @@ namespace DoFTools
 
     // reduce information from all CPUs
 #ifdef DEAL_II_WITH_MPI
-    const unsigned int dim      = DoFHandlerType::dimension;
-    const unsigned int spacedim = DoFHandlerType::space_dimension;
 
     if (const parallel::TriangulationBase<dim, spacedim> *tria =
           (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
@@ -2000,9 +1982,9 @@ namespace DoFTools
 
 
   // deprecated function
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  count_dofs_per_block(const DoFHandlerType &                dof_handler,
+  count_dofs_per_block(const DoFHandler<dim, spacedim> &     dof_handler,
                        std::vector<types::global_dof_index> &dofs_per_block,
                        const std::vector<unsigned int> &     target_block)
   {
@@ -2011,14 +1993,13 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<types::global_dof_index>
-  count_dofs_per_fe_block(const DoFHandlerType &           dof_handler,
+  count_dofs_per_fe_block(const DoFHandler<dim, spacedim> &dof_handler,
                           const std::vector<unsigned int> &target_block_)
   {
-    const dealii::hp::FECollection<DoFHandlerType::dimension,
-                                   DoFHandlerType::space_dimension>
-      &fe_collection = dof_handler.get_fe_collection();
+    const dealii::hp::FECollection<dim, spacedim> &fe_collection =
+      dof_handler.get_fe_collection();
     Assert(fe_collection.size() < 256, ExcNotImplemented());
 
     // If the empty vector for target_block(e.g., as default argument), then
@@ -2065,9 +2046,7 @@ namespace DoFTools
          this_fe < fe_collection.size();
          ++this_fe)
       {
-        const FiniteElement<DoFHandlerType::dimension,
-                            DoFHandlerType::space_dimension> &fe =
-          fe_collection[this_fe];
+        const FiniteElement<dim, spacedim> &fe = fe_collection[this_fe];
 
         std::vector<unsigned char> dofs_by_block(
           dof_handler.n_locally_owned_dofs());
@@ -2081,11 +2060,8 @@ namespace DoFTools
 #ifdef DEAL_II_WITH_MPI
         // if we are working on a parallel mesh, we now need to collect
         // this information from all processors
-        if (const parallel::TriangulationBase<DoFHandlerType::dimension,
-                                              DoFHandlerType::space_dimension>
-              *tria = (dynamic_cast<const parallel::TriangulationBase<
-                         DoFHandlerType::dimension,
-                         DoFHandlerType::space_dimension> *>(
+        if (const parallel::TriangulationBase<dim, spacedim> *tria =
+              (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
                 &dof_handler.get_triangulation())))
           {
             std::vector<types::global_dof_index> local_dof_count =
@@ -2106,9 +2082,9 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  map_dof_to_boundary_indices(const DoFHandlerType &                dof_handler,
+  map_dof_to_boundary_indices(const DoFHandler<dim, spacedim> &     dof_handler,
                               std::vector<types::global_dof_index> &mapping)
   {
     mapping.clear();
@@ -2126,12 +2102,11 @@ namespace DoFTools
     // do not support boundaries of dimension dim-2, and so every isolated
     // boundary line is also part of a boundary face which we will be
     // visiting sooner or later
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
-      for (const unsigned int f :
-           GeometryInfo<DoFHandlerType::dimension>::face_indices())
+      for (const unsigned int f : GeometryInfo<dim>::face_indices())
         if (cell->at_boundary(f))
           {
             const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
@@ -2148,9 +2123,9 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  map_dof_to_boundary_indices(const DoFHandlerType &              dof_handler,
+  map_dof_to_boundary_indices(const DoFHandler<dim, spacedim> &   dof_handler,
                               const std::set<types::boundary_id> &boundary_ids,
                               std::vector<types::global_dof_index> &mapping)
   {
@@ -2171,12 +2146,11 @@ namespace DoFTools
     dofs_on_face.reserve(dof_handler.get_fe_collection().max_dofs_per_face());
     types::global_dof_index next_boundary_index = 0;
 
-    typename DoFHandlerType::active_cell_iterator cell =
-                                                    dof_handler.begin_active(),
-                                                  endc = dof_handler.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
     for (; cell != endc; ++cell)
-      for (const unsigned int f :
-           GeometryInfo<DoFHandlerType::dimension>::face_indices())
+      for (const unsigned int f : GeometryInfo<dim>::face_indices())
         if (boundary_ids.find(cell->face(f)->boundary_id()) !=
             boundary_ids.end())
           {
@@ -2197,19 +2171,14 @@ namespace DoFTools
   {
     namespace
     {
-      template <typename DoFHandlerType>
+      template <int dim, int spacedim>
       void
       map_dofs_to_support_points(
-        const hp::MappingCollection<DoFHandlerType::dimension,
-                                    DoFHandlerType::space_dimension> &mapping,
-        const DoFHandlerType &                            dof_handler,
-        std::map<types::global_dof_index,
-                 Point<DoFHandlerType::space_dimension>> &support_points,
-        const ComponentMask &                             in_mask)
+        const hp::MappingCollection<dim, spacedim> &        mapping,
+        const DoFHandler<dim, spacedim> &                   dof_handler,
+        std::map<types::global_dof_index, Point<spacedim>> &support_points,
+        const ComponentMask &                               in_mask)
       {
-        const unsigned int dim      = DoFHandlerType::dimension;
-        const unsigned int spacedim = DoFHandlerType::space_dimension;
-
         const hp::FECollection<dim, spacedim> &fe_collection =
           dof_handler.get_fe_collection();
         hp::QCollection<dim> q_coll_dummy;
@@ -2237,13 +2206,13 @@ namespace DoFTools
         //
         // The weights of the quadrature rule have been set to invalid
         // values by the used constructor.
-        hp::FEValues<dim, spacedim>                   hp_fe_values(mapping,
+        hp::FEValues<dim, spacedim> hp_fe_values(mapping,
                                                  fe_collection,
                                                  q_coll_dummy,
                                                  update_quadrature_points);
-        typename DoFHandlerType::active_cell_iterator cell = dof_handler
-                                                               .begin_active(),
-                                                      endc = dof_handler.end();
+        typename DoFHandler<dim, spacedim>::active_cell_iterator
+          cell = dof_handler.begin_active(),
+          endc = dof_handler.end();
 
         std::vector<types::global_dof_index> local_dof_indices;
         for (; cell != endc; ++cell)
@@ -2272,19 +2241,16 @@ namespace DoFTools
       }
 
 
-      template <typename DoFHandlerType>
+      template <int dim, int spacedim>
       void
       map_dofs_to_support_points(
-        const hp::MappingCollection<DoFHandlerType::dimension,
-                                    DoFHandlerType::space_dimension> &mapping,
-        const DoFHandlerType &                               dof_handler,
-        std::vector<Point<DoFHandlerType::space_dimension>> &support_points,
-        const ComponentMask &                                mask)
+        const hp::MappingCollection<dim, spacedim> &mapping,
+        const DoFHandler<dim, spacedim> &           dof_handler,
+        std::vector<Point<spacedim>> &              support_points,
+        const ComponentMask &                       mask)
       {
         // get the data in the form of the map as above
-        std::map<types::global_dof_index,
-                 Point<DoFHandlerType::space_dimension>>
-          x_support_points;
+        std::map<types::global_dof_index, Point<spacedim>> x_support_points;
         map_dofs_to_support_points(mapping,
                                    dof_handler,
                                    x_support_points,
@@ -2538,17 +2504,18 @@ namespace DoFTools
   }
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  make_single_patch(SparsityPattern &     block_list,
-                    const DoFHandlerType &dof_handler,
-                    const unsigned int    level,
-                    const bool            interior_only)
+  make_single_patch(SparsityPattern &                block_list,
+                    const DoFHandler<dim, spacedim> &dof_handler,
+                    const unsigned int               level,
+                    const bool                       interior_only)
   {
-    const FiniteElement<DoFHandlerType::dimension> &fe = dof_handler.get_fe();
+    const FiniteElement<dim> &fe = dof_handler.get_fe();
     block_list.reinit(1, dof_handler.n_dofs(level), dof_handler.n_dofs(level));
-    typename DoFHandlerType::level_cell_iterator cell;
-    typename DoFHandlerType::level_cell_iterator endc = dof_handler.end(level);
+    typename DoFHandler<dim, spacedim>::level_cell_iterator cell;
+    typename DoFHandler<dim, spacedim>::level_cell_iterator endc =
+      dof_handler.end(level);
 
     std::vector<types::global_dof_index> indices;
     std::vector<bool>                    exclude;
@@ -2565,8 +2532,7 @@ namespace DoFTools
             std::fill(exclude.begin(), exclude.end(), false);
             const unsigned int dpf = fe.dofs_per_face;
 
-            for (const unsigned int face :
-                 GeometryInfo<DoFHandlerType::dimension>::face_indices())
+            for (const unsigned int face : GeometryInfo<dim>::face_indices())
               if (cell->at_boundary(face) ||
                   cell->neighbor(face)->level() != cell->level())
                 for (unsigned int i = 0; i < dpf; ++i)
@@ -2584,20 +2550,20 @@ namespace DoFTools
   }
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   void
-  make_child_patches(SparsityPattern &     block_list,
-                     const DoFHandlerType &dof_handler,
-                     const unsigned int    level,
-                     const bool            interior_dofs_only,
-                     const bool            boundary_dofs)
+  make_child_patches(SparsityPattern &                block_list,
+                     const DoFHandler<dim, spacedim> &dof_handler,
+                     const unsigned int               level,
+                     const bool                       interior_dofs_only,
+                     const bool                       boundary_dofs)
   {
     Assert(level > 0 && level < dof_handler.get_triangulation().n_levels(),
            ExcIndexRange(level, 1, dof_handler.get_triangulation().n_levels()));
 
-    typename DoFHandlerType::level_cell_iterator pcell =
+    typename DoFHandler<dim, spacedim>::level_cell_iterator pcell =
       dof_handler.begin(level - 1);
-    typename DoFHandlerType::level_cell_iterator endc =
+    typename DoFHandler<dim, spacedim>::level_cell_iterator endc =
       dof_handler.end(level - 1);
 
     std::vector<types::global_dof_index> indices;
@@ -2610,13 +2576,12 @@ namespace DoFTools
 
         for (unsigned int child = 0; child < pcell->n_children(); ++child)
           {
-            const typename DoFHandlerType::level_cell_iterator cell =
+            const typename DoFHandler<dim, spacedim>::level_cell_iterator cell =
               pcell->child(child);
 
             // For hp, only this line here would have to be replaced.
-            const FiniteElement<DoFHandlerType::dimension> &fe =
-              dof_handler.get_fe();
-            const unsigned int n_dofs = fe.dofs_per_cell;
+            const FiniteElement<dim> &fe     = dof_handler.get_fe();
+            const unsigned int        n_dofs = fe.dofs_per_cell;
             indices.resize(n_dofs);
             exclude.resize(n_dofs);
             std::fill(exclude.begin(), exclude.end(), false);
@@ -2628,10 +2593,10 @@ namespace DoFTools
                 // of the parent
                 const unsigned int dpf = fe.dofs_per_face;
 
-                for (unsigned int d = 0; d < DoFHandlerType::dimension; ++d)
+                for (unsigned int d = 0; d < dim; ++d)
                   {
-                    const unsigned int face = GeometryInfo<
-                      DoFHandlerType::dimension>::vertex_to_face[child][d];
+                    const unsigned int face =
+                      GeometryInfo<dim>::vertex_to_face[child][d];
                     for (unsigned int i = 0; i < dpf; ++i)
                       exclude[fe.face_to_cell_index(i, face)] = true;
                   }
@@ -2640,7 +2605,7 @@ namespace DoFTools
                 // from the exclusion list
                 if (boundary_dofs)
                   for (const unsigned int face :
-                       GeometryInfo<DoFHandlerType::dimension>::face_indices())
+                       GeometryInfo<dim>::face_indices())
                     if (cell->at_boundary(face))
                       for (unsigned int i = 0; i < dpf; ++i)
                         exclude[fe.face_to_cell_index(i, face)] = false;
@@ -2654,16 +2619,16 @@ namespace DoFTools
       }
   }
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<unsigned int>
-  make_vertex_patches(SparsityPattern &     block_list,
-                      const DoFHandlerType &dof_handler,
-                      const unsigned int    level,
-                      const bool            interior_only,
-                      const bool            boundary_patches,
-                      const bool            level_boundary_patches,
-                      const bool            single_cell_patches,
-                      const bool            invert_vertex_mapping)
+  make_vertex_patches(SparsityPattern &                block_list,
+                      const DoFHandler<dim, spacedim> &dof_handler,
+                      const unsigned int               level,
+                      const bool                       interior_only,
+                      const bool                       boundary_patches,
+                      const bool                       level_boundary_patches,
+                      const bool                       single_cell_patches,
+                      const bool                       invert_vertex_mapping)
   {
     const unsigned int n_blocks     = dof_handler.get_fe().n_blocks();
     BlockMask exclude_boundary_dofs = BlockMask(n_blocks, interior_only);
@@ -2677,19 +2642,20 @@ namespace DoFTools
                                invert_vertex_mapping);
   }
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<unsigned int>
-  make_vertex_patches(SparsityPattern &     block_list,
-                      const DoFHandlerType &dof_handler,
-                      const unsigned int    level,
-                      const BlockMask &     exclude_boundary_dofs,
-                      const bool            boundary_patches,
-                      const bool            level_boundary_patches,
-                      const bool            single_cell_patches,
-                      const bool            invert_vertex_mapping)
+  make_vertex_patches(SparsityPattern &                block_list,
+                      const DoFHandler<dim, spacedim> &dof_handler,
+                      const unsigned int               level,
+                      const BlockMask &                exclude_boundary_dofs,
+                      const bool                       boundary_patches,
+                      const bool                       level_boundary_patches,
+                      const bool                       single_cell_patches,
+                      const bool                       invert_vertex_mapping)
   {
-    typename DoFHandlerType::level_cell_iterator cell;
-    typename DoFHandlerType::level_cell_iterator endc = dof_handler.end(level);
+    typename DoFHandler<dim, spacedim>::level_cell_iterator cell;
+    typename DoFHandler<dim, spacedim>::level_cell_iterator endc =
+      dof_handler.end(level);
 
     // Vector mapping from vertex index in the triangulation to consecutive
     // block indices on this level The number of cells at a vertex
@@ -2711,16 +2677,14 @@ namespace DoFTools
     // Identify all vertices active on this level and remember some data
     // about them
     for (cell = dof_handler.begin(level); cell != endc; ++cell)
-      for (const unsigned int v :
-           GeometryInfo<DoFHandlerType::dimension>::vertex_indices())
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         {
           const unsigned int vg = cell->vertex_index(v);
           vertex_dof_count[vg] += cell->get_fe().dofs_per_cell;
           ++vertex_cell_count[vg];
-          for (unsigned int d = 0; d < DoFHandlerType::dimension; ++d)
+          for (unsigned int d = 0; d < dim; ++d)
             {
-              const unsigned int face =
-                GeometryInfo<DoFHandlerType::dimension>::vertex_to_face[v][d];
+              const unsigned int face = GeometryInfo<dim>::vertex_to_face[v][d];
               if (cell->at_boundary(face))
                 vertex_boundary[vg] = true;
               else if ((!level_boundary_patches) &&
@@ -2763,12 +2727,11 @@ namespace DoFTools
 
     for (cell = dof_handler.begin(level); cell != endc; ++cell)
       {
-        const FiniteElement<DoFHandlerType::dimension> &fe = cell->get_fe();
+        const FiniteElement<dim> &fe = cell->get_fe();
         indices.resize(fe.dofs_per_cell);
         cell->get_mg_dof_indices(indices);
 
-        for (const unsigned int v :
-             GeometryInfo<DoFHandlerType::dimension>::vertex_indices())
+        for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
           {
             const unsigned int vg    = cell->vertex_index(v);
             const unsigned int block = vertex_mapping[vg];
@@ -2786,12 +2749,12 @@ namespace DoFTools
                 std::fill(exclude.begin(), exclude.end(), false);
                 const unsigned int dpf = fe.dofs_per_face;
 
-                for (unsigned int d = 0; d < DoFHandlerType::dimension; ++d)
+                for (unsigned int d = 0; d < dim; ++d)
                   {
-                    const unsigned int a_face = GeometryInfo<
-                      DoFHandlerType::dimension>::vertex_to_face[v][d];
-                    const unsigned int face = GeometryInfo<
-                      DoFHandlerType::dimension>::opposite_face[a_face];
+                    const unsigned int a_face =
+                      GeometryInfo<dim>::vertex_to_face[v][d];
+                    const unsigned int face =
+                      GeometryInfo<dim>::opposite_face[a_face];
                     for (unsigned int i = 0; i < dpf; ++i)
                       {
                         // For each dof, get the block it is in and decide to
@@ -2831,10 +2794,11 @@ namespace DoFTools
   }
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   unsigned int
   count_dofs_on_patch(
-    const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+      &patch)
   {
     std::set<types::global_dof_index>    dofs_on_patch;
     std::vector<types::global_dof_index> local_dof_indices;
@@ -2844,7 +2808,8 @@ namespace DoFTools
     // all duplicates are ignored
     for (unsigned int i = 0; i < patch.size(); ++i)
       {
-        const typename DoFHandlerType::active_cell_iterator cell = patch[i];
+        const typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+          patch[i];
         Assert(cell->is_artificial() == false,
                ExcMessage("This function can not be called with cells that are "
                           "not either locally owned or ghost cells."));
@@ -2860,10 +2825,11 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <int dim, int spacedim>
   std::vector<types::global_dof_index>
   get_dofs_on_patch(
-    const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
+    const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+      &patch)
   {
     std::set<types::global_dof_index>    dofs_on_patch;
     std::vector<types::global_dof_index> local_dof_indices;
@@ -2873,7 +2839,8 @@ namespace DoFTools
     // all duplicates are ignored
     for (unsigned int i = 0; i < patch.size(); ++i)
       {
-        const typename DoFHandlerType::active_cell_iterator cell = patch[i];
+        const typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+          patch[i];
         Assert(cell->is_artificial() == false,
                ExcMessage("This function can not be called with cells that are "
                           "not either locally owned or ghost cells."));
@@ -2883,7 +2850,7 @@ namespace DoFTools
                              local_dof_indices.end());
       }
 
-    Assert(dofs_on_patch.size() == count_dofs_on_patch<DoFHandlerType>(patch),
+    Assert((dofs_on_patch.size() == count_dofs_on_patch<dim, spacedim>(patch)),
            ExcInternalError());
 
     // return a vector with the content of the set above. copying
index eb588ed02dbad28c2a36e8203d2e53acc9909630..49ec698e40bf79397873ca6c2cdf5b2e12cbdea3 100644 (file)
 // ---------------------------------------------------------------------
 
 
-for (DoFHandler : DOFHANDLER_TEMPLATES;
-     deal_II_dimension, deal_II_space_dimension : DIMENSIONS)
+for (deal_II_dimension, deal_II_space_dimension : DIMENSIONS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
     namespace DoFTools
     \{
       template void
-      extract_locally_relevant_dofs<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_locally_relevant_dofs<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension>
           &       dof_handler,
         IndexSet &dof_set);
 
       template void
-      extract_locally_relevant_level_dofs<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_locally_relevant_level_dofs<deal_II_dimension,
+                                          deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension>
           &                dof_handler,
         const unsigned int level,
         IndexSet &         dof_set);
 
       template void
-      extract_locally_active_dofs<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_locally_active_dofs<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension>
           &       dof_handler,
         IndexSet &dof_set);
 
       template std::vector<IndexSet>
-      locally_owned_dofs_per_component<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      locally_owned_dofs_per_component<deal_II_dimension,
+                                       deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension>
           &                  dof_handler,
         const ComponentMask &components);
 
       // deprecated versions of the count_dofs_per_*() functions
       template void
-      count_dofs_per_component<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      count_dofs_per_component<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         std::vector<types::global_dof_index> &,
         const bool,
         const std::vector<unsigned int> &);
 
       template void
-      count_dofs_per_block<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      count_dofs_per_block<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         std::vector<types::global_dof_index> &,
         const std::vector<unsigned int> &);
 
       // new versions of the count_dofs_per_*() functions
       template std::vector<types::global_dof_index>
-      count_dofs_per_fe_component<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      count_dofs_per_fe_component<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const bool,
         const std::vector<unsigned int> &);
 
       template std::vector<types::global_dof_index>
-      count_dofs_per_fe_block<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      count_dofs_per_fe_block<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const std::vector<unsigned int> &);
 
 
       template unsigned int
-      count_dofs_on_patch<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      count_dofs_on_patch<deal_II_dimension, deal_II_space_dimension>(
         const std::vector<
           DoFHandler<deal_II_dimension,
                      deal_II_space_dimension>::active_cell_iterator> &patch);
 
       template std::vector<types::global_dof_index>
-      get_dofs_on_patch<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      get_dofs_on_patch<deal_II_dimension, deal_II_space_dimension>(
         const std::vector<
           DoFHandler<deal_II_dimension,
                      deal_II_space_dimension>::active_cell_iterator> &patch);
@@ -96,13 +88,13 @@ for (DoFHandler : DOFHANDLER_TEMPLATES;
       // extract_dofs(): Deprecated versions that return information through
       // the last argument
       template void
-      extract_dofs<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_dofs<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const ComponentMask &,
         std::vector<bool> &);
 
       template void
-      extract_dofs<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_dofs<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const BlockMask &,
         std::vector<bool> &);
@@ -110,12 +102,12 @@ for (DoFHandler : DOFHANDLER_TEMPLATES;
 
       // extract_dofs(): New versions that return information as an IndexSet
       template IndexSet
-      extract_dofs<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_dofs<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const ComponentMask &);
 
       template IndexSet
-      extract_dofs<DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_dofs<deal_II_dimension, deal_II_space_dimension>(
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const BlockMask &);
     \}
@@ -124,7 +116,7 @@ for (DoFHandler : DOFHANDLER_TEMPLATES;
 
 
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS)
   {
     template std::vector<unsigned int> DoFTools::make_vertex_patches(
       SparsityPattern &,
@@ -161,36 +153,39 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 
     // TODO: can cleanup a bit more to fit into the scheme used above
 
-    template void
-    DoFTools::distribute_cell_to_dof_vector<DoFHandler<deal_II_dimension>>(
+    template void DoFTools::distribute_cell_to_dof_vector<deal_II_dimension,
+                                                          deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &dof_handler,
       const Vector<float> &                cell_data,
       Vector<double> &                     dof_data,
       const unsigned int                   component);
-    template void
-    DoFTools::distribute_cell_to_dof_vector<DoFHandler<deal_II_dimension>>(
+    template void DoFTools::distribute_cell_to_dof_vector<deal_II_dimension,
+                                                          deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &dof_handler,
       const Vector<double> &               cell_data,
       Vector<double> &                     dof_data,
       const unsigned int                   component);
 
-    template void DoFTools::extract_boundary_dofs<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     const ComponentMask &,
-                                     std::vector<bool> &,
-                                     const std::set<types::boundary_id> &);
+    template void
+    DoFTools::extract_boundary_dofs<deal_II_dimension, deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &,
+      const ComponentMask &,
+      std::vector<bool> &,
+      const std::set<types::boundary_id> &);
 
-    template void DoFTools::extract_boundary_dofs<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     const ComponentMask &,
-                                     IndexSet &,
-                                     const std::set<types::boundary_id> &);
+    template void
+    DoFTools::extract_boundary_dofs<deal_II_dimension, deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &,
+      const ComponentMask &,
+      IndexSet &,
+      const std::set<types::boundary_id> &);
 
     template void DoFTools::extract_dofs_with_support_on_boundary<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     const ComponentMask &,
-                                     std::vector<bool> &,
-                                     const std::set<types::boundary_id> &);
+      deal_II_dimension,
+      deal_II_dimension>(const DoFHandler<deal_II_dimension> &,
+                         const ComponentMask &,
+                         std::vector<bool> &,
+                         const std::set<types::boundary_id> &);
 
     template IndexSet DoFTools::extract_hanging_node_dofs(
       const DoFHandler<deal_II_dimension> &);
@@ -198,149 +193,154 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
     template void DoFTools::extract_hanging_node_dofs(
       const DoFHandler<deal_II_dimension> &, std::vector<bool> &);
 
-    template void
-    DoFTools::extract_subdomain_dofs<DoFHandler<deal_II_dimension>>(
+    template void DoFTools::extract_subdomain_dofs<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &dof_handler,
       const types::subdomain_id            subdomain_id,
       std::vector<bool> &                  selected_dofs);
 
-    template void
-    DoFTools::extract_constant_modes<DoFHandler<deal_II_dimension>>(
+    template void DoFTools::extract_constant_modes<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &dof_handler,
       const ComponentMask &                selected_components,
       std::vector<std::vector<bool>> &     constant_modes);
 
-    template void
-    DoFTools::get_active_fe_indices<DoFHandler<deal_II_dimension>>(
+    template void DoFTools::get_active_fe_indices<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &dof_handler,
       std::vector<unsigned int> &          active_fe_indices);
 
-    template void
-    DoFTools::get_subdomain_association<DoFHandler<deal_II_dimension>>(
+    template void DoFTools::get_subdomain_association<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &dof_handler,
       std::vector<types::subdomain_id> &   subdomain_association);
 
     template std::vector<IndexSet>
-    DoFTools::locally_owned_dofs_per_subdomain<DoFHandler<deal_II_dimension>>(
+    DoFTools::locally_owned_dofs_per_subdomain<deal_II_dimension>(
       const DoFHandler<deal_II_dimension> &dof_handler);
 
-    template std::vector<IndexSet> DoFTools::
-      locally_relevant_dofs_per_subdomain<DoFHandler<deal_II_dimension>>(
-        const DoFHandler<deal_II_dimension> &dof_handler);
+    template std::vector<IndexSet>
+    DoFTools::locally_relevant_dofs_per_subdomain<deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &dof_handler);
 
-    template unsigned int DoFTools::count_dofs_with_subdomain_association<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     const types::subdomain_id);
-    template IndexSet DoFTools::dof_indices_with_subdomain_association<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     const types::subdomain_id);
+    template unsigned int
+    DoFTools::count_dofs_with_subdomain_association<deal_II_dimension,
+                                                    deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &, const types::subdomain_id);
+    template IndexSet
+    DoFTools::dof_indices_with_subdomain_association<deal_II_dimension,
+                                                     deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &, const types::subdomain_id);
     template void DoFTools::count_dofs_with_subdomain_association<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     const types::subdomain_id,
-                                     std::vector<unsigned int> &);
+      deal_II_dimension,
+      deal_II_dimension>(const DoFHandler<deal_II_dimension> &,
+                         const types::subdomain_id,
+                         std::vector<unsigned int> &);
 
 #if deal_II_dimension < 3
 
-    template void DoFTools::extract_boundary_dofs<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template void
+    DoFTools::extract_boundary_dofs<deal_II_dimension, deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
       const ComponentMask &,
       std::vector<bool> &,
       const std::set<types::boundary_id> &);
 
-    template void DoFTools::extract_boundary_dofs<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template void
+    DoFTools::extract_boundary_dofs<deal_II_dimension, deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
       const ComponentMask &,
       IndexSet &,
       const std::set<types::boundary_id> &);
 
-    template unsigned int DoFTools::count_dofs_with_subdomain_association<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template unsigned int
+    DoFTools::count_dofs_with_subdomain_association<deal_II_dimension,
+                                                    deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
       const types::subdomain_id);
 
-    template IndexSet DoFTools::dof_indices_with_subdomain_association<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template IndexSet
+    DoFTools::dof_indices_with_subdomain_association<deal_II_dimension,
+                                                     deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
       const types::subdomain_id);
-    template void DoFTools::count_dofs_with_subdomain_association<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template void
+    DoFTools::count_dofs_with_subdomain_association<deal_II_dimension,
+                                                    deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
       const types::subdomain_id,
       std::vector<unsigned int> &);
 
-    template void DoFTools::get_subdomain_association<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template void DoFTools::get_subdomain_association<deal_II_dimension,
+                                                      deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_handler,
       std::vector<types::subdomain_id> &subdomain_association);
 
-    template std::vector<IndexSet> DoFTools::locally_owned_dofs_per_subdomain<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template std::vector<IndexSet>
+    DoFTools::locally_owned_dofs_per_subdomain<deal_II_dimension,
+                                               deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_handler);
 
     template std::vector<IndexSet>
-    DoFTools::locally_relevant_dofs_per_subdomain<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    DoFTools::locally_relevant_dofs_per_subdomain<deal_II_dimension,
+                                                  deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_handler);
 
 #endif
 
 #if deal_II_dimension == 3
-    template void DoFTools::extract_boundary_dofs<DoFHandler<1, 3>>(
+    template void DoFTools::extract_boundary_dofs<1, 3>(
       const DoFHandler<1, 3> &,
       const ComponentMask &,
       std::vector<bool> &,
       const std::set<types::boundary_id> &);
 
-    template void DoFTools::extract_boundary_dofs<DoFHandler<1, 3>>(
+    template void DoFTools::extract_boundary_dofs<1, 3>(
       const DoFHandler<1, 3> &,
       const ComponentMask &,
       IndexSet &,
       const std::set<types::boundary_id> &);
 
-    template void DoFTools::get_subdomain_association<DoFHandler<1, 3>>(
+    template void DoFTools::get_subdomain_association<1, 3>(
       const DoFHandler<1, 3> &          dof_handler,
       std::vector<types::subdomain_id> &subdomain_association);
 
     template std::vector<IndexSet>
-    DoFTools::locally_owned_dofs_per_subdomain<DoFHandler<1, 3>>(
+    DoFTools::locally_owned_dofs_per_subdomain<1, 3>(
       const DoFHandler<1, 3> &dof_handler);
 
     template std::vector<IndexSet>
-    DoFTools::locally_relevant_dofs_per_subdomain<DoFHandler<1, 3>>(
+    DoFTools::locally_relevant_dofs_per_subdomain<1, 3>(
       const DoFHandler<1, 3> &dof_handler);
 
-    template unsigned int DoFTools::count_dofs_with_subdomain_association<
-      DoFHandler<1, 3>>(const DoFHandler<1, 3> &, const types::subdomain_id);
-    template IndexSet DoFTools::dof_indices_with_subdomain_association<
-      DoFHandler<1, 3>>(const DoFHandler<1, 3> &, const types::subdomain_id);
-    template void DoFTools::count_dofs_with_subdomain_association<
-      DoFHandler<1, 3>>(const DoFHandler<1, 3> &,
-                        const types::subdomain_id,
-                        std::vector<unsigned int> &);
+    template unsigned int DoFTools::count_dofs_with_subdomain_association<1, 3>(
+      const DoFHandler<1, 3> &, const types::subdomain_id);
+    template IndexSet DoFTools::dof_indices_with_subdomain_association<1, 3>(
+      const DoFHandler<1, 3> &, const types::subdomain_id);
+    template void DoFTools::count_dofs_with_subdomain_association<1, 3>(
+      const DoFHandler<1, 3> &,
+      const types::subdomain_id,
+      std::vector<unsigned int> &);
 #endif
 
-    template void DoFTools::map_dof_to_boundary_indices<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     const std::set<types::boundary_id> &,
-                                     std::vector<types::global_dof_index> &);
+    template void
+    DoFTools::map_dof_to_boundary_indices<deal_II_dimension, deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &,
+      const std::set<types::boundary_id> &,
+      std::vector<types::global_dof_index> &);
 
-    template void DoFTools::map_dof_to_boundary_indices<
-      DoFHandler<deal_II_dimension>>(const DoFHandler<deal_II_dimension> &,
-                                     std::vector<types::global_dof_index> &);
+    template void
+    DoFTools::map_dof_to_boundary_indices<deal_II_dimension, deal_II_dimension>(
+      const DoFHandler<deal_II_dimension> &,
+      std::vector<types::global_dof_index> &);
 
 
 #if deal_II_dimension < 3
 
-    template void DoFTools::map_dof_to_boundary_indices<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template void DoFTools::map_dof_to_boundary_indices<deal_II_dimension,
+                                                        deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
       const std::set<types::boundary_id> &,
       std::vector<types::global_dof_index> &);
 
-    template void DoFTools::map_dof_to_boundary_indices<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>>(
+    template void DoFTools::map_dof_to_boundary_indices<deal_II_dimension,
+                                                        deal_II_dimension + 1>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
       std::vector<types::global_dof_index> &);
 
@@ -355,12 +355,12 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 
 #if deal_II_dimension == 3
 
-    template void DoFTools::map_dof_to_boundary_indices<DoFHandler<1, 3>>(
+    template void DoFTools::map_dof_to_boundary_indices<1, 3>(
       const DoFHandler<1, 3> &,
       const std::set<types::boundary_id> &,
       std::vector<types::global_dof_index> &);
 
-    template void DoFTools::map_dof_to_boundary_indices<DoFHandler<1, 3>>(
+    template void DoFTools::map_dof_to_boundary_indices<1, 3>(
       const DoFHandler<1, 3> &, std::vector<types::global_dof_index> &);
 
     template IndexSet DoFTools::extract_hanging_node_dofs(
@@ -386,12 +386,12 @@ for (deal_II_dimension : DIMENSIONS)
   }
 
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
-     S : REAL_AND_COMPLEX_SCALARS)
+for (deal_II_dimension : DIMENSIONS; S : REAL_AND_COMPLEX_SCALARS)
   {
-    template IndexSet DoFTools::extract_dofs_with_support_contained_within<
-      DoFHandler<deal_II_dimension>,
-      S>(
+    template IndexSet
+    DoFTools::extract_dofs_with_support_contained_within<deal_II_dimension,
+                                                         deal_II_dimension,
+                                                         S>(
       const DoFHandler<deal_II_dimension> &,
       const std::function<bool(
         const typename DoFHandler<deal_II_dimension>::active_cell_iterator &)>
@@ -439,24 +439,21 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS)
   }
 
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
-     deal_II_space_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
     namespace DoFTools
     \{
       // extract_level_dofs() for ComponentMask and BlockMask
       template void
-      extract_level_dofs<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_level_dofs<deal_II_dimension, deal_II_space_dimension>(
         const unsigned int level,
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const ComponentMask &,
         std::vector<bool> &);
 
       template void
-      extract_level_dofs<
-        DoFHandler<deal_II_dimension, deal_II_space_dimension>>(
+      extract_level_dofs<deal_II_dimension, deal_II_space_dimension>(
         const unsigned int level,
         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
         const BlockMask &,
index 72e63f0553ecdd7b65a9e05263e7bb5203cfd025..56a98a28b2da772da491f73b9ab99c18e1210ba6 100644 (file)
@@ -1704,10 +1704,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
-  make_hanging_node_constraints(const DoFHandlerType &     dof_handler,
-                                AffineConstraints<number> &constraints)
+  make_hanging_node_constraints(const DoFHandler<dim, spacedim> &dof_handler,
+                                AffineConstraints<number> &      constraints)
   {
     // Decide whether to use the new or old make_hanging_node_constraints
     // function. If all the FiniteElement or all elements in a FECollection
@@ -1717,9 +1717,7 @@ namespace DoFTools
       internal::make_hp_hanging_node_constraints(dof_handler, constraints);
     else
       internal::make_oldstyle_hanging_node_constraints(
-        dof_handler,
-        constraints,
-        std::integral_constant<int, DoFHandlerType::dimension>());
+        dof_handler, constraints, std::integral_constant<int, dim>());
   }
 
 
@@ -2417,21 +2415,20 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
   make_periodicity_constraints(
-    const std::vector<
-      GridTools::PeriodicFacePair<typename DoFHandlerType::cell_iterator>>
-      &                              periodic_faces,
-    AffineConstraints<number> &      constraints,
-    const ComponentMask &            component_mask,
+    const std::vector<GridTools::PeriodicFacePair<
+      typename DoFHandler<dim, spacedim>::cell_iterator>> &periodic_faces,
+    AffineConstraints<number> &                            constraints,
+    const ComponentMask &                                  component_mask,
     const std::vector<unsigned int> &first_vector_components,
     const number                     periodicity_factor)
   {
     // Loop over all periodic faces...
     for (auto &pair : periodic_faces)
       {
-        using FaceIterator        = typename DoFHandlerType::face_iterator;
+        using FaceIterator = typename DoFHandler<dim, spacedim>::face_iterator;
         const FaceIterator face_1 = pair.cell[0]->face(pair.face_idx[0]);
         const FaceIterator face_2 = pair.cell[1]->face(pair.face_idx[1]);
 
@@ -2459,9 +2456,9 @@ namespace DoFTools
   // High level interface variants:
 
 
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
-  make_periodicity_constraints(const DoFHandlerType &             dof_handler,
+  make_periodicity_constraints(const DoFHandler<dim, spacedim> &  dof_handler,
                                const types::boundary_id           b_id1,
                                const types::boundary_id           b_id2,
                                const unsigned int                 direction,
@@ -2469,51 +2466,44 @@ namespace DoFTools
                                const ComponentMask &component_mask,
                                const number         periodicity_factor)
   {
-    static const int spacedim = DoFHandlerType::space_dimension;
-    (void)spacedim;
     AssertIndexRange(direction, spacedim);
 
     Assert(b_id1 != b_id2,
            ExcMessage("The boundary indicators b_id1 and b_id2 must be "
                       "different to denote different boundaries."));
 
-    std::vector<
-      GridTools::PeriodicFacePair<typename DoFHandlerType::cell_iterator>>
+    std::vector<GridTools::PeriodicFacePair<
+      typename DoFHandler<dim, spacedim>::cell_iterator>>
       matched_faces;
 
     // Collect matching periodic cells on the coarsest level:
     GridTools::collect_periodic_faces(
       dof_handler, b_id1, b_id2, direction, matched_faces);
 
-    make_periodicity_constraints<DoFHandlerType>(matched_faces,
-                                                 constraints,
-                                                 component_mask,
-                                                 std::vector<unsigned int>(),
-                                                 periodicity_factor);
+    make_periodicity_constraints<dim, spacedim>(matched_faces,
+                                                constraints,
+                                                component_mask,
+                                                std::vector<unsigned int>(),
+                                                periodicity_factor);
   }
 
 
 
-  template <typename DoFHandlerType, typename number>
+  template <int dim, int spacedim, typename number>
   void
-  make_periodicity_constraints(const DoFHandlerType &     dof_handler,
-                               const types::boundary_id   b_id,
-                               const unsigned int         direction,
-                               AffineConstraints<number> &constraints,
-                               const ComponentMask &      component_mask,
-                               const number               periodicity_factor)
+  make_periodicity_constraints(const DoFHandler<dim, spacedim> &dof_handler,
+                               const types::boundary_id         b_id,
+                               const unsigned int               direction,
+                               AffineConstraints<number> &      constraints,
+                               const ComponentMask &            component_mask,
+                               const number periodicity_factor)
   {
-    static const int dim      = DoFHandlerType::dimension;
-    static const int spacedim = DoFHandlerType::space_dimension;
-    (void)dim;
-    (void)spacedim;
-
     AssertIndexRange(direction, spacedim);
 
     Assert(dim == spacedim, ExcNotImplemented());
 
-    std::vector<
-      GridTools::PeriodicFacePair<typename DoFHandlerType::cell_iterator>>
+    std::vector<GridTools::PeriodicFacePair<
+      typename DoFHandler<dim, spacedim>::cell_iterator>>
       matched_faces;
 
     // Collect matching periodic cells on the coarsest level:
@@ -2522,11 +2512,11 @@ namespace DoFTools
                                       direction,
                                       matched_faces);
 
-    make_periodicity_constraints<DoFHandlerType>(matched_faces,
-                                                 constraints,
-                                                 component_mask,
-                                                 std::vector<unsigned int>(),
-                                                 periodicity_factor);
+    make_periodicity_constraints<dim, spacedim>(matched_faces,
+                                                constraints,
+                                                component_mask,
+                                                std::vector<unsigned int>(),
+                                                periodicity_factor);
   }
 
 
@@ -3125,8 +3115,7 @@ namespace DoFTools
       mask[coarse_component] = true;
 
       coarse_dof_is_parameter =
-        extract_dofs<DoFHandler<dim, spacedim>>(coarse_grid,
-                                                ComponentMask(mask));
+        extract_dofs<dim, spacedim>(coarse_grid, ComponentMask(mask));
     }
 
     // now we know that the weights in each row constitute a constraint. enter
@@ -3344,16 +3333,13 @@ namespace DoFTools
 
 
 
-  template <int dim,
-            int spacedim,
-            template <int, int> class DoFHandlerType,
-            typename number>
+  template <int dim, int spacedim, typename number>
   void
   make_zero_boundary_constraints(
-    const DoFHandlerType<dim, spacedim> &dof,
-    const types::boundary_id             boundary_id,
-    AffineConstraints<number> &          zero_boundary_constraints,
-    const ComponentMask &                component_mask)
+    const DoFHandler<dim, spacedim> &dof,
+    const types::boundary_id         boundary_id,
+    AffineConstraints<number> &      zero_boundary_constraints,
+    const ComponentMask &            component_mask)
   {
     Assert(component_mask.represents_n_components(dof.get_fe(0).n_components()),
            ExcMessage("The number of components in the mask has to be either "
@@ -3372,7 +3358,7 @@ namespace DoFTools
     std::vector<types::global_dof_index> cell_dofs;
     cell_dofs.reserve(dof.get_fe_collection().max_dofs_per_cell());
 
-    typename DoFHandlerType<dim, spacedim>::active_cell_iterator
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
       cell = dof.begin_active(),
       endc = dof.end();
     for (; cell != endc; ++cell)
@@ -3386,7 +3372,7 @@ namespace DoFTools
 
           for (const auto face_no : cell->face_indices())
             {
-              const typename DoFHandlerType<dim, spacedim>::face_iterator face =
+              const typename DoFHandler<dim, spacedim>::face_iterator face =
                 cell->face(face_no);
 
               // if face is on the boundary and satisfies the correct boundary
@@ -3433,15 +3419,12 @@ namespace DoFTools
 
 
 
-  template <int dim,
-            int spacedim,
-            template <int, int> class DoFHandlerType,
-            typename number>
+  template <int dim, int spacedim, typename number>
   void
   make_zero_boundary_constraints(
-    const DoFHandlerType<dim, spacedim> &dof,
-    AffineConstraints<number> &          zero_boundary_constraints,
-    const ComponentMask &                component_mask)
+    const DoFHandler<dim, spacedim> &dof,
+    AffineConstraints<number> &      zero_boundary_constraints,
+    const ComponentMask &            component_mask)
   {
     make_zero_boundary_constraints(dof,
                                    numbers::invalid_boundary_id,
index 1ada0c0d40ba614b97938f7fb44a36fb3819dfd3..84bf7d227c015f82ea087f42b97dd19ea4bfa052 100644 (file)
@@ -42,22 +42,24 @@ for (deal_II_dimension : DIMENSIONS)
 #endif
   }
 
-for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS)
   {
-    template void
-    DoFTools::make_periodicity_constraints<DH<deal_II_dimension>, double>(
-      const std::vector<
-        GridTools::PeriodicFacePair<DH<deal_II_dimension>::cell_iterator>> &,
+    template void DoFTools::make_periodicity_constraints<deal_II_dimension,
+                                                         deal_II_dimension,
+                                                         double>(
+      const std::vector<GridTools::PeriodicFacePair<
+        DoFHandler<deal_II_dimension>::cell_iterator>> &,
       AffineConstraints<double> &,
       const ComponentMask &,
       const std::vector<unsigned int> &,
       const double);
 
 #ifdef DEAL_II_WITH_COMPLEX_VALUES
-    template void DoFTools::make_periodicity_constraints<DH<deal_II_dimension>,
+    template void DoFTools::make_periodicity_constraints<deal_II_dimension,
+                                                         deal_II_dimension,
                                                          std::complex<double>>(
-      const std::vector<
-        GridTools::PeriodicFacePair<DH<deal_II_dimension>::cell_iterator>> &,
+      const std::vector<GridTools::PeriodicFacePair<
+        DoFHandler<deal_II_dimension>::cell_iterator>> &,
       AffineConstraints<std::complex<double>> &,
       const ComponentMask &,
       const std::vector<unsigned int> &,
@@ -65,7 +67,7 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 #endif
 
     template void DoFTools::make_periodicity_constraints(
-      const DH<deal_II_dimension> &,
+      const DoFHandler<deal_II_dimension> &,
       const types::boundary_id,
       const types::boundary_id,
       const unsigned int,
@@ -75,7 +77,7 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 
 #ifdef DEAL_II_WITH_COMPLEX_VALUES
     template void DoFTools::make_periodicity_constraints(
-      const DH<deal_II_dimension> &,
+      const DoFHandler<deal_II_dimension> &,
       const types::boundary_id,
       const types::boundary_id,
       const unsigned int,
@@ -85,7 +87,7 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 #endif
 
     template void DoFTools::make_periodicity_constraints(
-      const DH<deal_II_dimension> &,
+      const DoFHandler<deal_II_dimension> &,
       const types::boundary_id,
       const unsigned int,
       AffineConstraints<double> &,
@@ -94,7 +96,7 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 
 #ifdef DEAL_II_WITH_COMPLEX_VALUES
     template void DoFTools::make_periodicity_constraints(
-      const DH<deal_II_dimension> &,
+      const DoFHandler<deal_II_dimension> &,
       const types::boundary_id,
       const unsigned int,
       AffineConstraints<std::complex<double>> &,
@@ -103,22 +105,22 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
 #endif
   }
 
-for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
+for (DoFHandler : DOFHANDLER_TEMPLATE; deal_II_dimension : DIMENSIONS;
      deal_II_space_dimension : SPACE_DIMENSIONS;
      S : REAL_AND_COMPLEX_SCALARS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
     template void DoFTools::make_hanging_node_constraints(
-      const DH<deal_II_dimension, deal_II_space_dimension> &,
+      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
       AffineConstraints<S> &);
 
     template void DoFTools::make_zero_boundary_constraints(
-      const DH<deal_II_dimension, deal_II_space_dimension> &,
+      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
       AffineConstraints<S> &,
       const ComponentMask &);
 
     template void DoFTools::make_zero_boundary_constraints(
-      const DH<deal_II_dimension, deal_II_space_dimension> &,
+      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
       const types::boundary_id,
       AffineConstraints<S> &,
       const ComponentMask &);
index 49cde87a33b1161af609af2d3f30285d34ac8b07..a7b3bdcbbc1753263c202aafd0a45dc082462b53 100644 (file)
@@ -56,11 +56,12 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace DoFTools
 {
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
-  make_sparsity_pattern(const DoFHandlerType &           dof,
+  make_sparsity_pattern(const DoFHandler<dim, spacedim> &dof,
                         SparsityPatternType &            sparsity,
                         const AffineConstraints<number> &constraints,
                         const bool                       keep_constrained_dofs,
@@ -89,8 +90,9 @@ namespace DoFTools
 
     std::vector<types::global_dof_index> dofs_on_this_cell;
     dofs_on_this_cell.reserve(dof.get_fe_collection().max_dofs_per_cell());
-    typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
-                                                  endc = dof.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof.begin_active(),
+      endc = dof.end();
 
     // In case we work with a distributed sparsity pattern of Trilinos
     // type, we only have to do the work if the current cell is owned by
@@ -115,11 +117,12 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
-  make_sparsity_pattern(const DoFHandlerType &           dof,
+  make_sparsity_pattern(const DoFHandler<dim, spacedim> &dof,
                         const Table<2, Coupling> &       couplings,
                         SparsityPatternType &            sparsity,
                         const AffineConstraints<number> &constraints,
@@ -153,8 +156,7 @@ namespace DoFTools
              "associated DoF handler objects, asking for any subdomain other "
              "than the locally owned one does not make sense."));
 
-    const hp::FECollection<DoFHandlerType::dimension,
-                           DoFHandlerType::space_dimension> &fe_collection =
+    const hp::FECollection<dim, spacedim> &fe_collection =
       dof.get_fe_collection();
 
     const std::vector<Table<2, Coupling>> dof_mask //(fe_collection.size())
@@ -177,8 +179,9 @@ namespace DoFTools
 
     std::vector<types::global_dof_index> dofs_on_this_cell(
       fe_collection.max_dofs_per_cell());
-    typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
-                                                  endc = dof.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof.begin_active(),
+      endc = dof.end();
 
     // In case we work with a distributed sparsity pattern of Trilinos
     // type, we only have to do the work if the current cell is owned by
@@ -208,11 +211,11 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
-  make_sparsity_pattern(const DoFHandlerType &dof_row,
-                        const DoFHandlerType &dof_col,
-                        SparsityPatternType & sparsity)
+  make_sparsity_pattern(const DoFHandler<dim, spacedim> &dof_row,
+                        const DoFHandler<dim, spacedim> &dof_col,
+                        SparsityPatternType &            sparsity)
   {
     const types::global_dof_index n_dofs_row = dof_row.n_dofs();
     const types::global_dof_index n_dofs_col = dof_col.n_dofs();
@@ -229,8 +232,6 @@ namespace DoFTools
     // different processors) and unequal: no processor will be responsible for
     // assembling coupling terms between dofs on a cell owned by one processor
     // and dofs on a cell owned by a different processor.
-    constexpr int dim      = DoFHandlerType::dimension;
-    constexpr int spacedim = DoFHandlerType::space_dimension;
     if (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
           &dof_row.get_triangulation()) != nullptr ||
         dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
@@ -243,7 +244,7 @@ namespace DoFTools
 
     // TODO: Looks like wasteful memory management here
 
-    using cell_iterator = typename DoFHandlerType::cell_iterator;
+    using cell_iterator = typename DoFHandler<dim, spacedim>::cell_iterator;
     std::list<std::pair<cell_iterator, cell_iterator>> cell_list =
       GridTools::get_finest_common_cells(dof_row, dof_col);
 
@@ -297,13 +298,15 @@ namespace DoFTools
           }
         else if (cell_row->has_children())
           {
-            const std::vector<typename DoFHandlerType::active_cell_iterator>
+            const std::vector<
+              typename DoFHandler<dim, spacedim>::active_cell_iterator>
               child_cells =
-                GridTools::get_active_child_cells<DoFHandlerType>(cell_row);
+                GridTools::get_active_child_cells<DoFHandler<dim, spacedim>>(
+                  cell_row);
             for (unsigned int i = 0; i < child_cells.size(); i++)
               {
-                const typename DoFHandlerType::cell_iterator cell_row_child =
-                  child_cells[i];
+                const typename DoFHandler<dim, spacedim>::cell_iterator
+                                   cell_row_child = child_cells[i];
                 const unsigned int dofs_per_cell_row =
                   cell_row_child->get_fe().dofs_per_cell;
                 const unsigned int dofs_per_cell_col =
@@ -322,12 +325,14 @@ namespace DoFTools
           }
         else
           {
-            std::vector<typename DoFHandlerType::active_cell_iterator>
+            std::vector<
+              typename DoFHandler<dim, spacedim>::active_cell_iterator>
               child_cells =
-                GridTools::get_active_child_cells<DoFHandlerType>(cell_col);
+                GridTools::get_active_child_cells<DoFHandler<dim, spacedim>>(
+                  cell_col);
             for (unsigned int i = 0; i < child_cells.size(); i++)
               {
-                const typename DoFHandlerType::active_cell_iterator
+                const typename DoFHandler<dim, spacedim>::active_cell_iterator
                                    cell_col_child = child_cells[i];
                 const unsigned int dofs_per_cell_row =
                   cell_row->get_fe().dofs_per_cell;
@@ -350,23 +355,22 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
   make_boundary_sparsity_pattern(
-    const DoFHandlerType &                      dof,
+    const DoFHandler<dim, spacedim> &           dof,
     const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
     SparsityPatternType &                       sparsity)
   {
-    if (DoFHandlerType::dimension == 1)
+    if (dim == 1)
       {
         // there are only 2 boundary indicators in 1d, so it is no
         // performance problem to call the other function
-        std::map<types::boundary_id,
-                 const Function<DoFHandlerType::space_dimension, double> *>
+        std::map<types::boundary_id, const Function<spacedim, double> *>
           boundary_ids;
         boundary_ids[0] = nullptr;
         boundary_ids[1] = nullptr;
-        make_boundary_sparsity_pattern<DoFHandlerType, SparsityPatternType>(
+        make_boundary_sparsity_pattern<dim, spacedim, SparsityPatternType>(
           dof, boundary_ids, dof_to_boundary_mapping, sparsity);
         return;
       }
@@ -396,11 +400,11 @@ namespace DoFTools
     // @p{cell->has_boundary_lines}), since we do not support boundaries of
     // dimension dim-2, and so every boundary line is also part of a
     // boundary face.
-    typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
-                                                  endc = dof.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof.begin_active(),
+      endc = dof.end();
     for (; cell != endc; ++cell)
-      for (const unsigned int f :
-           GeometryInfo<DoFHandlerType::dimension>::face_indices())
+      for (const unsigned int f : GeometryInfo<dim>::face_indices())
         if (cell->at_boundary(f))
           {
             const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
@@ -418,19 +422,19 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
   make_boundary_sparsity_pattern(
-    const DoFHandlerType &dof,
-    const std::map<types::boundary_id,
-                   const Function<DoFHandlerType::space_dimension, number> *>
+    const DoFHandler<dim, spacedim> &dof,
+    const std::map<types::boundary_id, const Function<spacedim, number> *>
       &                                         boundary_ids,
     const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
     SparsityPatternType &                       sparsity)
   {
-    if (DoFHandlerType::dimension == 1)
+    if (dim == 1)
       {
         // first check left, then right boundary point
         for (unsigned int direction = 0; direction < 2; ++direction)
@@ -441,7 +445,8 @@ namespace DoFTools
 
             // find active cell at that boundary: first go to left/right,
             // then to children
-            typename DoFHandlerType::level_cell_iterator cell = dof.begin(0);
+            typename DoFHandler<dim, spacedim>::level_cell_iterator cell =
+              dof.begin(0);
             while (!cell->at_boundary(direction))
               cell = cell->neighbor(direction);
             while (!cell->is_active())
@@ -470,7 +475,7 @@ namespace DoFTools
     AssertDimension(dof_to_boundary_mapping.size(), n_dofs);
     Assert(boundary_ids.find(numbers::internal_face_boundary_id) ==
              boundary_ids.end(),
-           typename DoFHandlerType::ExcInvalidBoundaryIndicator());
+           (typename DoFHandler<dim, spacedim>::ExcInvalidBoundaryIndicator()));
     Assert(sparsity.n_rows() == dof.n_boundary_dofs(boundary_ids),
            ExcDimensionMismatch(sparsity.n_rows(),
                                 dof.n_boundary_dofs(boundary_ids)));
@@ -490,11 +495,11 @@ namespace DoFTools
 
     std::vector<types::global_dof_index> dofs_on_this_face;
     dofs_on_this_face.reserve(dof.get_fe_collection().max_dofs_per_face());
-    typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
-                                                  endc = dof.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof.begin_active(),
+      endc = dof.end();
     for (; cell != endc; ++cell)
-      for (const unsigned int f :
-           GeometryInfo<DoFHandlerType::dimension>::face_indices())
+      for (const unsigned int f : GeometryInfo<dim>::face_indices())
         if (boundary_ids.find(cell->face(f)->boundary_id()) !=
             boundary_ids.end())
           {
@@ -513,11 +518,12 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
-  make_flux_sparsity_pattern(const DoFHandlerType &           dof,
+  make_flux_sparsity_pattern(const DoFHandler<dim, spacedim> &dof,
                              SparsityPatternType &            sparsity,
                              const AffineConstraints<number> &constraints,
                              const bool                keep_constrained_dofs,
@@ -549,8 +555,9 @@ namespace DoFTools
     std::vector<types::global_dof_index> dofs_on_other_cell;
     dofs_on_this_cell.reserve(dof.get_fe_collection().max_dofs_per_cell());
     dofs_on_other_cell.reserve(dof.get_fe_collection().max_dofs_per_cell());
-    typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
-                                                  endc = dof.end();
+    typename DoFHandler<dim, spacedim>::active_cell_iterator
+      cell = dof.begin_active(),
+      endc = dof.end();
 
     // TODO: in an old implementation, we used user flags before to tag
     // faces that were already touched. this way, we could reduce the work
@@ -576,22 +583,21 @@ namespace DoFTools
                                                   sparsity,
                                                   keep_constrained_dofs);
 
-          for (const unsigned int face :
-               GeometryInfo<DoFHandlerType::dimension>::face_indices())
+          for (const unsigned int face : GeometryInfo<dim>::face_indices())
             {
-              typename DoFHandlerType::face_iterator cell_face =
+              typename DoFHandler<dim, spacedim>::face_iterator cell_face =
                 cell->face(face);
               const bool periodic_neighbor = cell->has_periodic_neighbor(face);
               if (!cell->at_boundary(face) || periodic_neighbor)
                 {
-                  typename DoFHandlerType::level_cell_iterator neighbor =
-                    cell->neighbor_or_periodic_neighbor(face);
+                  typename DoFHandler<dim, spacedim>::level_cell_iterator
+                    neighbor = cell->neighbor_or_periodic_neighbor(face);
 
                   // in 1d, we do not need to worry whether the neighbor
                   // might have children and then loop over those children.
                   // rather, we may as well go straight to the cell behind
                   // this particular cell's most terminal child
-                  if (DoFHandlerType::dimension == 1)
+                  if (dim == 1)
                     while (neighbor->has_children())
                       neighbor = neighbor->child(face == 0 ? 1 : 0);
 
@@ -601,8 +607,8 @@ namespace DoFTools
                            sub_nr != cell_face->number_of_children();
                            ++sub_nr)
                         {
-                          const typename DoFHandlerType::level_cell_iterator
-                            sub_neighbor =
+                          const typename DoFHandler<dim, spacedim>::
+                            level_cell_iterator sub_neighbor =
                               periodic_neighbor ?
                                 cell->periodic_neighbor_child_on_subface(
                                   face, sub_nr) :
@@ -684,10 +690,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
-  make_flux_sparsity_pattern(const DoFHandlerType &dof,
-                             SparsityPatternType & sparsity)
+  make_flux_sparsity_pattern(const DoFHandler<dim, spacedim> &dof,
+                             SparsityPatternType &            sparsity)
   {
     AffineConstraints<double> dummy;
     make_flux_sparsity_pattern(dof, sparsity, dummy);
@@ -1355,37 +1361,37 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <int dim, int spacedim, typename SparsityPatternType>
   void
-  make_flux_sparsity_pattern(const DoFHandlerType &    dof,
-                             SparsityPatternType &     sparsity,
-                             const Table<2, Coupling> &int_mask,
-                             const Table<2, Coupling> &flux_mask,
-                             const types::subdomain_id subdomain_id)
+  make_flux_sparsity_pattern(const DoFHandler<dim, spacedim> &dof,
+                             SparsityPatternType &            sparsity,
+                             const Table<2, Coupling> &       int_mask,
+                             const Table<2, Coupling> &       flux_mask,
+                             const types::subdomain_id        subdomain_id)
   {
     AffineConstraints<double> dummy;
 
     const bool keep_constrained_dofs = true;
 
-    make_flux_sparsity_pattern(
-      dof,
-      sparsity,
-      dummy,
-      keep_constrained_dofs,
-      int_mask,
-      flux_mask,
-      subdomain_id,
-      internal::always_couple_on_faces<DoFHandlerType>);
+    make_flux_sparsity_pattern(dof,
+                               sparsity,
+                               dummy,
+                               keep_constrained_dofs,
+                               int_mask,
+                               flux_mask,
+                               subdomain_id,
+                               internal::always_couple_on_faces<dim, spacedim>);
   }
 
 
 
-  template <typename DoFHandlerType,
+  template <int dim,
+            int spacedim,
             typename SparsityPatternType,
             typename number>
   void
   make_flux_sparsity_pattern(
-    const DoFHandlerType &           dof,
+    const DoFHandler<dim, spacedim> &dof,
     SparsityPatternType &            sparsity,
     const AffineConstraints<number> &constraints,
     const bool                       keep_constrained_dofs,
@@ -1393,7 +1399,7 @@ namespace DoFTools
     const Table<2, Coupling> &       flux_mask,
     const types::subdomain_id        subdomain_id,
     const std::function<
-      bool(const typename DoFHandlerType::active_cell_iterator &,
+      bool(const typename DoFHandler<dim, spacedim>::active_cell_iterator &,
            const unsigned int)> &face_has_flux_coupling)
   {
     // do the error checking and frame code here, and then pass on to more
index 7b73d8c401b13a50f8387782b6521fdde163d458..235223deca53d2e6bea38622ea1efcc39b4ee107 100644 (file)
 //
 // ---------------------------------------------------------------------
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; scalar : REAL_SCALARS;
-     SP : SPARSITY_PATTERNS;
+for (scalar : REAL_SCALARS; SP : SPARSITY_PATTERNS;
      deal_II_dimension : DIMENSIONS)
   {
-    template void DoFTools::
-      make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>, SP, scalar>(
-        const DoFHandler<deal_II_dimension> &dof,
-        const std::map<types::boundary_id,
-                       const Function<deal_II_dimension, scalar> *>
-          &                                         boundary_ids,
-        const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-        SP &                                        sparsity);
+    template void DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,
+                                                           deal_II_dimension,
+                                                           SP,
+                                                           scalar>(
+      const DoFHandler<deal_II_dimension> &                        dof,
+      const std::map<types::boundary_id,
+                     const Function<deal_II_dimension, scalar> *> &boundary_ids,
+      const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
+      SP &                                        sparsity);
 
 #if deal_II_dimension < 3
 
-    template void DoFTools::make_boundary_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP,
-      scalar>(
+    template void
+    DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,
+                                             deal_II_dimension + 1,
+                                             SP,
+                                             scalar>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
       const std::map<types::boundary_id,
                      const Function<deal_II_dimension + 1, scalar> *>
@@ -42,10 +43,11 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; scalar : REAL_SCALARS;
 #endif
 
 #if deal_II_dimension == 1
-    template void DoFTools::make_boundary_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 2>,
-      SP,
-      scalar>(
+    template void
+    DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,
+                                             deal_II_dimension + 2,
+                                             SP,
+                                             scalar>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 2> &dof,
       const std::map<types::boundary_id,
                      const Function<deal_II_dimension + 2, scalar> *>
@@ -55,24 +57,25 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; scalar : REAL_SCALARS;
 #endif
   }
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; scalar : COMPLEX_SCALARS;
-     SP : SPARSITY_PATTERNS;
+for (scalar : COMPLEX_SCALARS; SP : SPARSITY_PATTERNS;
      deal_II_dimension : DIMENSIONS)
   {
-    template void DoFTools::
-      make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>, SP, scalar>(
-        const DoFHandler<deal_II_dimension> &dof,
-        const std::map<types::boundary_id,
-                       const Function<deal_II_dimension, scalar> *>
-          &                                         boundary_ids,
-        const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
-        SP &                                        sparsity);
+    template void DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,
+                                                           deal_II_dimension,
+                                                           SP,
+                                                           scalar>(
+      const DoFHandler<deal_II_dimension> &                        dof,
+      const std::map<types::boundary_id,
+                     const Function<deal_II_dimension, scalar> *> &boundary_ids,
+      const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
+      SP &                                        sparsity);
 
 #if deal_II_dimension < 3
-    template void DoFTools::make_boundary_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP,
-      scalar>(
+    template void
+    DoFTools::make_boundary_sparsity_pattern<deal_II_dimension,
+                                             deal_II_dimension + 1,
+                                             SP,
+                                             scalar>(
       const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
       const std::map<types::boundary_id,
                      const Function<deal_II_dimension + 1, scalar> *>
@@ -83,79 +86,78 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; scalar : COMPLEX_SCALARS;
 #endif
   }
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS;
-     deal_II_dimension : DIMENSIONS;
+for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS;
      S : REAL_AND_COMPLEX_SCALARS)
   {
-    template void DoFTools::make_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension> &dof,
-          SP &                                                    sparsity,
-          const AffineConstraints<S> &,
-          const bool,
-          const types::subdomain_id);
-
-    template void DoFTools::make_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension> &,
-          const Table<2, Coupling> &,
-          SP &,
-          const AffineConstraints<S> &,
-          const bool,
-          const types::subdomain_id);
-
     template void
-    DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>, SP>(
-      const DoFHandler<deal_II_dimension> &dof,
-      SP &                                 sparsity,
+    DoFTools::make_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+      const DoFHandler<deal_II_dimension, deal_II_dimension> &dof,
+      SP &                                                    sparsity,
       const AffineConstraints<S> &,
       const bool,
-      const Table<2, Coupling> &,
-      const Table<2, Coupling> &,
-      const types::subdomain_id,
-      const std::function<bool(
-        const typename DoFHandler<deal_II_dimension>::active_cell_iterator &,
-        const unsigned int)> &);
+      const types::subdomain_id);
 
     template void
-    DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>, SP>(
-      const DoFHandler<deal_II_dimension> &dof,
-      SP &                                 sparsity,
+    DoFTools::make_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+      const DoFHandler<deal_II_dimension, deal_II_dimension> &,
+      const Table<2, Coupling> &,
+      SP &,
       const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
+    template void DoFTools::
+      make_flux_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+        const DoFHandler<deal_II_dimension> &dof,
+        SP &                                 sparsity,
+        const AffineConstraints<S> &,
+        const bool,
+        const Table<2, Coupling> &,
+        const Table<2, Coupling> &,
+        const types::subdomain_id,
+        const std::function<bool(
+          const typename DoFHandler<deal_II_dimension>::active_cell_iterator &,
+          const unsigned int)> &);
+
+    template void DoFTools::
+      make_flux_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+        const DoFHandler<deal_II_dimension> &dof,
+        SP &                                 sparsity,
+        const AffineConstraints<S> &,
+        const bool,
+        const types::subdomain_id);
+
 #if deal_II_dimension < 3
 
-    template void DoFTools::make_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
-          SP &                                                        sparsity,
-          const AffineConstraints<S> &,
-          const bool,
-          const types::subdomain_id);
-
-    template void DoFTools::make_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
-          const Table<2, Coupling> &,
-          SP &,
-          const AffineConstraints<S> &,
-          const bool,
-          const types::subdomain_id);
+    template void DoFTools::
+      make_sparsity_pattern<deal_II_dimension, deal_II_dimension + 1, SP>(
+        const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
+        SP &                                                        sparsity,
+        const AffineConstraints<S> &,
+        const bool,
+        const types::subdomain_id);
+
+    template void DoFTools::
+      make_sparsity_pattern<deal_II_dimension, deal_II_dimension + 1, SP>(
+        const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
+        const Table<2, Coupling> &,
+        SP &,
+        const AffineConstraints<S> &,
+        const bool,
+        const types::subdomain_id);
 
 #endif
 
 #if deal_II_dimension == 3
 
-    template void DoFTools::make_sparsity_pattern<DoFHandler<1, 3>, SP>(
+    template void DoFTools::make_sparsity_pattern<1, 3, SP>(
       const DoFHandler<1, 3> &dof,
       SP &                    sparsity,
       const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
-    template void DoFTools::make_sparsity_pattern<DoFHandler<1, 3>, SP>(
+    template void DoFTools::make_sparsity_pattern<1, 3, SP>(
       const DoFHandler<1, 3> &,
       const Table<2, Coupling> &,
       SP &,
@@ -166,56 +168,56 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS;
 #endif
   }
 
-for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS;
-     deal_II_dimension : DIMENSIONS)
+for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
   {
-    template void DoFTools::make_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension> &dof_row,
-          const DoFHandler<deal_II_dimension, deal_II_dimension> &dof_col,
-          SP &                                                    sparsity);
-
     template void
-    DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>, SP>(
-      const DoFHandler<deal_II_dimension> &dof,
-      const std::vector<types::global_dof_index> &,
-      SP &);
+    DoFTools::make_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+      const DoFHandler<deal_II_dimension, deal_II_dimension> &dof_row,
+      const DoFHandler<deal_II_dimension, deal_II_dimension> &dof_col,
+      SP &                                                    sparsity);
 
-    template void
-    DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>, SP>(
-      const DoFHandler<deal_II_dimension> &dof, SP &sparsity);
+    template void DoFTools::
+      make_boundary_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+        const DoFHandler<deal_II_dimension> &dof,
+        const std::vector<types::global_dof_index> &,
+        SP &);
 
-    template void
-    DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>, SP>(
-      const DoFHandler<deal_II_dimension> &dof,
-      SP &                                 sparsity,
-      const Table<2, Coupling> &,
-      const Table<2, Coupling> &,
-      const types::subdomain_id);
+    template void DoFTools::
+      make_flux_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+        const DoFHandler<deal_II_dimension> &dof, SP &sparsity);
+
+    template void DoFTools::
+      make_flux_sparsity_pattern<deal_II_dimension, deal_II_dimension, SP>(
+        const DoFHandler<deal_II_dimension> &dof,
+        SP &                                 sparsity,
+        const Table<2, Coupling> &,
+        const Table<2, Coupling> &,
+        const types::subdomain_id);
 
 #if deal_II_dimension < 3
 
-    template void DoFTools::make_flux_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
-          SP &                                                        sparsity);
+    template void DoFTools::
+      make_flux_sparsity_pattern<deal_II_dimension, deal_II_dimension + 1, SP>(
+        const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
+        SP &                                                        sparsity);
 
-    template void DoFTools::make_flux_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
-          SP &                                                        sparsity,
-          const Table<2, Coupling> &,
-          const Table<2, Coupling> &,
-          const types::subdomain_id);
+    template void DoFTools::
+      make_flux_sparsity_pattern<deal_II_dimension, deal_II_dimension + 1, SP>(
+        const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
+        SP &                                                        sparsity,
+        const Table<2, Coupling> &,
+        const Table<2, Coupling> &,
+        const types::subdomain_id);
 
-    template void DoFTools::make_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_row,
-          const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_col,
-          SP &                                                        sparsity);
+    template void DoFTools::
+      make_sparsity_pattern<deal_II_dimension, deal_II_dimension + 1, SP>(
+        const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_row,
+        const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_col,
+        SP &                                                        sparsity);
 
     template void DoFTools::make_boundary_sparsity_pattern<
-      DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
+      deal_II_dimension,
+      deal_II_dimension + 1,
       SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
           const std::vector<types::global_dof_index> &,
           SP &);
@@ -225,21 +227,20 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; SP : SPARSITY_PATTERNS;
 
 #if deal_II_dimension == 3
 
-    template void DoFTools::make_sparsity_pattern<DoFHandler<1, 3>, SP>(
+    template void DoFTools::make_sparsity_pattern<1, 3, SP>(
       const DoFHandler<1, 3> &dof_row,
       const DoFHandler<1, 3> &dof_col,
       SP &                    sparsity);
 
-    template void
-    DoFTools::make_boundary_sparsity_pattern<DoFHandler<1, 3>, SP>(
+    template void DoFTools::make_boundary_sparsity_pattern<1, 3, SP>(
       const DoFHandler<1, 3> &dof,
       const std::vector<types::global_dof_index> &,
       SP &);
 
-    template void DoFTools::make_flux_sparsity_pattern<DoFHandler<1, 3>, SP>(
+    template void DoFTools::make_flux_sparsity_pattern<1, 3, SP>(
       const DoFHandler<1, 3> &dof, SP &sparsity);
 
-    template void DoFTools::make_flux_sparsity_pattern<DoFHandler<1, 3>, SP>(
+    template void DoFTools::make_flux_sparsity_pattern<1, 3, SP>(
       const DoFHandler<1, 3> &dof,
       SP &                    sparsity,
       const Table<2, Coupling> &,
index e519ef601baa83ccafcbff10c095128f428c0f68..e33c86e778487cb332e2666653548494aeef7fb2 100644 (file)
@@ -1105,7 +1105,7 @@ namespace MGTools
                                 const DoFHandler<dim, spacedim> &,
                                 const ComponentMask &,
                                 std::vector<bool> &) =
-                  &DoFTools::extract_level_dofs<DoFHandler<dim, spacedim>>;
+                  &DoFTools::extract_level_dofs<dim, spacedim>;
 
                 std::vector<bool> tmp(n_components, false);
                 tmp[i]              = true;
@@ -1216,7 +1216,8 @@ namespace MGTools
                             const DoFHandlerType &,
                             const BlockMask &,
                             std::vector<bool> &) =
-              &DoFTools::extract_level_dofs<DoFHandlerType>;
+              &DoFTools::extract_level_dofs<DoFHandlerType::dimension,
+                                            DoFHandlerType::space_dimension>;
 
             std::vector<bool> tmp(n_blocks, false);
             tmp[i]          = true;
index 69f0e6ba5e9b29e3a5646cf9c371ce1f17d66ada..6397acbae7ace13042ad27dd82133bce93ab3028 100644 (file)
@@ -443,7 +443,7 @@ namespace LaplaceSolver
   {
     hanging_node_constraints.clear();
 
-    void (*mhnc_p)(const hp::DoFHandler<dim> &, AffineConstraints<double> &) =
+    void (*mhnc_p)(const DoFHandler<dim> &, AffineConstraints<double> &) =
       &DoFTools::make_hanging_node_constraints;
 
     Threads::Thread<> mhnc_thread =

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.