ExcMessage("first_vector_components is nonempty, so matrix must "
"be a rotation matrix exactly of size spacedim"));
+ const unsigned char combined_orientation =
+ ::dealii::internal::combined_face_orientation(face_orientation,
+ face_rotation,
+ face_flip);
+
#ifdef DEBUG
if (!face_1->has_children())
{
}
#endif
- // A lookup table on how to go through the child faces depending on the
- // orientation:
-
- static const int lookup_table_2d[2][2] = {
- // flip:
- {0, 1}, // false
- {1, 0}, // true
- };
-
- static const int lookup_table_3d[2][2][2][4] = {
- // orientation flip rotation
- {
- {
- {0, 2, 1, 3}, // false false false
- {2, 3, 0, 1}, // false false true
- },
- {
- {3, 1, 2, 0}, // false true false
- {1, 0, 3, 2}, // false true true
- },
- },
- {
- {
- {0, 1, 2, 3}, // true false false
- {1, 3, 0, 2}, // true false true
- },
- {
- {3, 2, 1, 0}, // true true false
- {2, 0, 3, 1}, // true true true
- },
- },
- };
-
if (face_1->has_children() && face_2->has_children())
{
// In the case that both faces have children, we loop over all children
for (unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face;
++i)
{
- // Lookup the index for the second face
- unsigned int j = numbers::invalid_unsigned_int;
- switch (dim)
- {
- case 2:
- j = lookup_table_2d[face_flip][i];
- break;
- case 3:
- j = lookup_table_3d[face_orientation][face_flip]
- [face_rotation][i];
- break;
- default:
- AssertThrow(false, ExcNotImplemented());
- }
+ // We need to access the subface indices without knowing the face
+ // number. Hence, we pick the lowest-value face: i.e., face 2 in 2D
+ // has subfaces {0, 1} and face 4 in 3D has subfaces {0, 1, 2, 3}.
+ const unsigned int face_no = dim == 2 ? 2 : 4;
+
+ // Lookup the index for the second face. Like the assertions above,
+ // this is only presently valid for hypercube meshes.
+ const auto reference_cell = ReferenceCells::get_hypercube<dim>();
+ const unsigned int j =
+ reference_cell.child_cell_on_face(face_no,
+ i,
+ combined_orientation);
make_periodicity_constraints(face_1->child(i),
face_2->child(j),