From: David Wells Date: Sat, 25 Jan 2025 14:40:58 +0000 (-0500) Subject: MatrixFreeFunctions::ShapeInfo: avoid face_flip() etc. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=672c1dba9d40c903fc33ecdee7567247893bf873;p=dealii.git MatrixFreeFunctions::ShapeInfo: avoid face_flip() etc. --- diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index e1a68ada61..1472c6c1a7 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -433,24 +433,21 @@ namespace internal for (unsigned int f = 0; f < n_faces; ++f) { const unsigned int n_face_orientations = - dim == 2 ? - 2 : - (2 * - reference_cell.face_reference_cell(f).n_vertices()); + reference_cell.n_face_orientations(f); const unsigned int n_q_points_face = quad_face[quad_face.size() == 1 ? 0 : f].size(); - for (unsigned int o = 0; o < n_face_orientations; ++o) + for (types::geometric_orientation orientation = 0; + orientation < n_face_orientations; + ++orientation) { - const auto offset = + // like elsewhere, the default in the matrix-free code + // is 0, not 1, so flip the first bit + const unsigned char mf_orientation = orientation ^ 1; + const auto offset = QProjector::DataSetDescriptor::face( - reference_cell, - f, - (o ^ 1) & 1, // face_orientation - (o >> 2) & 1, // face_flip - (o >> 1) & 1, // face_rotation - quad_face); + reference_cell, f, orientation, quad_face); for (unsigned int i = 0; i < n_dofs; ++i) for (unsigned int q = 0; q < n_q_points_face; ++q) @@ -458,14 +455,16 @@ namespace internal const auto &point = projected_quad_face.point(q + offset); - shape_values_face(f, o, i * n_q_points_face + q) = + shape_values_face(f, + mf_orientation, + i * n_q_points_face + q) = fe.shape_value(i, point); const auto grad = fe.shape_grad(i, point); for (unsigned int d = 0; d < dim; ++d) shape_gradients_face(f, - o, + mf_orientation, i * dim * n_q_points_face + q * dim + d) = grad[d]; }