for (const auto line : accessor.line_indices())
{
- const bool line_orientation = line_orientations[line];
- if (line_orientation)
+ const auto line_orientation = line_orientations[line];
+ if (line_orientation ==
+ ReferenceCell::default_combined_face_orientation())
dof_operation.process_dofs(
accessor.get_dof_handler(),
0,
* lines only have two possible orientations, this function and
* ReferenceCell::default_combined_face_orientation() encode all of its
* possible orientation states.
- *
- * @note Line orientations are typically stored as booleans, but to better
- * enable dimension-independent programming relevant functions typically
- * present these values as the standard orientation type.
*/
static constexpr types::geometric_orientation
reversed_combined_line_orientation();
const types::geometric_orientation face_orientation) const;
/**
- * Return whether the line with index @p line is oriented in
- * standard direction within a cell, given the @p face_orientation of
- * the face within the current cell, and @p line_orientation flag
- * for the line within that face. @p true indicates that the line is
- * oriented from vertex 0 to vertex 1, whereas it is the other way
- * around otherwise. In 1d and 2d, this is always @p true, but in 3d
- * it may be different, see the respective discussion in the
- * documentation of the GeometryInfo class.
+ * Return whether the line with index @p line is oriented in standard
+ * direction within a cell, given the @p face_orientation of the face within
+ * the current cell, and @p line_orientation for the line within that face.
*/
- bool
+ types::geometric_orientation
standard_vs_true_line_orientation(
const unsigned int line,
const unsigned int face,
const types::geometric_orientation face_orientation,
- const bool line_orientation) const;
+ const types::geometric_orientation line_orientation) const;
/**
* @}
-inline bool
+inline types::geometric_orientation
ReferenceCell::standard_vs_true_line_orientation(
const unsigned int line,
const unsigned int face,
const types::geometric_orientation combined_face_orientation,
- const bool line_orientation) const
+ const types::geometric_orientation line_orientation) const
{
+ constexpr auto D = ReferenceCell::default_combined_face_orientation();
+ constexpr auto R = ReferenceCell::reversed_combined_line_orientation();
if (*this == ReferenceCells::Hexahedron)
{
- static constexpr dealii::ndarray<bool, 2, 8> bool_table{
- {{{true, true, false, true, false, false, true, false}},
- {{true, true, true, false, false, false, false, true}}}};
-
- return (line_orientation ==
- bool_table[line / 2][combined_face_orientation]);
+ static constexpr dealii::ndarray<types::geometric_orientation, 2, 8>
+ table{{{{D, D, R, D, R, R, D, R}}, {{D, D, D, R, R, R, R, D}}}};
+ // We use line / 2 here since lines i and i + 1 are parallel and, on a
+ // given face, have the same relative orientations.
+ const bool match =
+ line_orientation == table[line / 2][combined_face_orientation];
+
+ return match ? ReferenceCell::default_combined_face_orientation() :
+ ReferenceCell::reversed_combined_line_orientation();
}
else if (*this == ReferenceCells::Tetrahedron)
{
"This function can only be called for following face-line "
"combinations: (0,0), (0,1), (0,2), (1,1), (1,2), (2,1),"));
- static constexpr dealii::ndarray<bool, 2, 6> bool_table{
- {{{false, true, false, true, false, true}},
- {{true, false, true, false, true, false}}}};
+ static constexpr dealii::ndarray<types::geometric_orientation, 2, 6>
+ table{{{{R, D, R, D, R, D}}, {{D, R, D, R, D, R}}}};
+
+ const bool match =
+ line_orientation == table[combined_line][combined_face_orientation];
- return (line_orientation ==
- bool_table[combined_line][combined_face_orientation]);
+ return match ? ReferenceCell::default_combined_face_orientation() :
+ ReferenceCell::reversed_combined_line_orientation();
}
else
// TODO: This might actually be wrong for some of the other
// kinds of objects. We should check this
- return true;
+ return ReferenceCell::default_combined_face_orientation();
}
/**
* Return whether the line with index @p line is oriented in standard
- * direction. @p true indicates, that the line is oriented from vertex 0 to
- * vertex 1, whereas it is the other way around otherwise. In 1d and 2d,
- * this is always @p true, but in 3d it may be different, see the respective
- * discussion in the documentation of the GeometryInfo class.
+ * direction.
*
- * This function is really only for internal use in the library unless you
- * absolutely know what this is all about.
+ * @warning This function is really only for internal use in the library
+ * unless you absolutely know what this is all about.
*
- * This function queries ReferenceCell::standard_vs_true_line_orientation().
+ * @note This function queries ReferenceCell::standard_vs_true_line_orientation().
*/
- bool
+ types::geometric_orientation
line_orientation(const unsigned int line) const;
/**
* @}
* <code>structdim==2 && dim==3</code>).
*/
void
- set_line_orientation(const unsigned int line, const bool orientation) const;
+ set_line_orientation(const unsigned int line,
+ const types::geometric_orientation orientation) const;
/**
* Set the combined face orientation (i.e., the integer that uniquely encodes
face_rotation(const unsigned int face);
/**
- * @brief Always return false
+ * @brief Always return ReferenceCell::reversed_combined_line_orientation()
*/
- static bool
+ static types::geometric_orientation
line_orientation(const unsigned int line);
/**
face_rotation(const unsigned int face);
/**
- * @brief Always return false
+ * @brief Always return ReferenceCell::reversed_combined_line_orientation()
*/
- static bool
+ static types::geometric_orientation
line_orientation(const unsigned int line);
/**
// efficient
std::array<types::geometric_orientation, 4> line_orientations = {};
for (const unsigned int line : cell.line_indices())
- line_orientations[line] =
- cell.line_orientation(line) == true ?
- ReferenceCell::default_combined_face_orientation() :
- ReferenceCell::reversed_combined_line_orientation();
+ line_orientations[line] = cell.line_orientation(line);
return line_orientations;
}
ref_cell.standard_to_real_face_line(1, f, orientation),
ref_cell.standard_to_real_face_line(2, f, orientation),
ref_cell.standard_to_real_face_line(3, f, orientation)}};
- const auto quad = cell.quad(f);
- const std::array<bool, 4> my_orientations{
- {ref_cell.standard_vs_true_line_orientation(
- 0, f, orientation, quad->line_orientation(my_indices[0])),
- ref_cell.standard_vs_true_line_orientation(
- 1, f, orientation, quad->line_orientation(my_indices[1])),
- ref_cell.standard_vs_true_line_orientation(
- 2, f, orientation, quad->line_orientation(my_indices[2])),
- ref_cell.standard_vs_true_line_orientation(
- 3,
- f,
- orientation,
- quad->line_orientation(my_indices[3]))}};
+ const auto quad = cell.quad(f);
+ const std::array<types::geometric_orientation, 4>
+ my_orientations{{ref_cell.standard_vs_true_line_orientation(
+ 0,
+ f,
+ orientation,
+ quad->line_orientation(my_indices[0])),
+ ref_cell.standard_vs_true_line_orientation(
+ 1,
+ f,
+ orientation,
+ quad->line_orientation(my_indices[1])),
+ ref_cell.standard_vs_true_line_orientation(
+ 2,
+ f,
+ orientation,
+ quad->line_orientation(my_indices[2])),
+ ref_cell.standard_vs_true_line_orientation(
+ 3,
+ f,
+ orientation,
+ quad->line_orientation(my_indices[3]))}};
for (unsigned int l = 0; l < 4; ++l)
line_orientations[4 * (f - 4) + l] = my_orientations[l];
}
const std::array<unsigned int, 2> my_indices{
{ref_cell.standard_to_real_face_line(0, f, orientation),
ref_cell.standard_to_real_face_line(1, f, orientation)}};
- const auto quad = cell.quad(f);
- const std::array<bool, 2> my_orientations{
- {ref_cell.standard_vs_true_line_orientation(
- 0, f, orientation, quad->line_orientation(my_indices[0])),
- ref_cell.standard_vs_true_line_orientation(
- 1,
- f,
- orientation,
- quad->line_orientation(my_indices[1]))}};
+ const auto quad = cell.quad(f);
+ const std::array<types::geometric_orientation, 2>
+ my_orientations{{ref_cell.standard_vs_true_line_orientation(
+ 0,
+ f,
+ orientation,
+ quad->line_orientation(my_indices[0])),
+ ref_cell.standard_vs_true_line_orientation(
+ 1,
+ f,
+ orientation,
+ quad->line_orientation(my_indices[1]))}};
line_orientations[8 + f] = my_orientations[0];
line_orientations[10 + f] = my_orientations[1];
}
this->reference_cell().standard_vertex_to_face_and_vertex_index(corner);
const auto vertex_within_line_index =
this->reference_cell().standard_to_real_face_vertex(
- vertex_index,
- line_index,
- this->line_orientation(line_index) == true ?
- ReferenceCell::default_combined_face_orientation() :
- ReferenceCell::reversed_combined_line_orientation());
+ vertex_index, line_index, this->line_orientation(line_index));
return this->line(line_index)->vertex_index(vertex_within_line_index);
}
// in 1d 'faces' are vertices and those are always consistently oriented
return true;
else if constexpr (structdim == 2)
- return this->line_orientation(face);
+ return this->line_orientation(face) ==
+ ReferenceCell::default_combined_face_orientation();
else
return this->tria->levels[this->present_level]
->face_orientations.get_orientation(
template <int structdim, int dim, int spacedim>
-inline bool
+inline types::geometric_orientation
TriaAccessor<structdim, dim, spacedim>::line_orientation(
const unsigned int line) const
{
(void)line;
if constexpr (structdim == 1)
- return true;
+ return ReferenceCell::default_combined_face_orientation();
else if constexpr (structdim == 2 && dim == 2)
// lines in 2d are faces
{
combined_orientation ==
ReferenceCell::reversed_combined_line_orientation(),
ExcInternalError());
- return combined_orientation ==
- ReferenceCell::default_combined_face_orientation() ?
- true :
- false;
+ return combined_orientation;
}
else if constexpr (structdim == 2 && dim == 3)
{
- // line orientations in 3d are stored in their own array
- Assert(this->present_index * ReferenceCells::max_n_lines<2>() + line <
- this->tria->faces->quads_line_orientations.size(),
+ // line orientations in 3d are stored in their own array as bools: here
+ // 'true' is the default orientation and 'false' is the reversed one
+ // (which matches set_line_orientation())
+ const auto index =
+ this->present_index * ReferenceCells::max_n_lines<2>() + line;
+ Assert(index < this->tria->faces->quads_line_orientations.size(),
ExcInternalError());
- return this->tria->faces->quads_line_orientations
- [this->present_index * ReferenceCells::max_n_lines<2>() + line];
+ return this->tria->faces->quads_line_orientations[index] ?
+ ReferenceCell::default_combined_face_orientation() :
+ ReferenceCell::reversed_combined_line_orientation();
}
else if constexpr (structdim == 3 && dim == 3)
{
template <int structdim, int dim, int spacedim>
inline void
TriaAccessor<structdim, dim, spacedim>::set_line_orientation(
- const unsigned int line,
- const bool value) const
+ const unsigned int line,
+ const types::geometric_orientation value) const
{
Assert(used(), TriaAccessorExceptions::ExcCellNotUsed());
AssertIndexRange(line, this->n_lines());
if constexpr (dim == 3)
{
// We set line orientations per face, not per cell, so this only works for
- // faces in 3d
+ // faces in 3d.
Assert(structdim == 2, ExcNotImplemented());
- Assert(this->present_index * ReferenceCells::max_n_lines<2>() + line <
- this->tria->faces->quads_line_orientations.size(),
+ const auto index =
+ this->present_index * ReferenceCells::max_n_lines<2>() + line;
+ Assert(index < this->tria->faces->quads_line_orientations.size(),
ExcInternalError());
- this->tria->faces->quads_line_orientations
- [this->present_index * ReferenceCells::max_n_lines<2>() + line] = value;
+ this->tria->faces->quads_line_orientations[index] =
+ value == ReferenceCell::default_combined_face_orientation();
}
}
template <int dim, int spacedim>
-inline bool
+inline types::geometric_orientation
TriaAccessor<0, dim, spacedim>::line_orientation(const unsigned int /*line*/)
{
- return false;
+ return ReferenceCell::reversed_combined_line_orientation();
}
template <int spacedim>
-inline bool
+inline types::geometric_orientation
TriaAccessor<0, 1, spacedim>::line_orientation(const unsigned int /*line*/)
{
- return false;
+ return ReferenceCell::reversed_combined_line_orientation();
}
GeometryInfo<dim>::vertices_per_face * fe.n_dofs_per_vertex() +
line * fe.n_dofs_per_line() + line_dof_idx;
- // Note, assuming that the edge orientations are "standard"
- // i.e. cell->line_orientation(line) = true.
- Assert(cell->line_orientation(line),
+ // Note, assuming that the edge orientations are "standard", i.e.,
+ // cell->line_orientation(line) =
+ // ReferenceCell::default_combined_face_orientation()
+ Assert(cell->line_orientation(line) ==
+ ReferenceCell::default_combined_face_orientation(),
ExcMessage("Edge orientation does not meet expectation."));
// Next, translate from face to cell. Note, this might be assuming
- // that the edge orientations are "standard" (not sure any more at
- // this time), i.e.
- // cell->line_orientation(line) = true.
+ // that the edge orientations are "standard"
const unsigned int cell_dof_idx =
fe.face_to_cell_index(face_dof_idx, face);
line * fe.n_dofs_per_line() + line_dof_idx;
// Next, translate from face to cell. Note, this might be
- // assuming that the edge orientations are "standard" (not
- // sure any more at this time), i.e.
- // cell->line_orientation(line) = true.
+ // assuming that the edge orientations are "standard"
const unsigned int cell_dof_idx =
fe.face_to_cell_index(face_dof_idx, face);
const unsigned int dim = 2;
// TODO: This fixes only lowest order
for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
- if (!(cell->line_orientation(l)) &&
+ if ((cell->line_orientation(l) ==
+ ReferenceCell::reversed_combined_line_orientation()) &&
mapping_kind[0] == mapping_nedelec)
line_dof_sign[l] = -1.0;
}
// TODO: This is probably only going to work for those elements for
// which all dofs are face dofs
for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
- if (!(cell->line_orientation(l)) &&
+ if ((cell->line_orientation(l) ==
+ ReferenceCell::reversed_combined_line_orientation()) &&
mapping_kind[0] == mapping_nedelec)
line_dof_sign[l] = -1.0;
}
combined_orientation ==
ReferenceCell::reversed_combined_line_orientation(),
ExcInternalError());
+ // Same convention as TriaAccessor::set_line_orientation():
+ // store true for the default orientation and false for
+ // reversed.
faces.quads_line_orientations
[q * ReferenceCells::max_n_lines<2>() + j] =
combined_orientation ==
switch_1->line_index(2)),
static_cast<signed int>(
switch_1->line_index(3))};
- const bool switch_1_line_orientations[4] = {
- switch_1->line_orientation(0),
- switch_1->line_orientation(1),
- switch_1->line_orientation(2),
- switch_1->line_orientation(3)};
+ const types::geometric_orientation
+ switch_1_line_orientations[4] = {
+ switch_1->line_orientation(0),
+ switch_1->line_orientation(1),
+ switch_1->line_orientation(2),
+ switch_1->line_orientation(3)};
const types::boundary_id switch_1_boundary_id =
switch_1->boundary_id();
const unsigned int switch_1_user_index =
s.insert(i);
#endif
- new_quad->set_line_orientation(
- f,
- orientation ==
- ReferenceCell::
- default_combined_face_orientation());
+ new_quad->set_line_orientation(f, orientation);
}
#ifdef DEBUG
AssertDimension(s.size(), 3);
numbers::internal_face_boundary_id);
new_quad->set_manifold_id(hex->manifold_id());
for (const auto j : new_quads[i]->line_indices())
- new_quad->set_line_orientation(j, true);
+ new_quad->set_line_orientation(
+ j, ReferenceCell::default_combined_face_orientation());
}
// we always get 8 children per refined cell
make_array_view(vertices_0),
make_array_view(vertices_1));
- new_quad->set_line_orientation(
- l,
- orientation ==
- ReferenceCell::
- default_combined_face_orientation());
+ new_quad->set_line_orientation(l, orientation);
// on a hex, inject the status of the current line
// also to the line on the other quad along the
ReferenceCells::Hexahedron)
new_quads[representative_lines[q % 4][1] + q -
(q % 4)]
- ->set_line_orientation(
- l,
- orientation ==
- ReferenceCell::
- default_combined_face_orientation());
+ ->set_line_orientation(l, orientation);
}
}
}
for (unsigned int j = 0;
j < GeometryInfo<dim>::lines_per_face;
++j)
- new_quad->set_line_orientation(j, true);
+ new_quad->set_line_orientation(
+ j,
+ ReferenceCell::default_combined_face_orientation());
}
// now set the line orientation of children of
// outer lines correctly, the lines in the
switch_1->line_index(1),
switch_1->line_index(2),
switch_1->line_index(3)};
- const bool switch_1_line_orientations[4] = {
- switch_1->line_orientation(0),
- switch_1->line_orientation(1),
- switch_1->line_orientation(2),
- switch_1->line_orientation(3)};
+ const types::geometric_orientation
+ switch_1_line_orientations[4] = {
+ switch_1->line_orientation(0),
+ switch_1->line_orientation(1),
+ switch_1->line_orientation(2),
+ switch_1->line_orientation(3)};
const types::boundary_id switch_1_boundary_id =
switch_1->boundary_id();
const unsigned int switch_1_user_index =
for (unsigned int j = 0;
j < GeometryInfo<dim>::lines_per_face;
++j)
- new_quad->set_line_orientation(j, true);
+ new_quad->set_line_orientation(
+ j,
+ ReferenceCell::default_combined_face_orientation());
}
// now set the line orientation of children of
// outer lines correctly, the lines in the
for (unsigned int j = 0;
j < GeometryInfo<dim>::lines_per_face;
++j)
- new_quads[i]->set_line_orientation(j, true);
+ new_quads[i]->set_line_orientation(
+ j,
+ ReferenceCell::default_combined_face_orientation());
}
types::subdomain_id subdomainid = hex->subdomain_id();
// created ones and thus have no parents, they
// cannot inherit this property. set up an array
// and fill it with the respective values
- bool line_orientation[4];
+ types::geometric_orientation line_orientation[4]{};
// the middle vertex marked as m0 above is the
// start vertex for lines 0 and 2 in standard
for (unsigned int i = 0; i < 4; ++i)
if (lines[i]->vertex_index(i % 2) ==
middle_vertices[i % 2])
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
- // it must be the other
- // way round then
+ // it must be the other way round then
Assert(lines[i]->vertex_index((i + 1) % 2) ==
middle_vertices[i % 2],
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// set up the new quad, line numbering is as
// created ones and thus have no parents, they
// cannot inherit this property. set up an array
// and fill it with the respective values
- bool line_orientation[4];
+ types::geometric_orientation line_orientation[4]{};
// the middle vertex marked as m0 above is the
// start vertex for lines 0 and 2 in standard
for (unsigned int i = 0; i < 4; ++i)
if (lines[i]->vertex_index(i % 2) ==
middle_vertices[i % 2])
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
// it must be the other way round then
Assert(lines[i]->vertex_index((i + 1) % 2) ==
middle_vertices[i % 2],
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// set up the new quad, line numbering is as
// created ones and thus have no parents, they
// cannot inherit this property. set up an array
// and fill it with the respective values
- bool line_orientation[4];
+ types::geometric_orientation line_orientation[4]{};
// the middle vertex marked as m0 above is the
// start vertex for lines 0 and 2 in standard
for (unsigned int i = 0; i < 4; ++i)
if (lines[i]->vertex_index(i % 2) ==
middle_vertices[i % 2])
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
// it must be the other way round then
Assert(lines[i]->vertex_index((i + 1) % 2) ==
middle_vertices[i % 2],
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// set up the new quad, line numbering is as
// created ones and thus have no parents, they
// cannot inherit this property. set up an array
// and fill it with the respective values
- bool line_orientation[13];
+ types::geometric_orientation line_orientation[13]{};
// the middle vertices of the lines of our
// bottom face
// face
for (unsigned int i = 0; i < 4; ++i)
if (lines[i]->vertex_index(0) == middle_vertices[i])
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
// it must be the other way round then
Assert(lines[i]->vertex_index(1) ==
middle_vertices[i],
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// note: for lines 4 to 11 (inner lines of the
if (lines[i]->vertex_index((i + 1) % 2) ==
middle_vertex_index<dim, spacedim>(
hex->face(3 + i / 4)))
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
- // it must be the other way
- // round then
+ // it must be the other way round then
Assert(lines[i]->vertex_index(i % 2) ==
(middle_vertex_index<dim, spacedim>(
hex->face(3 + i / 4))),
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// for the last line the line orientation is
// always true, since it was just constructed
// that way
- line_orientation[12] = true;
+ line_orientation[12] =
+ ReferenceCell::default_combined_face_orientation();
// set up the 4 quads, numbered as follows (left
// quad numbering, right line numbering
// created ones and thus have no parents, they
// cannot inherit this property. set up an array
// and fill it with the respective values
- bool line_orientation[13];
+ types::geometric_orientation line_orientation[13]{};
// the middle vertices of the
// lines of our front face
// line is 'true', if vertex 0 is on the front
for (unsigned int i = 0; i < 4; ++i)
if (lines[i]->vertex_index(0) == middle_vertices[i])
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
// it must be the other way round then
Assert(lines[i]->vertex_index(1) ==
middle_vertices[i],
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// note: for lines 4 to 11 (inner lines of the
if (lines[i]->vertex_index((i + 1) % 2) ==
middle_vertex_index<dim, spacedim>(
hex->face(1 + i / 4)))
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
// it must be the other way
(middle_vertex_index<dim, spacedim>(
hex->face(1 + i / 4))),
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// for the last line the line orientation is
// always true, since it was just constructed
// that way
- line_orientation[12] = true;
+ line_orientation[12] =
+ ReferenceCell::default_combined_face_orientation();
// set up the 4 quads, numbered as follows (left
// quad numbering, right line numbering
// created ones and thus have no parents, they
// cannot inherit this property. set up an array
// and fill it with the respective values
- bool line_orientation[13];
+ types::geometric_orientation line_orientation[13]{};
// the middle vertices of the lines of our front
// face
// line is 'true', if vertex 0 is on the front
for (unsigned int i = 0; i < 4; ++i)
if (lines[i]->vertex_index(0) == middle_vertices[i])
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
// it must be the other way round then
Assert(lines[i]->vertex_index(1) ==
middle_vertices[i],
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// note: for lines 4 to 11 (inner lines of the
if (lines[i]->vertex_index((i + 1) % 2) ==
middle_vertex_index<dim, spacedim>(
hex->face(i / 4 - 1)))
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
- // it must be the other way
- // round then
+ // it must be the other way round then
Assert(lines[i]->vertex_index(i % 2) ==
(middle_vertex_index<dim, spacedim>(
hex->face(i / 4 - 1))),
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
- // for the last line the line orientation is
- // always true, since it was just constructed
- // that way
- line_orientation[12] = true;
+ // for the last line the line orientation is always
+ // the default, since it was just constructed that way
+ line_orientation[12] =
+ ReferenceCell::default_combined_face_orientation();
// set up the 4 quads, numbered as follows (left
// quad numbering, right line numbering
// created ones and thus have no parents, they
// cannot inherit this property. set up an array
// and fill it with the respective values
- bool line_orientation[30];
+ types::geometric_orientation line_orientation[30]{};
// note: for the first 24 lines (inner lines of
// the outer quads) the following holds: the
for (unsigned int i = 0; i < 24; ++i)
if (lines[i]->vertex_index((i + 1) % 2) ==
vertex_indices[i / 4])
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
else
{
// it must be the other way
Assert(lines[i]->vertex_index(i % 2) ==
vertex_indices[i / 4],
ExcInternalError());
- line_orientation[i] = false;
+ line_orientation[i] = ReferenceCell::
+ reversed_combined_line_orientation();
}
// for the last 6 lines the line orientation is
// always true, since they were just constructed
// that way
for (unsigned int i = 24; i < 30; ++i)
- line_orientation[i] = true;
+ line_orientation[i] = ReferenceCell::
+ default_combined_face_orientation();
// set up the 12 quads, numbered as follows
// (left quad numbering, right line numbering
if (ref_cell == ReferenceCells::Hexahedron)
for (unsigned int face = 4; face < 6; ++face)
{
- const auto face_iter = cell->face(face);
- const std::array<bool, 2> line_orientations{
- {face_iter->line_orientation(0),
- face_iter->line_orientation(1)}};
+ const auto face_iter = cell->face(face);
+ const std::array<types::geometric_orientation, 2>
+ line_orientations{{face_iter->line_orientation(0),
+ face_iter->line_orientation(1)}};
std::array<unsigned int, 4> raw_vertex_indices{
{face_iter->line(0)->vertex_index(1 - line_orientations[0]),
face_iter->line(1)->vertex_index(1 - line_orientations[1]),
}
else if (ref_cell == ReferenceCells::Quadrilateral)
{
- const std::array<bool, 2> line_orientations{
- {cell->line_orientation(0), cell->line_orientation(1)}};
+ const std::array<types::geometric_orientation, 2>
+ line_orientations{
+ {cell->line_orientation(0), cell->line_orientation(1)}};
std::array<unsigned int, 4> raw_vertex_indices{
{cell->line(0)->vertex_index(1 - line_orientations[0]),
cell->line(1)->vertex_index(1 - line_orientations[1]),
++line_index)
{
deallog << " {" << line_index << " -> "
- << cell->line_orientation(line_index) << "}"
- << std::endl;
+ << (cell->line_orientation(line_index) ==
+ ReferenceCell::default_combined_face_orientation())
+ << "}" << std::endl;
} // line_index
} // cell
} // plot_mesh_properties
++line_index)
{
deallog << " {" << line_index << " -> "
- << cell->line_orientation(line_index) << "}"
- << std::endl;
+ << (cell->line_orientation(line_index) ==
+ ReferenceCell::default_combined_face_orientation())
+ << "}" << std::endl;
} // line_index
} // cell
} // plot_mesh_properties
<< (c->face_flip(f) ? "/true" : "/false") << std::endl;
for (unsigned int e = 0; e < GeometryInfo<3>::lines_per_cell; ++e)
deallog << " edge=" << e
- << (c->line_orientation(e) ? " -> true" : " -> false")
+ << (c->line_orientation(e) ==
+ ReferenceCell::default_combined_face_orientation() ?
+ " -> true" :
+ " -> false")
<< std::endl;
}
}
<< (c->face_flip(f) ? "/true" : "/false") << std::endl;
for (unsigned int e = 0; e < GeometryInfo<3>::lines_per_cell; ++e)
deallog << " edge=" << e
- << (c->line_orientation(e) ? " -> true" : " -> false")
+ << (c->line_orientation(e) ==
+ ReferenceCell::default_combined_face_orientation() ?
+ " -> true" :
+ " -> false")
<< std::endl;
}
}
<< (c->face_flip(f) ? "/true" : "/false") << std::endl;
for (unsigned int e = 0; e < GeometryInfo<3>::lines_per_cell; ++e)
deallog << " edge=" << e
- << (c->line_orientation(e) ? " -> true" : " -> false")
+ << (c->line_orientation(e) ==
+ ReferenceCell::default_combined_face_orientation() ?
+ " -> true" :
+ " -> false")
<< std::endl;
}
}
++line)
{
deallog << line << ": "
- << (cell->line_orientation(line) ? "true" : "false")
+ << (cell->line_orientation(line) ==
+ ReferenceCell::default_combined_face_orientation() ?
+ "true" :
+ "false")
<< std::endl;
- Assert(cell->line_orientation(line) == true, ExcInternalError());
+ Assert(cell->line_orientation(line) ==
+ ReferenceCell::default_combined_face_orientation(),
+ ExcInternalError());
}
}
}
line_index < GeometryInfo<dim>::lines_per_cell;
++line_index)
{
- deallog << cell->line_orientation(line_index) << " ";
+ deallog << (cell->line_orientation(line_index) ==
+ ReferenceCell::default_combined_face_orientation())
+ << " ";
} // line_index
deallog << '}' << std::endl << std::endl;
} // cell
line_index < GeometryInfo<dim>::lines_per_cell;
++line_index)
{
- deallog << cell->line_orientation(line_index) << " ";
+ deallog << (cell->line_orientation(line_index) ==
+ ReferenceCell::default_combined_face_orientation())
+ << " ";
} // line_index
deallog << '}' << std::endl << std::endl;
} // cell
p1.first = cell->line(l)->vertex_index(0);
p1.second = cell->line(l)->vertex_index(1);
- if (orientation_exp == false)
+ if (orientation_exp ==
+ ReferenceCell::reversed_combined_line_orientation())
std::swap(p1.first, p1.second);
success &= (p0 == p1);