From: Peter Munch Date: Thu, 9 May 2024 19:27:38 +0000 (+0200) Subject: Intorudce FullMatrix::compress() X-Git-Tag: v9.6.0-rc1~301^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16993%2Fhead;p=dealii.git Intorudce FullMatrix::compress() --- diff --git a/include/deal.II/lac/full_matrix.h b/include/deal.II/lac/full_matrix.h index 343b6de0c6..fef8dbb022 100644 --- a/include/deal.II/lac/full_matrix.h +++ b/include/deal.II/lac/full_matrix.h @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -1079,6 +1080,11 @@ public: void backward(Vector &dst, const Vector &src) const; + /** + * Dummy function for compatibility with distributed, parallel matrices. + */ + void compress(VectorOperation::values); + /** @} */ /** diff --git a/include/deal.II/lac/full_matrix.templates.h b/include/deal.II/lac/full_matrix.templates.h index 9f02fd265b..2de0cbbb39 100644 --- a/include/deal.II/lac/full_matrix.templates.h +++ b/include/deal.II/lac/full_matrix.templates.h @@ -301,6 +301,13 @@ FullMatrix::backward(Vector &dst, +template +void +FullMatrix::compress(VectorOperation::values) +{} + + + template template void diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index fecebdea7e..5a67ba86a8 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -631,42 +631,7 @@ namespace MatrixCreator } // namespace AssemblerBoundary - - - - template - using compress_t = decltype(std::declval().compress( - std::declval())); - - - - template - constexpr bool has_compress = - dealii::internal::is_supported_operation; - - - - template < - typename MatrixType, - std::enable_if_t, MatrixType> * = nullptr> - void - compress(MatrixType &A, const VectorOperation::values operation) - { - A.compress(operation); - } - - - - template < - typename MatrixType, - std::enable_if_t, 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); }