]> https://gitweb.dealii.org/ - dealii.git/commitdiff
RCM: Update dofs, part 2: dof_tools
authorMatthias Maier <tamiko@43-1.org>
Fri, 25 May 2018 18:35:17 +0000 (13:35 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 6 Jun 2018 15:19:38 +0000 (10:19 -0500)
TODO: Complexify make_periodicity_constraints

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

index 2bcbe24247b36f09edf18f8e0808b599b0fc1ccf..09434fae1a795c7ee6de767230d59574a3740f34 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <deal.II/hp/dof_handler.h>
 
-#include <deal.II/lac/constraint_matrix.h>
+#include <deal.II/lac/affine_constraints.h>
 
 #include <map>
 #include <ostream>
@@ -492,23 +492,24 @@ namespace DoFTools
    * entries.
    *
    * @param[in] constraints The process for generating entries described above
-   * is purely local to each cell. Consequently, the sparsity pattern does not
-   * provide for matrix entries that will only be written into during the
-   * elimination of hanging nodes or other constraints. They have to be taken
-   * care of by a subsequent call to ConstraintMatrix::condense().
-   * Alternatively, the constraints on degrees of freedom can already be taken
-   * into account at the time of creating the sparsity pattern. For this, pass
-   * the ConstraintMatrix object as the third argument to the current
-   * function. No call to ConstraintMatrix::condense() is then necessary. This
-   * process is explained in step-6, step-27, and other tutorial programs.
+   * is purely local to each cell. Consequently, the sparsity pattern does
+   * not provide for matrix entries that will only be written into during
+   * the elimination of hanging nodes or other constraints. They have to be
+   * taken care of by a subsequent call to AffineConstraints::condense().
+   * Alternatively, the constraints on degrees of freedom can already be
+   * taken into account at the time of creating the sparsity pattern. For
+   * this, pass the AffineConstraints object as the third argument to the
+   * current function. No call to AffineConstraints::condense() is then
+   * necessary. This process is explained in step-6, step-27, and other
+   * tutorial programs.
    *
    * @param[in] keep_constrained_dofs In case the constraints are already
-   * taken care of in this function by passing in a ConstraintMatrix object,
+   * taken care of in this function by passing in a AffineConstraints object,
    * it is possible to abandon some off-diagonal entries in the sparsity
    * pattern if these entries will also not be written into during the actual
    * assembly of the matrix this sparsity pattern later serves. Specifically,
    * when using an assembly method that uses
-   * ConstraintMatrix::distribute_local_to_global(), no entries will ever be
+   * AffineConstraints::distribute_local_to_global(), no entries will ever be
    * written into those matrix rows or columns that correspond to constrained
    * degrees of freedom. In such cases, you can set the argument @p
    * keep_constrained_dofs to @p false to avoid allocating these entries in
@@ -548,13 +549,15 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number = double>
   void
   make_sparsity_pattern(
-    const DoFHandlerType &    dof_handler,
-    SparsityPatternType &     sparsity_pattern,
-    const ConstraintMatrix &  constraints           = ConstraintMatrix(),
-    const bool                keep_constrained_dofs = true,
+    const DoFHandlerType &           dof_handler,
+    SparsityPatternType &            sparsity_pattern,
+    const AffineConstraints<number> &constraints = AffineConstraints<number>(),
+    const bool                       keep_constrained_dofs = true,
     const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id);
 
   /**
@@ -622,14 +625,16 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number>
   void
   make_sparsity_pattern(
-    const DoFHandlerType &    dof_handler,
-    const Table<2, Coupling> &coupling,
-    SparsityPatternType &     sparsity_pattern,
-    const ConstraintMatrix &  constraints           = ConstraintMatrix(),
-    const bool                keep_constrained_dofs = true,
+    const DoFHandlerType &           dof_handler,
+    const Table<2, Coupling> &       coupling,
+    SparsityPatternType &            sparsity_pattern,
+    const AffineConstraints<number> &constraints = AffineConstraints<number>(),
+    const bool                       keep_constrained_dofs = true,
     const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id);
 
   /**
@@ -716,15 +721,18 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number>
   void
   make_flux_sparsity_pattern(
-    const DoFHandlerType &    dof_handler,
-    SparsityPatternType &     sparsity_pattern,
-    const ConstraintMatrix &  constraints,
-    const bool                keep_constrained_dofs = true,
+    const DoFHandlerType &           dof_handler,
+    SparsityPatternType &            sparsity_pattern,
+    const AffineConstraints<number> &constraints,
+    const bool                       keep_constrained_dofs = true,
     const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id);
 
+
   /**
    * This function does essentially the same as the other
    * make_flux_sparsity_pattern() function but allows the specification of
@@ -752,6 +760,8 @@ namespace DoFTools
     const Table<2, Coupling> &cell_integrals_mask,
     const Table<2, Coupling> &face_integrals_mask,
     const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id);
+
+
   /**
    * This function does essentially the same as the previous
    * make_flux_sparsity_pattern() function but allows the application of
@@ -760,11 +770,13 @@ namespace DoFTools
    * constraints to be imposed on the continuous part while also building
    * the flux terms needed for the discontinuous part.
    */
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number>
   void
-  make_flux_sparsity_pattern(const DoFHandlerType &    dof,
-                             SparsityPatternType &     sparsity,
-                             const ConstraintMatrix &  constraints,
+  make_flux_sparsity_pattern(const DoFHandlerType &           dof,
+                             SparsityPatternType &            sparsity,
+                             const AffineConstraints<number> &constraints,
                              const bool                keep_constrained_dofs,
                              const Table<2, Coupling> &couplings,
                              const Table<2, Coupling> &face_couplings,
@@ -846,7 +858,7 @@ namespace DoFTools
    * This function does not clear the constraint matrix object before use, in
    * order to allow adding constraints from different sources to the same
    * object. You therefore need to make sure it contains only constraints you
-   * still want; otherwise call the ConstraintMatrix::clear() function.
+   * still want; otherwise call the AffineConstraints::clear() function.
    * Since this function does not check if it would add cycles in
    * @p constraints, it is recommended to call this function prior to other
    * functions that constrain DoFs with respect to others such as
@@ -865,10 +877,10 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <typename DoFHandlerType>
+  template <typename DoFHandlerType, typename number>
   void
-  make_hanging_node_constraints(const DoFHandlerType &dof_handler,
-                                ConstraintMatrix &    constraints);
+  make_hanging_node_constraints(const DoFHandlerType &     dof_handler,
+                                AffineConstraints<number> &constraints);
 
   /**
    * This function is used when different variables in a problem are
@@ -891,7 +903,7 @@ namespace DoFTools
    * functions $v\in {\cal V}_1$. In other words, every function $v_h=\sum_j
    * V_j \varphi_j^{(1)} \in {\cal V}_1$ that also satisfies $v_h\in {\cal
    * V}_0$ automatically satisfies $CV=0$. This function computes the matrix
-   * $C$ in the form of a ConstraintMatrix object.
+   * $C$ in the form of a AffineConstraints object.
    *
    * The construction of these constraints is done as follows: for each of the
    * degrees of freedom (i.e. shape functions) on the coarse grid, we compute
@@ -935,7 +947,7 @@ namespace DoFTools
    * it as an argument.
    *
    * The computed constraints are entered into a variable of type
-   * ConstraintMatrix; previous contents are not deleted.
+   * AffineConstraints; previous contents are not deleted.
    */
   template <int dim, int spacedim>
   void
@@ -945,7 +957,7 @@ namespace DoFTools
     const DoFHandler<dim, spacedim> &              fine_grid,
     const unsigned int                             fine_component,
     const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
-    ConstraintMatrix &                             constraints);
+    AffineConstraints<double> &                    constraints);
 
 
   /**
@@ -987,7 +999,7 @@ namespace DoFTools
 
   /**
    * Insert the (algebraic) constraints due to periodic boundary conditions
-   * into a ConstraintMatrix @p constraint_matrix.
+   * into an AffineConstraints object @p constraints.
    *
    * Given a pair of not necessarily active boundary faces @p face_1 and @p
    * face_2, this functions constrains all DoFs associated with the boundary
@@ -995,7 +1007,7 @@ namespace DoFTools
    * by @p face_2. More precisely:
    *
    * If @p face_1 and @p face_2 are both active faces it adds the DoFs of @p
-   * face_1 to the list of constrained DoFs in @p constraint_matrix and adds
+   * face_1 to the list of constrained DoFs in @p constraints and adds
    * entries to constrain them to the corresponding values of the DoFs on @p
    * face_2. This happens on a purely algebraic level, meaning, the global DoF
    * with (local face) index <tt>i</tt> on @p face_1 gets constraint to the
@@ -1130,7 +1142,7 @@ namespace DoFTools
    * interpolation matrix with size no_face_dofs $\times$ no_face_dofs.
    *
    * This function makes sure that identity constraints don't create cycles
-   * in @p constraint_matrix.
+   * in @p constraints.
    *
    * Detailed information can be found in the see
    * @ref GlossPeriodicConstraints "Glossary entry on periodic boundary conditions".
@@ -1142,7 +1154,7 @@ namespace DoFTools
   make_periodicity_constraints(
     const FaceIterator &                         face_1,
     const typename identity<FaceIterator>::type &face_2,
-    dealii::ConstraintMatrix &                   constraint_matrix,
+    AffineConstraints<double> &                  constraints,
     const ComponentMask &            component_mask   = ComponentMask(),
     const bool                       face_orientation = true,
     const bool                       face_flip        = false,
@@ -1155,7 +1167,7 @@ namespace DoFTools
 
   /**
    * Insert the (algebraic) constraints due to periodic boundary conditions
-   * into a ConstraintMatrix @p constraint_matrix.
+   * into an AffineConstraints object @p constraints.
    *
    * This is the main high level interface for above low level variant of
    * make_periodicity_constraints(). It takes a std::vector @p periodic_faces
@@ -1180,7 +1192,7 @@ namespace DoFTools
     const std::vector<
       GridTools::PeriodicFacePair<typename DoFHandlerType::cell_iterator>>
       &                              periodic_faces,
-    dealii::ConstraintMatrix &       constraint_matrix,
+    AffineConstraints<double> &      constraints,
     const ComponentMask &            component_mask = ComponentMask(),
     const std::vector<unsigned int> &first_vector_components =
       std::vector<unsigned int>());
@@ -1189,7 +1201,7 @@ namespace DoFTools
 
   /**
    * Insert the (algebraic) constraints due to periodic boundary conditions
-   * into a ConstraintMatrix @p constraint_matrix.
+   * into a AffineConstraints @p constraints.
    *
    * This function serves as a high level interface for the
    * make_periodicity_constraints() function.
@@ -1220,12 +1232,12 @@ namespace DoFTools
   template <typename DoFHandlerType>
   void
   make_periodicity_constraints(
-    const DoFHandlerType &    dof_handler,
-    const types::boundary_id  b_id1,
-    const types::boundary_id  b_id2,
-    const int                 direction,
-    dealii::ConstraintMatrix &constraint_matrix,
-    const ComponentMask &     component_mask = ComponentMask());
+    const DoFHandlerType &     dof_handler,
+    const types::boundary_id   b_id1,
+    const types::boundary_id   b_id2,
+    const int                  direction,
+    AffineConstraints<double> &constraints,
+    const ComponentMask &      component_mask = ComponentMask());
 
 
 
@@ -1256,11 +1268,11 @@ namespace DoFTools
   template <typename DoFHandlerType>
   void
   make_periodicity_constraints(
-    const DoFHandlerType &    dof_handler,
-    const types::boundary_id  b_id,
-    const int                 direction,
-    dealii::ConstraintMatrix &constraint_matrix,
-    const ComponentMask &     component_mask = ComponentMask());
+    const DoFHandlerType &     dof_handler,
+    const types::boundary_id   b_id,
+    const int                  direction,
+    AffineConstraints<double> &constraints,
+    const ComponentMask &      component_mask = ComponentMask());
 
   /**
    * @}
@@ -1549,22 +1561,22 @@ namespace DoFTools
    * Essentially, the question this functions answers is the following:
    * Given a subdomain with associated DoFs, what is the largest subset of
    * these DoFs that are allowed to be non-zero such that after calling
-   * ConstraintMatrix::distribute() the resulting solution vector will have
-   * support only within the given domain. Here @p cm is the ConstraintMatrix
-   * containing hanging nodes constraints.
+   * AffineConstraints::distribute() the resulting solution vector will have
+   * support only within the given domain. Here, @p constraints is the
+   * AffineConstraints container containing hanging nodes constraints.
    *
    * In case of parallel::distributed::Triangulation @p predicate will be called
    * only for locally owned and ghost cells. The resulting index set may contain
    * DoFs that are associated with the locally owned or ghost cells, but are not
    * owned by the current MPI core.
    */
-  template <typename DoFHandlerType>
+  template <typename DoFHandlerType, typename number>
   IndexSet
   extract_dofs_with_support_contained_within(
     const DoFHandlerType &dof_handler,
     const std::function<
       bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate,
-    const ConstraintMatrix &cm = ConstraintMatrix());
+    const AffineConstraints<number> &constraints = AffineConstraints<number>());
 
   /**
    * Extract a vector that represents the constant modes of the DoFHandler for
@@ -2389,7 +2401,7 @@ namespace DoFTools
    * results, which can then be further processed, e.g. for output. You should
    * note that the resulting field will not be continuous at hanging nodes.
    * This can, however, easily be arranged by calling the appropriate @p
-   * distribute function of a ConstraintMatrix object created for this
+   * distribute function of an AffineConstraints object created for this
    * DoFHandler object, after the vector has been fully assembled.
    *
    * It is assumed that the number of elements in @p cell_data equals the
@@ -2539,12 +2551,15 @@ namespace DoFTools
    * @see
    * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators"
    */
-  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
+  template <int dim,
+            int spacedim,
+            template <int, int> class DoFHandlerType,
+            typename number>
   void
   make_zero_boundary_constraints(
     const DoFHandlerType<dim, spacedim> &dof,
     const types::boundary_id             boundary_id,
-    ConstraintMatrix &                   zero_boundary_constraints,
+    AffineConstraints<number> &          zero_boundary_constraints,
     const ComponentMask &                component_mask = ComponentMask());
 
   /**
@@ -2557,11 +2572,14 @@ namespace DoFTools
    *
    * @ingroup constraints
    */
-  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
+  template <int dim,
+            int spacedim,
+            template <int, int> class DoFHandlerType,
+            typename number>
   void
   make_zero_boundary_constraints(
     const DoFHandlerType<dim, spacedim> &dof,
-    ConstraintMatrix &                   zero_boundary_constraints,
+    AffineConstraints<number> &          zero_boundary_constraints,
     const ComponentMask &                component_mask = ComponentMask());
 
   /**
index 3b64d1e16a8f79b0b262523515514d0baa69d0d7..755df3315263acb87b516a266179f37fc8790693 100644 (file)
@@ -42,8 +42,8 @@
 #include <deal.II/hp/mapping_collection.h>
 #include <deal.II/hp/q_collection.h>
 
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/block_sparsity_pattern.h>
-#include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/lac/dynamic_sparsity_pattern.h>
 #include <deal.II/lac/sparsity_pattern.h>
 #include <deal.II/lac/trilinos_sparsity_pattern.h>
@@ -810,13 +810,13 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <typename DoFHandlerType, typename number>
   IndexSet
   extract_dofs_with_support_contained_within(
     const DoFHandlerType &dof_handler,
     const std::function<
       bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate,
-    const ConstraintMatrix &                                        cm)
+    const AffineConstraints<number> &                               cm)
   {
     const std::function<bool(
       const typename DoFHandlerType::active_cell_iterator &)>
@@ -888,8 +888,7 @@ namespace DoFTools
           // if halo DoF is constrained, add all DoFs to which it's constrained
           // because after resolving constraints, the support of the DoFs that
           // constrain the current DoF will extend to the halo cells.
-          if (const std::vector<std::pair<types::global_dof_index, double>>
-                *line_ptr = cm.get_constraint_entries(*it))
+          if (const auto *line_ptr = cm.get_constraint_entries(*it))
             {
               const unsigned int line_size = line_ptr->size();
               for (unsigned int j = 0; j < line_size; ++j)
index ac454fe1186f27189c96a174ec623c45d4dc9b71..3d55ba3e55da95c352ad2aed4a61a3f3d2fe5fe8 100644 (file)
@@ -176,14 +176,6 @@ for (deal_II_dimension : DIMENSIONS)
       std::vector<bool> &,
       const std::set<types::boundary_id> &);
 
-    template IndexSet DoFTools::extract_dofs_with_support_contained_within<
-      DoFHandler<deal_II_dimension>>(
-      const DoFHandler<deal_II_dimension> &,
-      const std::function<bool(
-        const typename DoFHandler<deal_II_dimension>::active_cell_iterator &)>
-        &,
-      const ConstraintMatrix &);
-
     template void DoFTools::extract_hanging_node_dofs(
       const DoFHandler<deal_II_dimension> &dof_handler,
       std::vector<bool> &                  selected_dofs);
@@ -658,6 +650,19 @@ for (deal_II_dimension : DIMENSIONS)
   }
 
 
+for (deal_II_dimension : DIMENSIONS; S : REAL_AND_COMPLEX_SCALARS)
+  {
+    template IndexSet DoFTools::extract_dofs_with_support_contained_within<
+      DoFHandler<deal_II_dimension>,
+      S>(
+      const DoFHandler<deal_II_dimension> &,
+      const std::function<bool(
+        const typename DoFHandler<deal_II_dimension>::active_cell_iterator &)>
+        &,
+      const AffineConstraints<S> &);
+  }
+
+
 for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
index b5dcccdb98d794cf19560f34cab9748d0e5e5ad6..d9d06f5eabe487c850ce3033d255b7c0a092c0ec 100644 (file)
@@ -35,7 +35,7 @@
 #include <deal.II/hp/fe_collection.h>
 #include <deal.II/hp/fe_values.h>
 
-#include <deal.II/lac/constraint_matrix.h>
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/vector.h>
 
 #ifdef DEAL_II_WITH_MPI
@@ -480,12 +480,13 @@ namespace DoFTools
        * It also suppresses very small entries in the constraint matrix to
        * avoid making the sparsity pattern fuller than necessary.
        */
+      template <typename number>
       void
       filter_constraints(
         const std::vector<types::global_dof_index> &master_dofs,
         const std::vector<types::global_dof_index> &slave_dofs,
-        const FullMatrix<double> &                  face_constraints,
-        ConstraintMatrix &                          constraints)
+        const FullMatrix<number> &                  face_constraints,
+        AffineConstraints<number> &                 constraints)
       {
         Assert(face_constraints.n() == master_dofs.size(),
                ExcDimensionMismatch(master_dofs.size(), face_constraints.n()));
@@ -525,7 +526,7 @@ namespace DoFTools
                 {
                   // add up the absolute values of all constraints in this
                   // line to get a measure of their absolute size
-                  double abs_sum = 0;
+                  number abs_sum = 0;
                   for (unsigned int i = 0; i < n_master_dofs; ++i)
                     abs_sum += std::abs(face_constraints(row, i));
 
@@ -552,29 +553,30 @@ namespace DoFTools
     } // namespace
 
 
-
+    template <typename number>
     void
     make_hp_hanging_node_constraints(const dealii::DoFHandler<1> &,
-                                     ConstraintMatrix &)
+                                     AffineConstraints<number> &)
     {
       // nothing to do for regular dof handlers in 1d
     }
 
 
-
+    template <typename number>
     void
     make_oldstyle_hanging_node_constraints(const dealii::DoFHandler<1> &,
-                                           ConstraintMatrix &,
+                                           AffineConstraints<number> &,
                                            std::integral_constant<int, 1>)
     {
       // nothing to do for regular dof handlers in 1d
     }
 
 
+    template <typename number>
     void
     make_hp_hanging_node_constraints(
       const dealii::hp::DoFHandler<1> & /*dof_handler*/,
-      ConstraintMatrix & /*constraints*/)
+      AffineConstraints<number> & /*constraints*/)
     {
       // we may have to compute constraints for vertices. gotta think about
       // that a bit more
@@ -583,11 +585,11 @@ namespace DoFTools
     }
 
 
-
+    template <typename number>
     void
     make_oldstyle_hanging_node_constraints(
       const dealii::hp::DoFHandler<1> & /*dof_handler*/,
-      ConstraintMatrix & /*constraints*/,
+      AffineConstraints<number> & /*constraints*/,
       std::integral_constant<int, 1>)
     {
       // we may have to compute constraints for vertices. gotta think about
@@ -597,86 +599,51 @@ namespace DoFTools
     }
 
 
+    template <typename number>
     void
     make_hp_hanging_node_constraints(const dealii::DoFHandler<1, 2> &,
-                                     ConstraintMatrix &)
+                                     AffineConstraints<number> &)
     {
       // nothing to do for regular dof handlers in 1d
     }
 
 
-
+    template <typename number>
     void
     make_oldstyle_hanging_node_constraints(const dealii::DoFHandler<1, 2> &,
-                                           ConstraintMatrix &,
+                                           AffineConstraints<number> &,
                                            std::integral_constant<int, 1>)
     {
       // nothing to do for regular dof handlers in 1d
     }
 
 
+    template <typename number>
     void
     make_hp_hanging_node_constraints(const dealii::DoFHandler<1, 3> &,
-                                     ConstraintMatrix &)
+                                     AffineConstraints<number> &)
     {
       // nothing to do for regular dof handlers in 1d
     }
 
+
+    template <typename number>
     void
     make_oldstyle_hanging_node_constraints(const dealii::DoFHandler<1, 3> &,
-                                           ConstraintMatrix &,
+                                           AffineConstraints<number> &,
                                            std::integral_constant<int, 1>)
     {
       // nothing to do for regular dof handlers in 1d
     }
 
 
-    //   currently not used but may be in the future:
-
-    //     void
-    //     make_hp_hanging_node_constraints (const dealii::MDoFHandler<1,2> &,
-    //                                    ConstraintMatrix    &)
-    //     {
-    //                                     // nothing to do for regular
-    //                                     // dof handlers in 1d
-    //     }
-
-
-
-    //     void
-    //     make_oldstyle_hanging_node_constraints (const dealii::DoFHandler<1,2>
-    //     &,
-    //                                          ConstraintMatrix    &,
-    //                                          std::integral_constant<int, 1>)
-    //     {
-    //                                     // nothing to do for regular
-    //                                     // dof handlers in 1d
-    //     }
-
-
-    //     void
-    //     make_oldstyle_hanging_node_constraints (const
-    //     dealii::hp::DoFHandler<1,2> &/*dof_handler*/,
-    //                                          ConstraintMatrix
-    //                                          &/*constraints*/,
-    //                                          std::integral_constant<int, 1>)
-    //     {
-    //                                     // we may have to compute
-    //                                     // constraints for
-    //                                     // vertices. gotta think about
-    //                                     // that a bit more
-    //
-    // //TODO[WB]: think about what to do here...
-    //     }
-    //#endif
 
-
-
-    template <typename DoFHandlerType>
+    template <typename DoFHandlerType, typename number>
     void
-    make_oldstyle_hanging_node_constraints(const DoFHandlerType &dof_handler,
-                                           ConstraintMatrix &    constraints,
-                                           std::integral_constant<int, 2>)
+    make_oldstyle_hanging_node_constraints(
+      const DoFHandlerType &     dof_handler,
+      AffineConstraints<number> &constraints,
+      std::integral_constant<int, 2>)
     {
       const unsigned int dim = 2;
 
@@ -823,11 +790,12 @@ namespace DoFTools
 
 
 
-    template <typename DoFHandlerType>
+    template <typename DoFHandlerType, typename number>
     void
-    make_oldstyle_hanging_node_constraints(const DoFHandlerType &dof_handler,
-                                           ConstraintMatrix &    constraints,
-                                           std::integral_constant<int, 3>)
+    make_oldstyle_hanging_node_constraints(
+      const DoFHandlerType &     dof_handler,
+      AffineConstraints<number> &constraints,
+      std::integral_constant<int, 3>)
     {
       const unsigned int dim = 3;
 
@@ -1064,10 +1032,10 @@ namespace DoFTools
 
 
 
-    template <typename DoFHandlerType>
+    template <typename DoFHandlerType, typename number>
     void
-    make_hp_hanging_node_constraints(const DoFHandlerType &dof_handler,
-                                     ConstraintMatrix &    constraints)
+    make_hp_hanging_node_constraints(const DoFHandlerType &     dof_handler,
+                                     AffineConstraints<number> &constraints)
     {
       // note: this function is going to be hard to understand if you
       // haven't read the hp paper. however, we try to follow the notation
@@ -1082,7 +1050,7 @@ namespace DoFTools
       // a matrix to be used for constraints below. declared here and
       // simply resized down below to avoid permanent re-allocation of
       // memory
-      FullMatrix<double> constraint_matrix;
+      FullMatrix<number> constraint_matrix;
 
       // similarly have arrays that will hold master and slave dof numbers,
       // as well as a scratch array needed for the complicated case below
@@ -1094,9 +1062,9 @@ namespace DoFTools
       // different (or the same) finite elements. we compute them only
       // once, namely the first time they are needed, and then just reuse
       // them
-      Table<2, std::unique_ptr<FullMatrix<double>>> face_interpolation_matrices(
+      Table<2, std::unique_ptr<FullMatrix<number>>> face_interpolation_matrices(
         n_finite_elements(dof_handler), n_finite_elements(dof_handler));
-      Table<3, std::unique_ptr<FullMatrix<double>>>
+      Table<3, std::unique_ptr<FullMatrix<number>>>
         subface_interpolation_matrices(
           n_finite_elements(dof_handler),
           n_finite_elements(dof_handler),
@@ -1107,7 +1075,7 @@ namespace DoFTools
       // these two matrices are derived from the face interpolation matrix
       // as described in the @ref hp_paper "hp paper"
       Table<2,
-            std::unique_ptr<std::pair<FullMatrix<double>, FullMatrix<double>>>>
+            std::unique_ptr<std::pair<FullMatrix<number>, FullMatrix<number>>>>
         split_face_interpolation_matrices(n_finite_elements(dof_handler),
                                           n_finite_elements(dof_handler));
 
@@ -1381,13 +1349,13 @@ namespace DoFTools
                           split_face_interpolation_matrices
                             [dominating_fe_index][cell->active_fe_index()]);
 
-                        const FullMatrix<double>
+                        const FullMatrix<number>
                           &restrict_mother_to_virtual_master_inv =
                             (split_face_interpolation_matrices
                                [dominating_fe_index][cell->active_fe_index()]
                                  ->first);
 
-                        const FullMatrix<double>
+                        const FullMatrix<number>
                           &restrict_mother_to_virtual_slave =
                             (split_face_interpolation_matrices
                                [dominating_fe_index][cell->active_fe_index()]
@@ -1472,7 +1440,7 @@ namespace DoFTools
                               subface_interpolation_matrices
                                 [dominating_fe_index][subface_fe_index][sf]);
 
-                            const FullMatrix<double>
+                            const FullMatrix<number>
                               &restrict_subface_to_virtual = *(
                                 subface_interpolation_matrices
                                   [dominating_fe_index][subface_fe_index][sf]);
@@ -1691,13 +1659,13 @@ namespace DoFTools
                                 [dominating_fe_index][cell->active_fe_index()]);
 
                             const FullMatrix<
-                              double> &restrict_mother_to_virtual_master_inv =
+                              number> &restrict_mother_to_virtual_master_inv =
                               (split_face_interpolation_matrices
                                  [dominating_fe_index][cell->active_fe_index()]
                                    ->first);
 
                             const FullMatrix<
-                              double> &restrict_mother_to_virtual_slave =
+                              number> &restrict_mother_to_virtual_slave =
                               (split_face_interpolation_matrices
                                  [dominating_fe_index][cell->active_fe_index()]
                                    ->second);
@@ -1756,7 +1724,7 @@ namespace DoFTools
                                 [dominating_fe_index]
                                 [neighbor->active_fe_index()]);
 
-                            const FullMatrix<double>
+                            const FullMatrix<number>
                               &restrict_secondface_to_virtual =
                                 *(face_interpolation_matrices
                                     [dominating_fe_index]
@@ -1800,10 +1768,10 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType>
+  template <typename DoFHandlerType, typename number>
   void
-  make_hanging_node_constraints(const DoFHandlerType &dof_handler,
-                                ConstraintMatrix &    constraints)
+  make_hanging_node_constraints(const DoFHandlerType &     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
@@ -1827,9 +1795,9 @@ namespace DoFTools
      *
      * Internally used in make_periodicity_constraints.
      *
-     * enter constraints for periodicity into the given ConstraintMatrix object.
-     * this function is called when at least one of the two face iterators
-     * corresponds to an active object without further children
+     * enter constraints for periodicity into the given AffineConstraints
+     * object. this function is called when at least one of the two face
+     * iterators corresponds to an active object without further children
      *
      * @param transformation A matrix that maps degrees of freedom from one face
      * to another. If the DoFs on the two faces are supposed to match exactly,
@@ -1851,7 +1819,7 @@ namespace DoFTools
       const FaceIterator &                         face_1,
       const typename identity<FaceIterator>::type &face_2,
       const FullMatrix<double> &                   transformation,
-      dealii::ConstraintMatrix &                   constraint_matrix,
+      AffineConstraints<double> &                  constraint_matrix,
       const ComponentMask &                        component_mask,
       const bool                                   face_orientation,
       const bool                                   face_flip,
@@ -2360,7 +2328,7 @@ namespace DoFTools
   make_periodicity_constraints(
     const FaceIterator &                         face_1,
     const typename identity<FaceIterator>::type &face_2,
-    dealii::ConstraintMatrix &                   constraint_matrix,
+    AffineConstraints<double> &                  constraint_matrix,
     const ComponentMask &                        component_mask,
     const bool                                   face_orientation,
     const bool                                   face_flip,
@@ -2590,7 +2558,7 @@ namespace DoFTools
     const std::vector<
       GridTools::PeriodicFacePair<typename DoFHandlerType::cell_iterator>>
       &                              periodic_faces,
-    dealii::ConstraintMatrix &       constraint_matrix,
+    AffineConstraints<double> &      constraints,
     const ComponentMask &            component_mask,
     const std::vector<unsigned int> &first_vector_components)
   {
@@ -2617,7 +2585,7 @@ namespace DoFTools
         // every matching pair:
         make_periodicity_constraints(face_1,
                                      face_2,
-                                     constraint_matrix,
+                                     constraints,
                                      component_mask,
                                      it->orientation[0],
                                      it->orientation[1],
@@ -2633,12 +2601,12 @@ namespace DoFTools
 
   template <typename DoFHandlerType>
   void
-  make_periodicity_constraints(const DoFHandlerType &    dof_handler,
-                               const types::boundary_id  b_id1,
-                               const types::boundary_id  b_id2,
-                               const int                 direction,
-                               dealii::ConstraintMatrix &constraint_matrix,
-                               const ComponentMask &     component_mask)
+  make_periodicity_constraints(const DoFHandlerType &             dof_handler,
+                               const types::boundary_id           b_id1,
+                               const types::boundary_id           b_id2,
+                               const int                          direction,
+                               dealii::AffineConstraints<double> &constraints,
+                               const ComponentMask &component_mask)
   {
     static const int space_dim = DoFHandlerType::space_dimension;
     (void)space_dim;
@@ -2658,18 +2626,18 @@ namespace DoFTools
       dof_handler, b_id1, b_id2, direction, matched_faces);
 
     make_periodicity_constraints<DoFHandlerType>(
-      matched_faces, constraint_matrix, component_mask);
+      matched_faces, constraints, component_mask);
   }
 
 
 
   template <typename DoFHandlerType>
   void
-  make_periodicity_constraints(const DoFHandlerType &    dof_handler,
-                               const types::boundary_id  b_id,
-                               const int                 direction,
-                               dealii::ConstraintMatrix &constraint_matrix,
-                               const ComponentMask &     component_mask)
+  make_periodicity_constraints(const DoFHandlerType &     dof_handler,
+                               const types::boundary_id   b_id,
+                               const int                  direction,
+                               AffineConstraints<double> &constraints,
+                               const ComponentMask &      component_mask)
   {
     static const int dim       = DoFHandlerType::dimension;
     static const int space_dim = DoFHandlerType::space_dimension;
@@ -2690,7 +2658,7 @@ namespace DoFTools
       dof_handler, b_id, direction, matched_faces);
 
     make_periodicity_constraints<DoFHandlerType>(
-      matched_faces, constraint_matrix, component_mask);
+      matched_faces, constraints, component_mask);
   }
 
 
@@ -3231,7 +3199,7 @@ namespace DoFTools
     const DoFHandler<dim, spacedim> &              fine_grid,
     const unsigned int                             fine_component,
     const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
-    ConstraintMatrix &                             constraints)
+    AffineConstraints<double> &                    constraints)
   {
     // store the weights with which a dof on the parameter grid contributes
     // to a dof on the fine grid. see the long doc below for more info
@@ -3342,7 +3310,7 @@ namespace DoFTools
     // note for people that want to optimize this function: the largest
     // part of the computing time is spent in the following, rather
     // innocent block of code. basically, it must be the
-    // ConstraintMatrix::add_entry call which takes the bulk of the time,
+    // AffineConstraints::add_entry call which takes the bulk of the time,
     // but it is not known to the author how to make it faster...
     std::vector<std::pair<types::global_dof_index, double>> constraint_line;
     for (types::global_dof_index global_dof = 0; global_dof < n_fine_dofs;
@@ -3501,12 +3469,16 @@ namespace DoFTools
 
 
 
-  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
+  template <int dim,
+            int spacedim,
+            template <int, int> class DoFHandlerType,
+            typename number>
   void
-  make_zero_boundary_constraints(const DoFHandlerType<dim, spacedim> &dof,
-                                 const types::boundary_id boundary_id,
-                                 ConstraintMatrix &   zero_boundary_constraints,
-                                 const ComponentMask &component_mask)
+  make_zero_boundary_constraints(
+    const DoFHandlerType<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 "
@@ -3587,11 +3559,15 @@ namespace DoFTools
 
 
 
-  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
+  template <int dim,
+            int spacedim,
+            template <int, int> class DoFHandlerType,
+            typename number>
   void
-  make_zero_boundary_constraints(const DoFHandlerType<dim, spacedim> &dof,
-                                 ConstraintMatrix &   zero_boundary_constraints,
-                                 const ComponentMask &component_mask)
+  make_zero_boundary_constraints(
+    const DoFHandlerType<dim, spacedim> &dof,
+    AffineConstraints<number> &          zero_boundary_constraints,
+    const ComponentMask &                component_mask)
   {
     make_zero_boundary_constraints(dof,
                                    numbers::invalid_boundary_id,
index 3de6fe397e6e4d4901ee27cfe4595d3b6986c0b7..2a6443182c7cd33d31f48d05e1968885d9ac18af 100644 (file)
@@ -19,20 +19,21 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : DIMENSIONS)
 #if deal_II_dimension < deal_II_space_dimension
     template void DoFTools::make_hanging_node_constraints(
       const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      ConstraintMatrix &);
+      AffineConstraints<double> &);
 #endif
   }
 
 for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
   {
     template void DoFTools::make_hanging_node_constraints(
-      const DH<deal_II_dimension, deal_II_dimension> &, ConstraintMatrix &);
+      const DH<deal_II_dimension, deal_II_dimension> &,
+      AffineConstraints<double> &);
 
 #if deal_II_dimension != 1
     template void DoFTools::make_periodicity_constraints(
       const DH<deal_II_dimension>::face_iterator &,
       const DH<deal_II_dimension>::face_iterator &,
-      dealii::ConstraintMatrix &,
+      AffineConstraints<double> &,
       const ComponentMask &,
       bool,
       bool,
@@ -43,7 +44,7 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
     template void DoFTools::make_periodicity_constraints<DH<deal_II_dimension>>(
       const std::vector<
         GridTools::PeriodicFacePair<DH<deal_II_dimension>::cell_iterator>> &,
-      dealii::ConstraintMatrix &,
+      AffineConstraints<double> &,
       const ComponentMask &,
       const std::vector<unsigned int> &);
 
@@ -53,31 +54,32 @@ for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
       const types::boundary_id,
       const types::boundary_id,
       const int,
-      dealii::ConstraintMatrix &,
+      AffineConstraints<double> &,
       const ComponentMask &);
 
     template void DoFTools::make_periodicity_constraints(
       const DH<deal_II_dimension> &,
       const types::boundary_id,
       const int,
-      dealii::ConstraintMatrix &,
+      AffineConstraints<double> &,
       const ComponentMask &);
 #endif
   }
 
 for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
-     deal_II_space_dimension : SPACE_DIMENSIONS)
+     deal_II_space_dimension : SPACE_DIMENSIONS;
+     S : REAL_AND_COMPLEX_SCALARS)
   {
 #if deal_II_dimension <= deal_II_space_dimension
     template void DoFTools::make_zero_boundary_constraints(
       const DH<deal_II_dimension, deal_II_space_dimension> &,
-      ConstraintMatrix &,
+      AffineConstraints<S> &,
       const ComponentMask &);
 
     template void DoFTools::make_zero_boundary_constraints(
       const DH<deal_II_dimension, deal_II_space_dimension> &,
       const types::boundary_id,
-      ConstraintMatrix &,
+      AffineConstraints<S> &,
       const ComponentMask &);
 #endif
   }
@@ -93,7 +95,7 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
       const unsigned int,
       const InterGridMap<DoFHandler<deal_II_dimension, deal_II_space_dimension>>
         &,
-      ConstraintMatrix &);
+      AffineConstraints<double> &);
 
     template void
     DoFTools::compute_intergrid_transfer_representation<deal_II_dimension>(
index a6af8f0dc8fe2772249c7ebea3f23819d0f3d651..109ed2578a165648092cb2ae2fea199d5addf9c3 100644 (file)
@@ -36,8 +36,8 @@
 #include <deal.II/hp/fe_values.h>
 #include <deal.II/hp/q_collection.h>
 
+#include <deal.II/lac/affine_constraints.h>
 #include <deal.II/lac/block_sparsity_pattern.h>
-#include <deal.II/lac/constraint_matrix.h>
 #include <deal.II/lac/dynamic_sparsity_pattern.h>
 #include <deal.II/lac/sparsity_pattern.h>
 #include <deal.II/lac/trilinos_sparsity_pattern.h>
@@ -54,13 +54,15 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace DoFTools
 {
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number>
   void
-  make_sparsity_pattern(const DoFHandlerType &    dof,
-                        SparsityPatternType &     sparsity,
-                        const ConstraintMatrix &  constraints,
-                        const bool                keep_constrained_dofs,
-                        const types::subdomain_id subdomain_id)
+  make_sparsity_pattern(const DoFHandlerType &           dof,
+                        SparsityPatternType &            sparsity,
+                        const AffineConstraints<number> &constraints,
+                        const bool                       keep_constrained_dofs,
+                        const types::subdomain_id        subdomain_id)
   {
     const types::global_dof_index n_dofs = dof.n_dofs();
     (void)n_dofs;
@@ -110,14 +112,16 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number>
   void
-  make_sparsity_pattern(const DoFHandlerType &    dof,
-                        const Table<2, Coupling> &couplings,
-                        SparsityPatternType &     sparsity,
-                        const ConstraintMatrix &  constraints,
-                        const bool                keep_constrained_dofs,
-                        const types::subdomain_id subdomain_id)
+  make_sparsity_pattern(const DoFHandlerType &           dof,
+                        const Table<2, Coupling> &       couplings,
+                        SparsityPatternType &            sparsity,
+                        const AffineConstraints<number> &constraints,
+                        const bool                       keep_constrained_dofs,
+                        const types::subdomain_id        subdomain_id)
   {
     const types::global_dof_index n_dofs = dof.n_dofs();
     (void)n_dofs;
@@ -477,11 +481,13 @@ namespace DoFTools
 
 
 
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number>
   void
-  make_flux_sparsity_pattern(const DoFHandlerType &    dof,
-                             SparsityPatternType &     sparsity,
-                             const ConstraintMatrix &  constraints,
+  make_flux_sparsity_pattern(const DoFHandlerType &           dof,
+                             SparsityPatternType &            sparsity,
+                             const AffineConstraints<number> &constraints,
                              const bool                keep_constrained_dofs,
                              const types::subdomain_id subdomain_id)
 
@@ -651,8 +657,8 @@ namespace DoFTools
   make_flux_sparsity_pattern(const DoFHandlerType &dof,
                              SparsityPatternType & sparsity)
   {
-    ConstraintMatrix constraints;
-    make_flux_sparsity_pattern(dof, sparsity, constraints);
+    AffineConstraints<double> dummy;
+    make_flux_sparsity_pattern(dof, sparsity, dummy);
   }
 
   template <int dim, int spacedim>
@@ -718,12 +724,14 @@ namespace DoFTools
     {
       // implementation of the same function in namespace DoFTools for
       // non-hp DoFHandlers
-      template <typename DoFHandlerType, typename SparsityPatternType>
+      template <typename DoFHandlerType,
+                typename SparsityPatternType,
+                typename number>
       void
-      make_flux_sparsity_pattern(const DoFHandlerType &  dof,
-                                 SparsityPatternType &   sparsity,
-                                 const ConstraintMatrix &constraints,
-                                 const bool              keep_constrained_dofs,
+      make_flux_sparsity_pattern(const DoFHandlerType &           dof,
+                                 SparsityPatternType &            sparsity,
+                                 const AffineConstraints<number> &constraints,
+                                 const bool keep_constrained_dofs,
                                  const Table<2, Coupling> &int_mask,
                                  const Table<2, Coupling> &flux_mask,
                                  const types::subdomain_id subdomain_id)
@@ -1007,12 +1015,15 @@ namespace DoFTools
 
       // implementation of the same function in namespace DoFTools for hp
       // DoFHandlers
-      template <int dim, int spacedim, typename SparsityPatternType>
+      template <int dim,
+                int spacedim,
+                typename SparsityPatternType,
+                typename number>
       void
       make_flux_sparsity_pattern(
         const dealii::hp::DoFHandler<dim, spacedim> &dof,
         SparsityPatternType &                        sparsity,
-        const ConstraintMatrix &                     constraints,
+        const AffineConstraints<number> &            constraints,
         const bool                                   keep_constrained_dofs,
         const Table<2, Coupling> &                   int_mask,
         const Table<2, Coupling> &                   flux_mask,
@@ -1271,22 +1282,26 @@ namespace DoFTools
                              const Table<2, Coupling> &flux_mask,
                              const types::subdomain_id subdomain_id)
   {
-    ConstraintMatrix constraints;
-    const bool       keep_constrained_dofs = true;
+    AffineConstraints<double> dummy;
+
+    const bool keep_constrained_dofs = true;
+
     make_flux_sparsity_pattern(dof,
                                sparsity,
-                               constraints,
+                               dummy,
                                keep_constrained_dofs,
                                int_mask,
                                flux_mask,
                                subdomain_id);
   }
 
-  template <typename DoFHandlerType, typename SparsityPatternType>
+  template <typename DoFHandlerType,
+            typename SparsityPatternType,
+            typename number>
   void
-  make_flux_sparsity_pattern(const DoFHandlerType &    dof,
-                             SparsityPatternType &     sparsity,
-                             const ConstraintMatrix &  constraints,
+  make_flux_sparsity_pattern(const DoFHandlerType &           dof,
+                             SparsityPatternType &            sparsity,
+                             const AffineConstraints<number> &constraints,
                              const bool                keep_constrained_dofs,
                              const Table<2, Coupling> &int_mask,
                              const Table<2, Coupling> &flux_mask,
index 48c0660baa3f654d4299c5b43004db91d672bbec..33dd80096c542ea2b12f6385b634274a8c496725 100644 (file)
@@ -149,13 +149,14 @@ for (scalar : COMPLEX_SCALARS; SP : SPARSITY_PATTERNS;
 #endif
   }
 
-for (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 ConstraintMatrix &,
+          const AffineConstraints<S> &,
           const bool,
           const types::subdomain_id);
 
@@ -163,7 +164,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       hp::DoFHandler<deal_II_dimension, deal_II_dimension>,
       SP>(const hp::DoFHandler<deal_II_dimension, deal_II_dimension> &dof,
           SP &                                                        sparsity,
-          const ConstraintMatrix &,
+          const AffineConstraints<S> &,
           const bool,
           const types::subdomain_id);
 
@@ -172,7 +173,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       SP>(const DoFHandler<deal_II_dimension, deal_II_dimension> &,
           const Table<2, Coupling> &,
           SP &,
-          const ConstraintMatrix &,
+          const AffineConstraints<S> &,
           const bool,
           const types::subdomain_id);
 
@@ -181,56 +182,15 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       SP>(const hp::DoFHandler<deal_II_dimension, deal_II_dimension> &,
           const Table<2, Coupling> &,
           SP &,
-          const ConstraintMatrix &,
+          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> &dof_row,
-          const DoFHandler<deal_II_dimension, deal_II_dimension> &dof_col,
-          SP &                                                    sparsity);
-
-    template void DoFTools::make_sparsity_pattern<
-      hp::DoFHandler<deal_II_dimension, deal_II_dimension>,
-      SP>(const hp::DoFHandler<deal_II_dimension, deal_II_dimension> &dof_row,
-          const hp::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 &);
-
-    template void
-    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
-                                             SP>(
-      const hp::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);
-
-    template void
-    DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>, SP>(
-      const hp::DoFHandler<deal_II_dimension> &dof, SP &sparsity);
-
-    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<DoFHandler<deal_II_dimension>, SP>(
       const DoFHandler<deal_II_dimension> &dof,
       SP &                                 sparsity,
-      const ConstraintMatrix &             constraints,
+      const AffineConstraints<S> &,
       const bool,
       const Table<2, Coupling> &,
       const Table<2, Coupling> &,
@@ -240,7 +200,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
     DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>, SP>(
       const DoFHandler<deal_II_dimension> &dof,
       SP &                                 sparsity,
-      const ConstraintMatrix &             constraints,
+      const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
@@ -248,7 +208,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
     DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>, SP>(
       const hp::DoFHandler<deal_II_dimension> &dof,
       SP &                                     sparsity,
-      const ConstraintMatrix &                 constraints,
+      const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
@@ -258,15 +218,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
     DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>, SP>(
       const hp::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<hp::DoFHandler<deal_II_dimension>, SP>(
-      const hp::DoFHandler<deal_II_dimension> &dof,
-      SP &                                     sparsity,
-      const ConstraintMatrix &                 constraints,
+      const AffineConstraints<S> &,
       const bool,
       const Table<2, Coupling> &,
       const Table<2, Coupling> &,
@@ -280,7 +232,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
       SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
           SP &                                                        sparsity,
-          const ConstraintMatrix &,
+          const AffineConstraints<S> &,
           const bool,
           const types::subdomain_id);
 
@@ -288,7 +240,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       hp::DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
       SP>(const hp::DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
           SP &sparsity,
-          const ConstraintMatrix &,
+          const AffineConstraints<S> &,
           const bool,
           const types::subdomain_id);
 
@@ -297,7 +249,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
           const Table<2, Coupling> &,
           SP &,
-          const ConstraintMatrix &,
+          const AffineConstraints<S> &,
           const bool,
           const types::subdomain_id);
 
@@ -306,51 +258,25 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       SP>(const hp::DoFHandler<deal_II_dimension, deal_II_dimension + 1> &,
           const Table<2, Coupling> &,
           SP &,
-          const ConstraintMatrix &,
+          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> &dof_row,
-          const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_col,
-          SP &                                                        sparsity);
-
-    template void DoFTools::make_sparsity_pattern<
-      hp::DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
-      SP>(
-      const hp::DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_row,
-      const hp::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>,
-      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
-          const std::vector<types::global_dof_index> &,
-          SP &);
-
-    // template void
-    // DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
-    //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-    // const std::vector<types::global_dof_index>  &,
-    // SP    &);
-
 #endif
 
-
 #if deal_II_dimension == 3
 
     template void DoFTools::make_sparsity_pattern<DoFHandler<1, 3>, SP>(
       const DoFHandler<1, 3> &dof,
       SP &                    sparsity,
-      const ConstraintMatrix &,
+      const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
     template void DoFTools::make_sparsity_pattern<hp::DoFHandler<1, 3>, SP>(
       const hp::DoFHandler<1, 3> &dof,
       SP &                        sparsity,
-      const ConstraintMatrix &,
+      const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
@@ -358,7 +284,7 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       const DoFHandler<1, 3> &,
       const Table<2, Coupling> &,
       SP &,
-      const ConstraintMatrix &,
+      const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
@@ -366,10 +292,100 @@ for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
       const hp::DoFHandler<1, 3> &,
       const Table<2, Coupling> &,
       SP &,
-      const ConstraintMatrix &,
+      const AffineConstraints<S> &,
       const bool,
       const types::subdomain_id);
 
+#endif
+  }
+
+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_sparsity_pattern<
+      hp::DoFHandler<deal_II_dimension, deal_II_dimension>,
+      SP>(const hp::DoFHandler<deal_II_dimension, deal_II_dimension> &dof_row,
+          const hp::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 &);
+
+    template void
+    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,
+                                             SP>(
+      const hp::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);
+
+    template void
+    DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>, SP>(
+      const hp::DoFHandler<deal_II_dimension> &dof, SP &sparsity);
+
+    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);
+
+#if deal_II_dimension > 1
+
+    template void
+    DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>, SP>(
+      const hp::DoFHandler<deal_II_dimension> &dof,
+      SP &                                     sparsity,
+      const Table<2, Coupling> &,
+      const Table<2, Coupling> &,
+      const types::subdomain_id);
+
+#endif
+
+#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_row,
+          const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_col,
+          SP &                                                        sparsity);
+
+    template void DoFTools::make_sparsity_pattern<
+      hp::DoFHandler<deal_II_dimension, deal_II_dimension + 1>,
+      SP>(
+      const hp::DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof_row,
+      const hp::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>,
+      SP>(const DoFHandler<deal_II_dimension, deal_II_dimension + 1> &dof,
+          const std::vector<types::global_dof_index> &,
+          SP &);
+
+    // template void
+    // DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
+    //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
+    // const std::vector<types::global_dof_index>  &,
+    // SP    &);
+
+#endif
+
+
+#if deal_II_dimension == 3
+
     template void DoFTools::make_sparsity_pattern<DoFHandler<1, 3>, SP>(
       const DoFHandler<1, 3> &dof_row,
       const DoFHandler<1, 3> &dof_col,

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.