}
- template <int dim, int spacedim>
+ template <int spacedim>
inline static bool
- line_orientation(const TriaAccessor<3, dim, spacedim> &accessor,
- const unsigned int line)
+ line_orientation(const TriaAccessor<3, 3, spacedim> &accessor,
+ const unsigned int line)
{
Assert(accessor.used(), TriaAccessorExceptions::ExcCellNotUsed());
AssertIndexRange(line, GeometryInfo<3>::lines_per_cell);
- // get the line index by asking the
- // quads. first assume standard orientation
- //
- // set up a table that for each
- // line describes a) from which
- // quad to take it, b) which line
- // therein it is if the face is
- // oriented correctly
- static const unsigned int
- lookup_table[GeometryInfo<3>::lines_per_cell][2] = {
- {4, 0}, // take first four lines from bottom face
- {4, 1},
- {4, 2},
- {4, 3},
-
- {5, 0}, // second four lines from top face
- {5, 1},
- {5, 2},
- {5, 3},
-
- {0, 0}, // the rest randomly
- {1, 0},
- {0, 1},
- {1, 1}};
-
- const unsigned int quad_index = lookup_table[line][0];
- const unsigned int std_line_index = lookup_table[line][1];
-
- const unsigned int line_index =
- GeometryInfo<dim>::standard_to_real_face_line(
- std_line_index,
- accessor.face_orientation(quad_index),
- accessor.face_flip(quad_index),
- accessor.face_rotation(quad_index));
-
- // now we got to the correct line and ask
- // the quad for its line_orientation. however, if
- // the face is rotated, it might be possible,
- // that a standard orientation of the line
- // with respect to the face corresponds to a
- // non-standard orientation for the line with
+ const auto pair =
+ GeometryInfo<3>::standard_hex_line_to_quad_line_index(line);
+ const auto quad_index = pair[0];
+ const auto std_line_index = pair[1];
+ const auto line_index = GeometryInfo<3>::standard_to_real_face_line(
+ std_line_index,
+ accessor.face_orientation(quad_index),
+ accessor.face_flip(quad_index),
+ accessor.face_rotation(quad_index));
+
+ // now we got to the correct line and ask the quad for its
+ // line_orientation. however, if the face is rotated, it might be
+ // possible, that a standard orientation of the line with respect to
+ // the face corresponds to a non-standard orientation for the line with
// respect to the cell.
//
- // set up a table indicating if the two
- // standard orientations coincide
+ // set up a table indicating if the two standard orientations coincide
//
- // first index: two pairs of lines 0(lines
- // 0/1) and 1(lines 2/3)
+ // first index: two pairs of lines 0(lines 0/1) and 1(lines 2/3)
//
- // second index: face_orientation; 0:
- // opposite normal, 1: standard
+ // second index: face_orientation; 0: opposite normal, 1: standard
//
- // third index: face_flip; 0: standard, 1:
- // face rotated by 180 degrees
+ // third index: face_flip; 0: standard, 1: face rotated by 180 degrees
//
- // forth index: face_rotation: 0: standard,
- // 1: face rotated by 90 degrees
+ // forth index: face_rotation: 0: standard, 1: face rotated by 90
+ // degrees
static const bool bool_table[2][2][2][2] = {
{{{true, false}, // lines 0/1, face_orientation=false,