]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Matrix-free MG transfer: Switch interpolation matrices to double type 16721/head
authorMartin Kronbichler <martin.kronbichler@rub.de>
Wed, 6 Mar 2024 09:19:03 +0000 (10:19 +0100)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Wed, 6 Mar 2024 09:19:03 +0000 (10:19 +0100)
include/deal.II/multigrid/mg_transfer_global_coarsening.h
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h

index 8820af597bb115657971400d5bd56ef7ad22278c..6c369fb28421cbf75ee32da4c79a4dd5748f51d4 100644 (file)
@@ -651,29 +651,28 @@ private:
     /**
      * Prolongation matrix for non-tensor-product elements.
      */
-    AlignedVector<VectorizedArrayType> prolongation_matrix;
+    AlignedVector<double> prolongation_matrix;
 
     /**
      * 1d prolongation matrix for tensor-product elements.
      */
-    AlignedVector<VectorizedArrayType> prolongation_matrix_1d;
+    AlignedVector<double> prolongation_matrix_1d;
 
     /**
      * Restriction matrix for non-tensor-product elements.
      */
-    AlignedVector<VectorizedArrayType> restriction_matrix;
+    AlignedVector<double> restriction_matrix;
 
     /**
      * 1d restriction matrix for tensor-product elements.
      */
-    AlignedVector<VectorizedArrayType> restriction_matrix_1d;
+    AlignedVector<double> restriction_matrix_1d;
 
     /**
      * ShapeInfo description of the coarse cell. Needed during the
      * fast application of hanging-node constraints.
      */
-    internal::MatrixFreeFunctions::ShapeInfo<VectorizedArrayType>
-      shape_info_coarse;
+    internal::MatrixFreeFunctions::ShapeInfo<double> shape_info_coarse;
   };
 
   /**
index f035321886520c2d314fe8311c40ae1d74d3bbd1..ec20cb9d825533a4aea2b34cbda2ce3ddcf9abea 100644 (file)
@@ -115,14 +115,14 @@ namespace
   /**
    * Helper class containing the cell-wise prolongation operation.
    */
-  template <int dim, typename Number>
+  template <int dim, typename Number, typename Number2>
   class CellProlongator
   {
   public:
     CellProlongator(const AlignedVector<Number> &prolongation_matrix,
                     const AlignedVector<Number> &prolongation_matrix_1d,
-                    const Number                *evaluation_data_coarse,
-                    Number                      *evaluation_data_fine)
+                    const Number2               *evaluation_data_coarse,
+                    Number2                     *evaluation_data_fine)
       : prolongation_matrix(prolongation_matrix)
       , prolongation_matrix_1d(prolongation_matrix_1d)
       , evaluation_data_coarse(evaluation_data_coarse)
@@ -170,21 +170,21 @@ namespace
   private:
     const AlignedVector<Number> &prolongation_matrix;
     const AlignedVector<Number> &prolongation_matrix_1d;
-    const Number                *evaluation_data_coarse;
-    Number                      *evaluation_data_fine;
+    const Number2               *evaluation_data_coarse;
+    Number2                     *evaluation_data_fine;
   };
 
   /**
    * Helper class containing the cell-wise restriction operation.
    */
-  template <int dim, typename Number>
+  template <int dim, typename Number, typename Number2>
   class CellRestrictor
   {
   public:
     CellRestrictor(const AlignedVector<Number> &prolongation_matrix,
                    const AlignedVector<Number> &prolongation_matrix_1d,
-                   Number                      *evaluation_data_fine,
-                   Number                      *evaluation_data_coarse)
+                   Number2                     *evaluation_data_fine,
+                   Number2                     *evaluation_data_coarse)
       : prolongation_matrix(prolongation_matrix)
       , prolongation_matrix_1d(prolongation_matrix_1d)
       , evaluation_data_fine(evaluation_data_fine)
@@ -235,8 +235,8 @@ namespace
   private:
     const AlignedVector<Number> &prolongation_matrix;
     const AlignedVector<Number> &prolongation_matrix_1d;
-    Number                      *evaluation_data_fine;
-    Number                      *evaluation_data_coarse;
+    Number2                     *evaluation_data_fine;
+    Number2                     *evaluation_data_coarse;
   };
 
   class CellProlongatorTest
@@ -2975,11 +2975,13 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
           if (needs_interpolation)
             for (int c = n_components - 1; c >= 0; --c)
               {
-                CellProlongator<dim, VectorizedArrayType> cell_prolongator(
-                  scheme.prolongation_matrix,
-                  scheme.prolongation_matrix_1d,
-                  evaluation_data_coarse.begin() + c * n_scalar_dofs_coarse,
-                  evaluation_data_fine.begin() + c * n_scalar_dofs_fine);
+                CellProlongator<dim, double, VectorizedArrayType>
+                  cell_prolongator(scheme.prolongation_matrix,
+                                   scheme.prolongation_matrix_1d,
+                                   evaluation_data_coarse.begin() +
+                                     c * n_scalar_dofs_coarse,
+                                   evaluation_data_fine.begin() +
+                                     c * n_scalar_dofs_fine);
 
                 if (scheme.prolongation_matrix_1d.size() > 0)
                   cell_transfer.run(cell_prolongator);
@@ -3173,11 +3175,13 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
           if (needs_interpolation)
             for (int c = n_components - 1; c >= 0; --c)
               {
-                CellRestrictor<dim, VectorizedArrayType> cell_restrictor(
-                  scheme.prolongation_matrix,
-                  scheme.prolongation_matrix_1d,
-                  evaluation_data_fine.begin() + c * n_scalar_dofs_fine,
-                  evaluation_data_coarse.begin() + c * n_scalar_dofs_coarse);
+                CellRestrictor<dim, double, VectorizedArrayType>
+                  cell_restrictor(scheme.prolongation_matrix,
+                                  scheme.prolongation_matrix_1d,
+                                  evaluation_data_fine.begin() +
+                                    c * n_scalar_dofs_fine,
+                                  evaluation_data_coarse.begin() +
+                                    c * n_scalar_dofs_coarse);
 
                 if (scheme.prolongation_matrix_1d.size() > 0)
                   cell_transfer.run(cell_restrictor);
@@ -3296,11 +3300,13 @@ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>>::
           if (needs_interpolation)
             for (int c = n_components - 1; c >= 0; --c)
               {
-                CellRestrictor<dim, VectorizedArrayType> cell_restrictor(
-                  scheme.restriction_matrix,
-                  scheme.restriction_matrix_1d,
-                  evaluation_data_fine.begin() + c * n_scalar_dofs_fine,
-                  evaluation_data_coarse.begin() + c * n_scalar_dofs_coarse);
+                CellRestrictor<dim, double, VectorizedArrayType>
+                  cell_restrictor(scheme.restriction_matrix,
+                                  scheme.restriction_matrix_1d,
+                                  evaluation_data_fine.begin() +
+                                    c * n_scalar_dofs_fine,
+                                  evaluation_data_coarse.begin() +
+                                    c * n_scalar_dofs_coarse);
 
                 if (scheme.restriction_matrix_1d.size() > 0)
                   cell_transfer.run(cell_restrictor);

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.