From: Peter Munch Date: Sun, 28 Nov 2021 17:00:20 +0000 (+0100) Subject: Introduce internal::VectorizedArrayTrait and use it X-Git-Tag: v9.4.0-rc1~793^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13001%2Fhead;p=dealii.git Introduce internal::VectorizedArrayTrait and use it --- diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 93432f5a9e..369863610f 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -5317,6 +5317,22 @@ compare_and_apply_mask(const VectorizedArray &left, #endif // DOXYGEN +namespace internal +{ + template + struct VectorizedArrayTrait + { + using value_type = T; + }; + + template + struct VectorizedArrayTrait> + { + using value_type = T; + }; +} // namespace internal + + DEAL_II_NAMESPACE_CLOSE /** diff --git a/include/deal.II/matrix_free/shape_info.h b/include/deal.II/matrix_free/shape_info.h index bab18e73a4..59fe6a9bc1 100644 --- a/include/deal.II/matrix_free/shape_info.h +++ b/include/deal.II/matrix_free/shape_info.h @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -267,6 +268,15 @@ namespace internal */ std::array, 2> subface_interpolation_matrices; + /** + * Same as above but stored in a scalar format independent of the type of + * Number + */ + std::array::value_type>, + 2> + subface_interpolation_matrices_scalar; + /** * We store a copy of the one-dimensional quadrature formula * used for initialization. diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index e1643d51da..c8a482d752 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -631,6 +631,10 @@ namespace internal univariate_shape_data.subface_interpolation_matrices[0]; auto &subface_interpolation_matrix_1 = univariate_shape_data.subface_interpolation_matrices[1]; + auto &subface_interpolation_matrix_scalar_0 = + univariate_shape_data.subface_interpolation_matrices_scalar[0]; + auto &subface_interpolation_matrix_scalar_1 = + univariate_shape_data.subface_interpolation_matrices_scalar[1]; const auto fe_1d = create_fe<1>(fe); const auto fe_2d = create_fe<2>(fe); @@ -666,6 +670,11 @@ namespace internal subface_interpolation_matrix_1.resize(fe_1d->n_dofs_per_cell() * fe_1d->n_dofs_per_cell()); + subface_interpolation_matrix_scalar_0.resize( + fe_1d->n_dofs_per_cell() * fe_1d->n_dofs_per_cell()); + subface_interpolation_matrix_scalar_1.resize( + fe_1d->n_dofs_per_cell() * fe_1d->n_dofs_per_cell()); + for (unsigned int i = 0, c = 0; i < fe_1d->n_dofs_per_cell(); ++i) for (unsigned int j = 0; j < fe_1d->n_dofs_per_cell(); ++j, ++c) { @@ -675,6 +684,13 @@ namespace internal subface_interpolation_matrix_1[c] = interpolation_matrix_1(scalar_lexicographic[i], scalar_lexicographic[j]); + + subface_interpolation_matrix_scalar_0[c] = + interpolation_matrix_0(scalar_lexicographic[i], + scalar_lexicographic[j]); + subface_interpolation_matrix_scalar_1[c] = + interpolation_matrix_1(scalar_lexicographic[i], + scalar_lexicographic[j]); } }