From: Maximilian Bergbauer Date: Thu, 25 May 2023 14:45:55 +0000 (+0200) Subject: Skip renumbering in tensor product kernels with template argument X-Git-Tag: v9.5.0-rc1~178^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=224a8c9af355588470566b75caaafa20c2c19211;p=dealii.git Skip renumbering in tensor product kernels with template argument --- diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index b3ab8942aa..e7e5f4b78e 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -1764,9 +1764,10 @@ FEPointEvaluation::compute_evaluate_fast( dim - 1, scalar_value_type, VectorizedArrayType, - 2>(shapes_faces.data() + qb * n_shapes, - n_shapes, - solution_renumbered.data()); + 2, + true>(shapes_faces.data() + qb * n_shapes, + n_shapes, + solution_renumbered.data()); value = interpolated_value[dim - 1]; // reorder derivative from tangential/normal derivatives into tensor in @@ -1816,9 +1817,11 @@ FEPointEvaluation::compute_evaluate_fast( internal::evaluate_tensor_product_value_and_gradient_shapes< dim, scalar_value_type, - VectorizedArrayType>(shapes.data() + qb * n_shapes, - n_shapes, - solution_renumbered.data()); + VectorizedArrayType, + 1, + true>(shapes.data() + qb * n_shapes, + n_shapes, + solution_renumbered.data()); gradient[0] = result[0]; if (dim > 1) gradient[1] = result[1]; diff --git a/include/deal.II/matrix_free/tensor_product_kernels.h b/include/deal.II/matrix_free/tensor_product_kernels.h index df3cb6cbd4..07d32da2fe 100644 --- a/include/deal.II/matrix_free/tensor_product_kernels.h +++ b/include/deal.II/matrix_free/tensor_product_kernels.h @@ -3042,7 +3042,8 @@ namespace internal int length, typename Number2, typename Number, - int n_values = 1> + int n_values = 1, + bool no_renumber = false> inline #ifndef DEBUG DEAL_II_ALWAYS_INLINE @@ -3078,7 +3079,7 @@ namespace internal // Distinguish the inner loop based on whether we have a // renumbering or not - if (renumber.empty()) + if (no_renumber || renumber.empty()) for (int i0 = 0; i0 < n_shapes; ++i0, ++i) { // gradient @@ -3129,7 +3130,11 @@ namespace internal * Interpolates the values and gradients into the points specified in * @p compute_values_of_array() with help of the precomputed @p shapes. */ - template + template inline std::array::type, dim + n_values> evaluate_tensor_product_value_and_gradient_shapes( @@ -3164,23 +3169,29 @@ namespace internal // Generate separate code with known loop bounds for the most common // cases if (n_shapes == 2) - inner_result = do_interpolate_xy( - values, renumber, shapes, n_shapes, i); + inner_result = + do_interpolate_xy( + values, renumber, shapes, n_shapes, i); else if (n_shapes == 3) - inner_result = do_interpolate_xy( - values, renumber, shapes, n_shapes, i); + inner_result = + do_interpolate_xy( + values, renumber, shapes, n_shapes, i); else if (n_shapes == 4) - inner_result = do_interpolate_xy( - values, renumber, shapes, n_shapes, i); + inner_result = + do_interpolate_xy( + values, renumber, shapes, n_shapes, i); else if (n_shapes == 5) - inner_result = do_interpolate_xy( - values, renumber, shapes, n_shapes, i); + inner_result = + do_interpolate_xy( + values, renumber, shapes, n_shapes, i); else if (n_shapes == 6) - inner_result = do_interpolate_xy( - values, renumber, shapes, n_shapes, i); + inner_result = + do_interpolate_xy( + values, renumber, shapes, n_shapes, i); else - inner_result = do_interpolate_xy( - values, renumber, shapes, n_shapes, i); + inner_result = + do_interpolate_xy( + values, renumber, shapes, n_shapes, i); if (dim == 3) { // derivative + interpolation in z direction