From: Wolfgang Bangerth Date: Tue, 1 Feb 2022 17:58:33 +0000 (-0700) Subject: Also convert the is_not_parallel_vector trait. X-Git-Tag: v9.4.0-rc1~538^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=359061c14a6adf2bbccf2651238ae61be65e9b58;p=dealii.git Also convert the is_not_parallel_vector trait. --- diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index 8f41bb7fe8..c51f2c1901 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -3359,7 +3359,7 @@ namespace internal * Start update_ghost_value for serial vectors */ template ::value, + typename std::enable_if, VectorType>::type * = nullptr> void update_ghost_values_start(const unsigned int /*component_in_block_vector*/, @@ -3374,7 +3374,7 @@ namespace internal template < typename VectorType, typename std::enable_if && - !is_not_parallel_vector::value, + !is_not_parallel_vector, VectorType>::type * = nullptr> void update_ghost_values_start(const unsigned int component_in_block_vector, @@ -3580,7 +3580,7 @@ namespace internal * Start compress for serial vectors */ template ::value, + typename std::enable_if, VectorType>::type * = nullptr> void compress_start(const unsigned int /*component_in_block_vector*/, @@ -3593,11 +3593,10 @@ namespace internal * Start compress for vectors that do not support * the split into _start() and finish() stages */ - template < - typename VectorType, - typename std::enable_if && - !is_not_parallel_vector::value, - VectorType>::type * = nullptr> + template && + !is_not_parallel_vector, + VectorType>::type * = nullptr> void compress_start(const unsigned int component_in_block_vector, VectorType & vec) @@ -3780,7 +3779,7 @@ namespace internal * Reset all ghost values for serial vectors */ template ::value, + typename std::enable_if, VectorType>::type * = nullptr> void reset_ghost_values(const VectorType & /*vec*/) const @@ -3792,11 +3791,10 @@ namespace internal * Reset all ghost values for vector that don't support * exchange on a subset of DoFs */ - template < - typename VectorType, - typename std::enable_if && - !is_not_parallel_vector::value, - VectorType>::type * = nullptr> + template && + !is_not_parallel_vector, + VectorType>::type * = nullptr> void reset_ghost_values(const VectorType &vec) const { diff --git a/include/deal.II/matrix_free/type_traits.h b/include/deal.II/matrix_free/type_traits.h index f4c312f3c2..e898d3381b 100644 --- a/include/deal.II/matrix_free/type_traits.h +++ b/include/deal.II/matrix_free/type_traits.h @@ -189,9 +189,31 @@ namespace internal using not_parallel_vector_t = std::integral_constant::value>; - template - using is_not_parallel_vector = - SupportsOperation::detected_or_t; + /** + * A predicate stating whether something is a vector type. We test this + * by seeing whether the `is_serial_vector` type is declared for the + * given vector type. + */ + template + using is_vector_type = decltype(is_serial_vector::value); + + /** + * A predicate stating whether something is a vector type and is + * indeed a serial vector. + */ + template + using is_serial_vector_type = decltype( + typename std::enable_if::value, int>::type()); + + /** + * A variable that indicates that the type `T` is either (i) not + * a vector type at all, or (ii) if it is a vector type, + * that it is not a parallel vector type. + */ + template + constexpr bool is_not_parallel_vector = + (is_supported_operation == false) || + (is_supported_operation == true); } // namespace internal #endif