]> https://gitweb.dealii.org/ - dealii.git/commitdiff
change is_vectorizable to work with serial vectors
authorDenis Davydov <davydden@gmail.com>
Sun, 24 Feb 2019 17:06:17 +0000 (18:06 +0100)
committerDenis Davydov <davydden@gmail.com>
Sun, 24 Feb 2019 17:06:17 +0000 (18:06 +0100)
include/deal.II/matrix_free/fe_evaluation.h
tests/matrix_free/fe_evaluation_type_traits.cc
tests/matrix_free/fe_evaluation_type_traits.with_trilinos=true.output

index 56b5a6b2b261f0ab5b1809965112ed669c2c43d1..f8b4975bf9c631b19e4e775411c768250a698dcf 100644 (file)
@@ -3480,7 +3480,8 @@ namespace internal
   struct is_vectorizable
   {
     static constexpr bool value =
-      has_begin<T>::value && has_local_element<T>::value &&
+      has_begin<T>::value &&
+      (has_local_element<T>::value || is_serial_vector<T>::value) &&
       std::is_same<typename T::value_type, Number>::value;
   };
 
index a5740384427150fe0251a5d7d914bf049c4df0c6..762da8b50d089c1f87d9451fcdb15effefe0610e 100644 (file)
@@ -109,6 +109,8 @@ main()
           << "Dummy = " << internal::has_local_element<Dummy<double>>::value
           << std::endl
           << "Dummy2 = " << internal::has_local_element<Dummy2<double>>::value
+          << std::endl
+          << "Vector = " << internal::has_local_element<Vector<double>>::value
           << std::endl;
 
   // now check internal::vector_access wrapper
@@ -127,6 +129,9 @@ main()
           << "TrilinosWrappers::MPI::Vector = "
           << internal::has_partitioners_are_compatible<
                TrilinosWrappers::MPI::Vector>::value
+          << std::endl
+          << "Vector = "
+          << internal::has_partitioners_are_compatible<Vector<double>>::value
           << std::endl;
 
   // check has_begin:
@@ -136,7 +141,8 @@ main()
     << internal::has_begin<LinearAlgebra::distributed::Vector<double>>::value
     << std::endl
     << "TrilinosWrappers::MPI::Vector = "
-    << internal::has_begin<TrilinosWrappers::MPI::Vector>::value << std::endl;
+    << internal::has_begin<TrilinosWrappers::MPI::Vector>::value << std::endl
+    << "Vector = " << internal::has_begin<Vector<double>>::value << std::endl;
   // check is_vectorizable:
   deallog
     << "is_vectorizable:" << std::endl
@@ -150,6 +156,8 @@ main()
     << std::endl
     << "TrilinosWrappers::MPI::Vector && double = "
     << internal::is_vectorizable<TrilinosWrappers::MPI::Vector, double>::value
+    << std::endl
+    << "Vector = " << internal::is_vectorizable<Vector<double>, double>::value
     << std::endl;
 
   deallog << "OK" << std::endl;
index d6140df3425535d14eb20ee38dcc4a2254a5da56..801cf4191e206172de6e571beb64f419388c81a7 100644 (file)
@@ -4,17 +4,21 @@ DEAL::LinearAlgebra::distributed::Vector = 1
 DEAL::TrilinosWrappers::MPI::Vector = 0
 DEAL::Dummy = 1
 DEAL::Dummy2 = 0
+DEAL::Vector = 0
 DEAL::internal::vector_access:
 DEAL::Dummy::local_element()
 DEAL::Dummy2::operator()
 DEAL::has_partitioners_are_compatible:
 DEAL::LinearAlgebra::distributed::Vector = 1
 DEAL::TrilinosWrappers::MPI::Vector = 0
+DEAL::Vector = 0
 DEAL::has_begin:
 DEAL::LinearAlgebra::distributed::Vector = 1
 DEAL::TrilinosWrappers::MPI::Vector = 1
+DEAL::Vector = 1
 DEAL::is_vectorizable:
 DEAL::LinearAlgebra::distributed::Vector<double> && double = 1
 DEAL::LinearAlgebra::distributed::Vector<double> && float = 0
 DEAL::TrilinosWrappers::MPI::Vector && double = 0
+DEAL::Vector = 1
 DEAL::OK

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.