const unsigned int raw_orientation = TriaAccessorImplementation::
Implementation::face_orientation_raw(accessor, quad);
const unsigned int quad_index = accessor.quad_index(quad);
- if (raw_orientation == 1)
+ if (raw_orientation ==
+ ReferenceCell::default_combined_face_orientation())
dof_operation.process_dofs(
accessor.get_dof_handler(),
0,
const unsigned int f = con_cq.col[f_];
// only faces with default orientation have to do something
- if (ori_cq.get_raw_orientation(f_) != 1u)
+ if (ori_cq.get_raw_orientation(f_) !=
+ ReferenceCell::default_combined_face_orientation())
continue;
// determine entity type of face
}
// ... comparison gives orientation
- ori_ql.set_raw_orientation(con_ql.ptr[f] + l, same ? 1u : 0u);
+ ori_ql.set_raw_orientation(
+ con_ql.ptr[f] + l,
+ same ? ReferenceCell::default_combined_face_orientation() :
+ ReferenceCell::reversed_combined_line_orientation());
}
}
}
static constexpr unsigned char
default_combined_face_orientation();
+ /**
+ * Return the reversed (non-default orientation) line orientation flag. As
+ * 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 unsigned chars.
+ */
+ static constexpr unsigned char
+ reversed_combined_line_orientation();
+
/**
* Return which child cells are adjacent to a certain face of the
* mother cell.
unsigned int
child_cell_on_face(const unsigned int face,
const unsigned int subface,
- const unsigned char face_orientation = 1) const;
+ const unsigned char face_orientation =
+ default_combined_face_orientation()) const;
/**
* For a given vertex in a cell, return a pair of a face index and a
+inline constexpr unsigned char
+ReferenceCell::reversed_combined_line_orientation()
+{
+ return 0u;
+}
+
+
+
inline unsigned int
ReferenceCell::child_cell_on_face(
const unsigned int face,
#include <deal.II/base/memory_consumption.h>
#include <deal.II/base/utilities.h>
+#include <deal.II/grid/reference_cell.h>
+
#include <vector>
DEAL_II_NAMESPACE_OPEN
{
n_stored_objects = n_objects;
// Assign to the default orientation
- flags.assign(n_objects, 1u);
+ flags.assign(n_objects,
+ ReferenceCell::default_combined_face_orientation());
}
inline void
TriaObjectsOrientations::resize(const unsigned int n_objects)
{
- flags.resize(n_objects, 1u);
+ flags.resize(n_objects,
+ ReferenceCell::default_combined_face_orientation());
n_stored_objects = n_objects;
}
k);
// it doesn't make sense to set any flags except
// orientation for a line
- Assert(raw_orientation == 0u || raw_orientation == 1u,
- ExcInternalError());
+ Assert(
+ raw_orientation ==
+ ReferenceCell::default_combined_face_orientation() ||
+ raw_orientation ==
+ ReferenceCell::reversed_combined_line_orientation(),
+ ExcInternalError());
faces.quads_line_orientations
[q * GeometryInfo<3>::lines_per_face + j] =
- raw_orientation == 1u;
+ raw_orientation ==
+ ReferenceCell::default_combined_face_orientation();
}
}
}
{
const auto &orientations = connectivity.entity_orientations(1);
for (unsigned int i = 0; i < orientations.n_objects(); ++i)
- if (orientations.get_raw_orientation(i) != 1u)
+ if (orientations.get_raw_orientation(i) !=
+ ReferenceCell::default_combined_face_orientation())
{
orientation_needed = true;
break;