]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FEEvaluation: Simplify check for block vector 11079/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 22 Oct 2020 09:14:29 +0000 (11:14 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 22 Oct 2020 09:14:29 +0000 (11:14 +0200)
include/deal.II/matrix_free/fe_evaluation.h

index 0e86aa2209acee3a8eb1bfe0f9751e1b1ccdd22c..97abf46ad52c5b0d8396cbdf989a66d22aad681d 100644 (file)
@@ -7516,7 +7516,7 @@ FEEvaluation<
 namespace internal
 {
   /**
-   * Implementation for vectors that have the begin() methods.
+   * Implementation for standard vectors (that have the begin() methods).
    */
   template <typename Number,
             typename VectorizedArrayType,
@@ -7573,7 +7573,7 @@ namespace internal
   }
 
   /**
-   * Implementation for all other vectors like block vectors.
+   * Implementation for block vectors.
    */
   template <typename Number,
             typename VectorizedArrayType,
@@ -7711,17 +7711,8 @@ namespace internal
 
   template <typename Number,
             typename VectorType,
-            typename std::enable_if<
-              internal::has_begin<VectorType>::value &&
-                (std::is_same<decltype(std::declval<VectorType>().begin()),
-                              const double *>::value ||
-                 std::is_same<decltype(std::declval<VectorType>().begin()),
-                              double *>::value ||
-                 std::is_same<decltype(std::declval<VectorType>().begin()),
-                              const float *>::value ||
-                 std::is_same<decltype(std::declval<VectorType>().begin()),
-                              float *>::value),
-              VectorType>::type * = nullptr>
+            typename std::enable_if<!IsBlockVector<VectorType>::value,
+                                    VectorType>::type * = nullptr>
   decltype(std::declval<VectorType>().begin())
   get_beginning(VectorType &vec)
   {
@@ -7730,17 +7721,8 @@ namespace internal
 
   template <typename Number,
             typename VectorType,
-            typename std::enable_if<
-              !internal::has_begin<VectorType>::value ||
-                !(std::is_same<decltype(std::declval<VectorType>().begin()),
-                               const double *>::value ||
-                  std::is_same<decltype(std::declval<VectorType>().begin()),
-                               double *>::value ||
-                  std::is_same<decltype(std::declval<VectorType>().begin()),
-                               const float *>::value ||
-                  std::is_same<decltype(std::declval<VectorType>().begin()),
-                               float *>::value),
-              VectorType>::type * = nullptr>
+            typename std::enable_if<IsBlockVector<VectorType>::value,
+                                    VectorType>::type * = nullptr>
   typename VectorType::value_type *
   get_beginning(VectorType &)
   {

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.