From: Peter Munch Date: Fri, 4 Sep 2020 10:05:41 +0000 (+0200) Subject: Make FEFaceNormalEvaluationImpl dimension independent X-Git-Tag: v9.3.0-rc1~1133^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10891%2Fhead;p=dealii.git Make FEFaceNormalEvaluationImpl dimension independent --- diff --git a/include/deal.II/matrix_free/evaluation_kernels.h b/include/deal.II/matrix_free/evaluation_kernels.h index e943f95cbb..2cf98626b6 100644 --- a/include/deal.II/matrix_free/evaluation_kernels.h +++ b/include/deal.II/matrix_free/evaluation_kernels.h @@ -1782,7 +1782,7 @@ namespace internal } private: - template + template static void interpolate_generic(const Number * input, Number * output, @@ -1793,50 +1793,55 @@ namespace internal const unsigned int dofs_per_component_on_cell, const unsigned int dofs_per_component_on_face) { - internal::EvaluatorTensorProduct - evalf(shape_data[face_no % 2], - AlignedVector(), - AlignedVector(), - n_points_1d, - 0); - - const unsigned int in_stride = - do_evaluate ? dofs_per_component_on_cell : dofs_per_component_on_face; - const unsigned int out_stride = - do_evaluate ? dofs_per_component_on_face : dofs_per_component_on_cell; - const unsigned int face_direction = face_no / 2; - for (unsigned int c = 0; c < n_components; c++) + if (face_direction == face_no / 2) { - if (do_gradients) - { - if (face_direction == 0) - evalf.template apply_face<0, do_evaluate, add_into_output, 1>( - input, output); - else if (face_direction == 1) - evalf.template apply_face<1, do_evaluate, add_into_output, 1>( - input, output); - else - evalf.template apply_face<2, do_evaluate, add_into_output, 1>( - input, output); - } - else + internal::EvaluatorTensorProduct + evalf(shape_data[face_no % 2], + AlignedVector(), + AlignedVector(), + n_points_1d, + 0); + + const unsigned int in_stride = do_evaluate ? + dofs_per_component_on_cell : + dofs_per_component_on_face; + const unsigned int out_stride = do_evaluate ? + dofs_per_component_on_face : + dofs_per_component_on_cell; + + for (unsigned int c = 0; c < n_components; c++) { - if (face_direction == 0) - evalf.template apply_face<0, do_evaluate, add_into_output, 0>( - input, output); - else if (face_direction == 1) - evalf.template apply_face<1, do_evaluate, add_into_output, 0>( - input, output); + if (do_gradients) + evalf.template apply_face(input, output); else - evalf.template apply_face<2, do_evaluate, add_into_output, 0>( - input, output); + evalf.template apply_face(input, output); + input += in_stride; + output += out_stride; } - input += in_stride; - output += out_stride; + } + else if (face_direction < dim) + { + interpolate_generic( + input, + output, + do_gradients, + face_no, + n_points_1d, + shape_data, + dofs_per_component_on_cell, + dofs_per_component_on_face); } } };