From: Peter Munch Date: Thu, 3 Sep 2020 21:52:20 +0000 (+0200) Subject: Remove VectorType from FEFaceEvaluationSelector X-Git-Tag: v9.3.0-rc1~1135^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10889%2Fhead;p=dealii.git Remove VectorType from FEFaceEvaluationSelector --- diff --git a/include/deal.II/matrix_free/evaluation_kernels.h b/include/deal.II/matrix_free/evaluation_kernels.h index 120f8fe705..6a41e028ed 100644 --- a/include/deal.II/matrix_free/evaluation_kernels.h +++ b/include/deal.II/matrix_free/evaluation_kernels.h @@ -2042,44 +2042,10 @@ namespace internal data, temp1, values_array, integrate_gradients, face_no); } - template ::value || - !std::is_same().begin()), - Number2 *>::value, - VectorType>::type * = nullptr> - static bool - gather_evaluate(const VectorType &, - const MatrixFreeFunctions::ShapeInfo &, - const MatrixFreeFunctions::DoFInfo &, - VectorizedArrayType *, - VectorizedArrayType *, - VectorizedArrayType *, - const bool, - const bool, - const unsigned int, - const unsigned int, - const std::array, - const std::array, - const unsigned int, - const MatrixFreeFunctions::DoFInfo::DoFAccessIndex, - const std::array, - const Table<2, unsigned int> &) - { - return false; - } - - template ::value && - std::is_same().begin()), - Number2 *>::value, - VectorType>::type * = nullptr> + template static bool gather_evaluate( - const VectorType & src, + const Number2 * src_ptr, const MatrixFreeFunctions::ShapeInfo &data, const MatrixFreeFunctions::DoFInfo & dof_info, VectorizedArrayType * values_quad, @@ -2096,13 +2062,14 @@ namespace internal const std::array face_orientations, const Table<2, unsigned int> & orientation_map) { - static_assert((std::is_same().begin()), - Number2 *>::value), - "Types do not match."); + if (src_ptr == nullptr) + { + return false; + } return process_and_io( // false /*=evaluate*/, - src.begin(), + src_ptr, data, dof_info, values_quad, @@ -2204,63 +2171,10 @@ namespace internal }); } - template ::value || - !std::is_same().begin()), - Number2 *>::value, - VectorType>::type * = nullptr> + template static bool integrate_scatter( - VectorType &, - const MatrixFreeFunctions::ShapeInfo &data, - const MatrixFreeFunctions::DoFInfo &, - VectorizedArrayType *values_array, - VectorizedArrayType *values_quad, - VectorizedArrayType *gradients_quad, - VectorizedArrayType *scratch_data, - const bool integrate_values, - const bool integrate_gradients, - const unsigned int, - const unsigned int, - const std::array, - const std::array face_nos, - const unsigned int subface_index, - const MatrixFreeFunctions::DoFInfo::DoFAccessIndex, - const std::array face_orientations, - const Table<2, unsigned int> & orientation_map) - { - AssertDimension(face_nos.size(), 1); - AssertDimension(face_orientations.size(), 1); - - // for block vectors simply integrate - integrate(data, - values_array, - values_quad, - gradients_quad, - scratch_data, - integrate_values, - integrate_gradients, - face_nos[0], - subface_index, - face_orientations[0], - orientation_map); - - // default vector access - return false; - } - - template ::value && - std::is_same().begin()), - Number2 *>::value, - VectorType>::type * = nullptr> - static bool - integrate_scatter( - VectorType & dst, + Number2 * dst_ptr, const MatrixFreeFunctions::ShapeInfo &data, const MatrixFreeFunctions::DoFInfo & dof_info, VectorizedArrayType * values_array, @@ -2278,13 +2192,31 @@ namespace internal const std::array face_orientations, const Table<2, unsigned int> & orientation_map) { - static_assert((std::is_same().begin()), - Number2 *>::value), - "Types do not match."); + if (dst_ptr == nullptr) + { + AssertDimension(face_nos.size(), 1); + AssertDimension(face_orientations.size(), 1); + + // for block vectors simply integrate + integrate(data, + values_array, + values_quad, + gradients_quad, + scratch_data, + integrate_values, + integrate_gradients, + face_nos[0], + subface_index, + face_orientations[0], + orientation_map); + + // default vector access + return false; + } return process_and_io( // true /*=integrate*/, - dst.begin(), + dst_ptr, data, dof_info, values_quad, diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index b91ba87259..aa4bc939e3 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -7499,6 +7499,44 @@ namespace internal { return false; } + + template ::value && + (std::is_same().begin()), + const double *>::value || + std::is_same().begin()), + double *>::value || + std::is_same().begin()), + const float *>::value || + std::is_same().begin()), + float *>::value), + VectorType>::type * = nullptr> + decltype(std::declval().begin()) + get_beginning(VectorType &vec) + { + return vec.begin(); + } + + template ::value || + !(std::is_same().begin()), + const double *>::value || + std::is_same().begin()), + double *>::value || + std::is_same().begin()), + const float *>::value || + std::is_same().begin()), + float *>::value), + VectorType>::type * = nullptr> + typename VectorType::value_type * + get_beginning(VectorType &) + { + return nullptr; + } } // namespace internal template :: - gather_evaluate(input_vector, + gather_evaluate(internal::get_beginning(input_vector), *this->data, *this->dof_info, this->begin_values(), @@ -8253,7 +8291,7 @@ FEFaceEvaluation:: - gather_evaluate(input_vector, + gather_evaluate(internal::get_beginning(input_vector), *this->data, *this->dof_info, this->begin_values(), @@ -8345,7 +8383,7 @@ FEFaceEvaluation:: - integrate_scatter(destination, + integrate_scatter(internal::get_beginning(destination), *this->data, *this->dof_info, this->begin_dof_values(),