]> https://gitweb.dealii.org/ - dealii.git/commitdiff
NonMatching: Remove template on sparsity pattern type. 14431/head
authorDavid Wells <drwells@email.unc.edu>
Sat, 5 Nov 2022 02:10:56 +0000 (22:10 -0400)
committerDavid Wells <drwells@email.unc.edu>
Wed, 16 Nov 2022 02:39:03 +0000 (21:39 -0500)
This is no longer necessary since all of our SparsityPatterns inherit from
SparsityPatternBase. This file was previously the most expensive to compile in
the entire library so cutting down the number of instantiations by a factor of 4
or 6 (with Trilinos) is quite nice.

include/deal.II/non_matching/coupling.h
source/non_matching/coupling.cc
source/non_matching/coupling.inst.in

index 4d4c1d5fb26d60129c3a889103b065addfca0936..a00b00ef71cf644291c9f26b758cccc181e66e36 100644 (file)
@@ -90,17 +90,13 @@ namespace NonMatching
    * See the tutorial program step-60 for an example on how to use this
    * function.
    */
-  template <int dim0,
-            int dim1,
-            int spacedim,
-            typename Sparsity,
-            typename number = double>
+  template <int dim0, int dim1, int spacedim, typename number = double>
   void
   create_coupling_sparsity_pattern(
     const DoFHandler<dim0, spacedim> &space_dh,
     const DoFHandler<dim1, spacedim> &immersed_dh,
     const Quadrature<dim1> &          quad,
-    Sparsity &                        sparsity,
+    SparsityPatternBase &             sparsity,
     const AffineConstraints<number> & constraints = AffineConstraints<number>(),
     const ComponentMask &             space_comps = ComponentMask(),
     const ComponentMask &             immersed_comps = ComponentMask(),
@@ -117,18 +113,14 @@ namespace NonMatching
    * space_mapping cannot be specified, since it is taken from the @p cache
    * parameter.
    */
-  template <int dim0,
-            int dim1,
-            int spacedim,
-            typename Sparsity,
-            typename number = double>
+  template <int dim0, int dim1, int spacedim, typename number = double>
   void
   create_coupling_sparsity_pattern(
     const GridTools::Cache<dim0, spacedim> &cache,
     const DoFHandler<dim0, spacedim> &      space_dh,
     const DoFHandler<dim1, spacedim> &      immersed_dh,
     const Quadrature<dim1> &                quad,
-    Sparsity &                              sparsity,
+    SparsityPatternBase &                   sparsity,
     const AffineConstraints<number> &constraints = AffineConstraints<number>(),
     const ComponentMask &            space_comps = ComponentMask(),
     const ComponentMask &            immersed_comps = ComponentMask(),
@@ -269,11 +261,7 @@ namespace NonMatching
    * restrictive conditions are required on the two spaces. See the
    * documentation of the other create_coupling_sparsity_pattern() function.
    */
-  template <int dim0,
-            int dim1,
-            int spacedim,
-            typename Sparsity,
-            typename Number = double>
+  template <int dim0, int dim1, int spacedim, typename Number = double>
   void
   create_coupling_sparsity_pattern(
     const double &                          epsilon,
@@ -282,7 +270,7 @@ namespace NonMatching
     const DoFHandler<dim0, spacedim> &      dh0,
     const DoFHandler<dim1, spacedim> &      dh1,
     const Quadrature<dim1> &                quad,
-    Sparsity &                              sparsity,
+    SparsityPatternBase &                   sparsity,
     const AffineConstraints<Number> &constraints0 = AffineConstraints<Number>(),
     const ComponentMask &            comps0       = ComponentMask(),
     const ComponentMask &            comps1       = ComponentMask());
index d433dec0872c53bab008289e521e71fe1f01ed40..e90811c1b87ba17a2a136c4f2f684ff47aa53289 100644 (file)
@@ -169,17 +169,13 @@ namespace NonMatching
     }
   } // namespace internal
 
-  template <int dim0,
-            int dim1,
-            int spacedim,
-            typename Sparsity,
-            typename number>
+  template <int dim0, int dim1, int spacedim, typename number>
   void
   create_coupling_sparsity_pattern(
     const DoFHandler<dim0, spacedim> &space_dh,
     const DoFHandler<dim1, spacedim> &immersed_dh,
     const Quadrature<dim1> &          quad,
-    Sparsity &                        sparsity,
+    SparsityPatternBase &             sparsity,
     const AffineConstraints<number> & constraints,
     const ComponentMask &             space_comps,
     const ComponentMask &             immersed_comps,
@@ -203,18 +199,14 @@ namespace NonMatching
 
 
 
-  template <int dim0,
-            int dim1,
-            int spacedim,
-            typename Sparsity,
-            typename number>
+  template <int dim0, int dim1, int spacedim, typename number>
   void
   create_coupling_sparsity_pattern(
     const GridTools::Cache<dim0, spacedim> &cache,
     const DoFHandler<dim0, spacedim> &      space_dh,
     const DoFHandler<dim1, spacedim> &      immersed_dh,
     const Quadrature<dim1> &                quad,
-    Sparsity &                              sparsity,
+    SparsityPatternBase &                   sparsity,
     const AffineConstraints<number> &       constraints,
     const ComponentMask &                   space_comps,
     const ComponentMask &                   immersed_comps,
@@ -626,11 +618,7 @@ namespace NonMatching
       }
   }
 
-  template <int dim0,
-            int dim1,
-            int spacedim,
-            typename Sparsity,
-            typename Number>
+  template <int dim0, int dim1, int spacedim, typename Number>
   void
   create_coupling_sparsity_pattern(
     const double &                          epsilon,
@@ -639,7 +627,7 @@ namespace NonMatching
     const DoFHandler<dim0, spacedim> &      dh0,
     const DoFHandler<dim1, spacedim> &      dh1,
     const Quadrature<dim1> &                quad,
-    Sparsity &                              sparsity,
+    SparsityPatternBase &                   sparsity,
     const AffineConstraints<Number> &       constraints0,
     const ComponentMask &                   comps0,
     const ComponentMask &                   comps1)
index d5ff79b4f9f8749e880d6aa62ebc12078305e084..712442fc65cccf9f93c3672097c918fba538bf31 100644 (file)
@@ -15,7 +15,6 @@
 
 
 for (dim0 : DIMENSIONS; dim1 : DIMENSIONS; spacedim : SPACE_DIMENSIONS;
-     Sparsity : SPARSITY_PATTERNS;
      S : REAL_AND_COMPLEX_SCALARS)
   {
 #if dim1 <= spacedim && dim0 <= spacedim
@@ -23,7 +22,7 @@ for (dim0 : DIMENSIONS; dim1 : DIMENSIONS; spacedim : SPACE_DIMENSIONS;
       const DoFHandler<dim0, spacedim> &space_dh,
       const DoFHandler<dim1, spacedim> &immersed_dh,
       const Quadrature<dim1> &          quad,
-      Sparsity &                        sparsity,
+      SparsityPatternBase &             sparsity,
       const AffineConstraints<S> &      constraints,
       const ComponentMask &             space_comps,
       const ComponentMask &             immersed_comps,
@@ -36,7 +35,7 @@ for (dim0 : DIMENSIONS; dim1 : DIMENSIONS; spacedim : SPACE_DIMENSIONS;
       const DoFHandler<dim0, spacedim> &      space_dh,
       const DoFHandler<dim1, spacedim> &      immersed_dh,
       const Quadrature<dim1> &                quad,
-      Sparsity &                              sparsity,
+      SparsityPatternBase &                   sparsity,
       const AffineConstraints<S> &            constraints,
       const ComponentMask &                   space_comps,
       const ComponentMask &                   immersed_comps,
@@ -50,7 +49,7 @@ for (dim0 : DIMENSIONS; dim1 : DIMENSIONS; spacedim : SPACE_DIMENSIONS;
       const DoFHandler<dim0, spacedim> &      dh0,
       const DoFHandler<dim1, spacedim> &      dh1,
       const Quadrature<dim1> &                quad,
-      Sparsity &                              sparsity,
+      SparsityPatternBase &                   sparsity,
       const AffineConstraints<S> &            constraints0,
       const ComponentMask &                   comps0,
       const ComponentMask &                   comps1);

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.