]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Intorudce FullMatrix::compress() 16993/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 9 May 2024 19:27:38 +0000 (21:27 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 9 May 2024 19:27:38 +0000 (21:27 +0200)
include/deal.II/lac/full_matrix.h
include/deal.II/lac/full_matrix.templates.h
include/deal.II/numerics/matrix_creator.templates.h

index 343b6de0c639c5182c8b7d4853ed5c2898729614..fef8dbb0223fadd7525db597e9fc6dc8a998731d 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <deal.II/lac/exceptions.h>
 #include <deal.II/lac/identity_matrix.h>
+#include <deal.II/lac/vector_operation.h>
 
 #include <cstring>
 #include <iomanip>
@@ -1079,6 +1080,11 @@ public:
   void
   backward(Vector<number2> &dst, const Vector<number2> &src) const;
 
+  /**
+   * Dummy function for compatibility with distributed, parallel matrices.
+   */
+  void compress(VectorOperation::values);
+
   /** @} */
 
   /**
index 9f02fd265b5b6f3a31357d333356d325be912cfd..2de0cbbb392fee5fa5d6168354fe527cc650090a 100644 (file)
@@ -301,6 +301,13 @@ FullMatrix<number>::backward(Vector<number2>       &dst,
 
 
 
+template <typename number>
+void
+FullMatrix<number>::compress(VectorOperation::values)
+{}
+
+
+
 template <typename number>
 template <typename number2>
 void
index fecebdea7e08ec393ca364b948e946494df7ef44..5a67ba86a82a55c2a388636a27e5722d4ec54850 100644 (file)
@@ -631,42 +631,7 @@ namespace MatrixCreator
 
 
     } // namespace AssemblerBoundary
-
-
-
-    template <typename T>
-    using compress_t = decltype(std::declval<T>().compress(
-      std::declval<VectorOperation::values>()));
-
-
-
-    template <typename T>
-    constexpr bool has_compress =
-      dealii::internal::is_supported_operation<compress_t, T>;
-
-
-
-    template <
-      typename MatrixType,
-      std::enable_if_t<has_compress<MatrixType>, MatrixType> * = nullptr>
-    void
-    compress(MatrixType &A, const VectorOperation::values operation)
-    {
-      A.compress(operation);
-    }
-
-
-
-    template <
-      typename MatrixType,
-      std::enable_if_t<!has_compress<MatrixType>, MatrixType> * = nullptr>
-    void
-    compress(MatrixType &, const VectorOperation::values)
-    {
-      // nothing to do
-    }
-
-  } // namespace internal
+  }   // namespace internal
 } // namespace MatrixCreator
 
 
@@ -733,7 +698,7 @@ namespace MatrixCreator
       assembler_data,
       copy_data);
 
-    internal::compress(matrix, VectorOperation::add);
+    matrix.compress(VectorOperation::add);
   }
 
 
@@ -818,7 +783,7 @@ namespace MatrixCreator
       assembler_data,
       copy_data);
 
-    internal::compress(matrix, VectorOperation::add);
+    matrix.compress(VectorOperation::add);
   }
 
 
@@ -904,7 +869,7 @@ namespace MatrixCreator
       assembler_data,
       copy_data);
 
-    internal::compress(matrix, VectorOperation::add);
+    matrix.compress(VectorOperation::add);
   }
 
 
@@ -986,7 +951,7 @@ namespace MatrixCreator
       assembler_data,
       copy_data);
 
-    internal::compress(matrix, VectorOperation::add);
+    matrix.compress(VectorOperation::add);
   }
 
 
@@ -2017,7 +1982,7 @@ namespace MatrixCreator
       assembler_data,
       copy_data);
 
-    internal::compress(matrix, VectorOperation::add);
+    matrix.compress(VectorOperation::add);
   }
 
 
@@ -2102,7 +2067,7 @@ namespace MatrixCreator
       assembler_data,
       copy_data);
 
-    internal::compress(matrix, VectorOperation::add);
+    matrix.compress(VectorOperation::add);
   }
 
 

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.