From 7ed7ae86f90f4ffd21a575002f63980c840439e2 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 24 Feb 2019 18:06:17 +0100 Subject: [PATCH] change is_vectorizable to work with serial vectors --- include/deal.II/matrix_free/fe_evaluation.h | 3 ++- tests/matrix_free/fe_evaluation_type_traits.cc | 10 +++++++++- ...fe_evaluation_type_traits.with_trilinos=true.output | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index 56b5a6b2b2..f8b4975bf9 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -3480,7 +3480,8 @@ namespace internal struct is_vectorizable { static constexpr bool value = - has_begin::value && has_local_element::value && + has_begin::value && + (has_local_element::value || is_serial_vector::value) && std::is_same::value; }; diff --git a/tests/matrix_free/fe_evaluation_type_traits.cc b/tests/matrix_free/fe_evaluation_type_traits.cc index a574038442..762da8b50d 100644 --- a/tests/matrix_free/fe_evaluation_type_traits.cc +++ b/tests/matrix_free/fe_evaluation_type_traits.cc @@ -109,6 +109,8 @@ main() << "Dummy = " << internal::has_local_element>::value << std::endl << "Dummy2 = " << internal::has_local_element>::value + << std::endl + << "Vector = " << internal::has_local_element>::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>::value << std::endl; // check has_begin: @@ -136,7 +141,8 @@ main() << internal::has_begin>::value << std::endl << "TrilinosWrappers::MPI::Vector = " - << internal::has_begin::value << std::endl; + << internal::has_begin::value << std::endl + << "Vector = " << internal::has_begin>::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::value + << std::endl + << "Vector = " << internal::is_vectorizable, double>::value << std::endl; deallog << "OK" << std::endl; diff --git a/tests/matrix_free/fe_evaluation_type_traits.with_trilinos=true.output b/tests/matrix_free/fe_evaluation_type_traits.with_trilinos=true.output index d6140df342..801cf4191e 100644 --- a/tests/matrix_free/fe_evaluation_type_traits.with_trilinos=true.output +++ b/tests/matrix_free/fe_evaluation_type_traits.with_trilinos=true.output @@ -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 = 1 DEAL::LinearAlgebra::distributed::Vector && float = 0 DEAL::TrilinosWrappers::MPI::Vector && double = 0 +DEAL::Vector = 1 DEAL::OK -- 2.39.5