@@ -1798,13 +1798,25 @@ class Elem : public ReferenceCountedObject<Elem>,
17981798 */
17991799 virtual void flip (BoundaryInfo * boundary_info) = 0;
18001800
1801+ /* *
1802+ * \returns Whether the element is flipped compared to standard
1803+ * libMesh (e.g. clockwise for 2D elements) node orientations.
1804+ *
1805+ * Always returns \p false if a 2D element is not in the XY plane or
1806+ * a 1D element is not on the X axis; user code designed to work for
1807+ * embedded manifolds should handle any consistent orientation, and
1808+ * determining whether an orientation is consistent is not a local
1809+ * operation.
1810+ */
1811+ virtual bool is_flipped () const = 0;
1812+
18011813 /* *
18021814 * Flips the element (by swapping node and neighbor pointers) to
18031815 * have a mapping Jacobian of opposite sign, iff we find a negative
18041816 * orientation. This only fixes flipped elements; for tangled
18051817 * elements the only fixes possible are non-local.
18061818 */
1807- virtual void orient (BoundaryInfo * boundary_info) = 0 ;
1819+ void orient (BoundaryInfo * boundary_info);
18081820
18091821#ifdef LIBMESH_ENABLE_AMR
18101822
@@ -3079,6 +3091,14 @@ void Elem::hack_p_level_and_refinement_flag (unsigned int p,
30793091#endif // ifdef LIBMESH_ENABLE_AMR
30803092
30813093
3094+ inline
3095+ void Elem::orient (BoundaryInfo * boundary_info)
3096+ {
3097+ if (this ->is_flipped ())
3098+ this ->flip (boundary_info);
3099+ }
3100+
3101+
30823102inline
30833103dof_id_type Elem::compute_key (dof_id_type n0)
30843104{
0 commit comments