]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add internal::has_partitioners_are_compatible<>
authorDenis Davydov <davydden@gmail.com>
Thu, 21 Feb 2019 22:20:50 +0000 (23:20 +0100)
committerDenis Davydov <davydden@gmail.com>
Thu, 21 Feb 2019 22:20:50 +0000 (23:20 +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 dc97327d079722474b7eb1254364fae6fe49b96f..c7c2d8b8903c678f9a999436c1ae5cb2f93d8da6 100644 (file)
@@ -3438,6 +3438,27 @@ namespace internal
   };
 
 
+  // same as above to check
+  // bool T::partitioners_are_compatible(const Utilities::MPI::Partitioner &)
+  // const
+  template <typename T>
+  struct has_partitioners_are_compatible
+  {
+  private:
+    static void
+    detect(...);
+
+    template <typename U>
+    static decltype(std::declval<U const>().partitioners_are_compatible(
+      std::declval<Utilities::MPI::Partitioner>()))
+    detect(const U &);
+
+  public:
+    static constexpr bool value =
+      std::is_same<bool, decltype(detect(std::declval<T>()))>::value;
+  };
+
+
   // access to generic vectors that have operator ().
   // FIXME: this is wrong for Trilinos/Petsc MPI vectors
   template <typename VectorType,
index 458a625e8adadd746107171c9a95580f893f5d39..12ab08476b5b76d6f496ed07ac3efebe27f3f15e 100644 (file)
@@ -118,5 +118,16 @@ main()
   internal::vector_access(dummy2, 0);
 
 
+  // now check has_partitioners_are_compatible:
+  deallog << "has_partitioners_are_compatible:" << std::endl
+          << "LinearAlgebra::distributed::Vector = "
+          << internal::has_partitioners_are_compatible<
+               LinearAlgebra::distributed::Vector<double>>::value
+          << std::endl
+          << "TrilinosWrappers::MPI::Vector = "
+          << internal::has_partitioners_are_compatible<
+               TrilinosWrappers::MPI::Vector>::value
+          << std::endl;
+
   deallog << "OK" << std::endl;
 }
index 78f0765434191f5bd86128feb2fe85afa073ad31..4e82d5220255e34b378ffc3ec424e0ded7f137c2 100644 (file)
@@ -7,4 +7,7 @@ DEAL::Dummy2 = 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::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.