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<dim>::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)
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];
}