]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get rid of some 1d orientation special cases. 18345/head
authorDavid Wells <drwells@email.unc.edu>
Wed, 9 Apr 2025 00:51:26 +0000 (20:51 -0400)
committerDavid Wells <drwells@email.unc.edu>
Wed, 9 Apr 2025 00:51:26 +0000 (20:51 -0400)
Now that the default orientation is zero and the total number of
orientations (in 1d) is 1, we can treat this in the same way as
everything else.

include/deal.II/grid/reference_cell.h
include/deal.II/grid/tria_accessor.h
source/base/qprojector.cc

index 34fb6b7541bf8401f24fe656ec77c0aeb2c95961..3dd718f91ecf570f1ec445ac780940a7430f3768 100644 (file)
@@ -2530,13 +2530,7 @@ ReferenceCell::face_to_cell_vertices(
 {
   AssertIndexRange(face, n_faces());
   AssertIndexRange(vertex, face_reference_cell(face).n_vertices());
-  // TODO: once the default orientation is switched to 0 then we can remove this
-  // special case for 1D.
-  if (get_dimension() == 1)
-    Assert(combined_face_orientation == numbers::default_geometric_orientation,
-           ExcMessage("In 1D, all faces must have the default orientation."));
-  else
-    AssertIndexRange(combined_face_orientation, n_face_orientations(face));
+  AssertIndexRange(combined_face_orientation, n_face_orientations(face));
 
   switch (this->kind)
     {
index 4667b9ea18f89b1eecb4098d689c3d2ed759c23b..c07b5d7f378ace8c0e82210201a81126aabd0349 100644 (file)
@@ -4896,33 +4896,23 @@ namespace internal
       inline static void
       set_combined_face_orientation(
         const TriaAccessor<structdim, dim, spacedim> &accessor,
-        const unsigned int                            face,
+        const unsigned int                            face_no,
         const types::geometric_orientation            combined_orientation)
       {
         Assert(structdim == dim,
                ExcMessage("This function can only be used on objects that are "
                           "cells and not on objects which bound cells."));
-        AssertIndexRange(face, accessor.n_faces());
-
-        if (dim == 1)
-          Assert(combined_orientation == numbers::default_geometric_orientation,
-                 ExcMessage("In 1d, faces do not have an orientation, so the "
-                            "only valid value is the default."));
-        else if (dim == 2)
-          Assert(combined_orientation ==
-                     numbers::default_geometric_orientation ||
-                   combined_orientation == numbers::reverse_line_orientation,
-                 ExcMessage(
-                   "In 2d, the only valid values of the combined orientation "
-                   "are the standard orientation or the reversed line "
-                   "orientation."));
+        AssertIndexRange(face_no, accessor.n_faces());
+        AssertIndexRange(combined_orientation,
+                         accessor.reference_cell().n_face_orientations(
+                           face_no));
 
         // face_orientations is not set up in 1d
         if (dim != 1)
           accessor.tria->levels[accessor.present_level]
             ->face_orientations.set_combined_orientation(
               accessor.present_index * ReferenceCells::max_n_faces<dim>() +
-                face,
+                face_no,
               combined_orientation);
       }
 
index 9dc4fcce6327f2931fadc4c61914744ea08434cf..79cea08ca507628be62e0968e7ffe567c56314d0 100644 (file)
@@ -1244,11 +1244,8 @@ QProjector<dim>::DataSetDescriptor::face(
   const types::geometric_orientation combined_orientation,
   const unsigned int                 n_quadrature_points)
 {
-  // TODO: once we move to representing the default orientation as 0 (instead of
-  // 1) we can get rid of the dim = 1 check
-  Assert(dim == 1 ||
-           (combined_orientation < reference_cell.n_face_orientations(face_no)),
-         ExcInternalError());
+  AssertIndexRange(combined_orientation,
+                   reference_cell.n_face_orientations(face_no));
 
   // TODO: once the default orientation is 0 we can combine this with the
   // general branch

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.