]> https://gitweb.dealii.org/ - dealii.git/commitdiff
un-hardcode some 6s. 14651/head
authorDavid Wells <drwells@email.unc.edu>
Mon, 9 Jan 2023 22:57:36 +0000 (17:57 -0500)
committerDavid Wells <drwells@email.unc.edu>
Mon, 9 Jan 2023 22:57:36 +0000 (17:57 -0500)
This makes it clear that we want to use the maximum number of faces in 3D.

include/deal.II/grid/tria_accessor.templates.h
source/grid/tria.cc

index 3126e5abc04975e3606fa290d47d786ccbead52e..1f70704949080bcb921892c0c156e0fbcabcb2a2 100644 (file)
@@ -1074,8 +1074,8 @@ namespace internal
                 const unsigned char orientation =
                   cell.get_triangulation()
                     .levels[cell.level()]
-                    ->face_orientations.get_raw_orientation(cell.index() * 6 +
-                                                            f);
+                    ->face_orientations.get_raw_orientation(
+                      cell.index() * GeometryInfo<3>::faces_per_cell + f);
 
                 // It might seem superfluous to spell out the four indices
                 // that get later consumed by a for loop over these four
@@ -1098,8 +1098,8 @@ namespace internal
                 const unsigned char orientation =
                   cell.get_triangulation()
                     .levels[cell.level()]
-                    ->face_orientations.get_raw_orientation(cell.index() * 6 +
-                                                            f);
+                    ->face_orientations.get_raw_orientation(
+                      cell.index() * GeometryInfo<3>::faces_per_cell + f);
                 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)}};
@@ -1192,8 +1192,8 @@ namespace internal
                 const unsigned char orientation =
                   cell.get_triangulation()
                     .levels[cell.level()]
-                    ->face_orientations.get_raw_orientation(cell.index() * 6 +
-                                                            f);
+                    ->face_orientations.get_raw_orientation(
+                      cell.index() * GeometryInfo<3>::faces_per_cell + f);
 
                 // It might seem superfluous to spell out the four indices and
                 // orientations that get later consumed by a for loop over
@@ -1224,8 +1224,8 @@ namespace internal
                 const unsigned char orientation =
                   cell.get_triangulation()
                     .levels[cell.level()]
-                    ->face_orientations.get_raw_orientation(cell.index() * 6 +
-                                                            f);
+                    ->face_orientations.get_raw_orientation(
+                      cell.index() * GeometryInfo<3>::faces_per_cell + f);
                 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)}};
index f3bd6901b8ebc7b577d724f168429251b42ca983..7fa1766667398f06a7ecf712c1dc2f9fcf76f99b 100644 (file)
@@ -14601,7 +14601,7 @@ Triangulation<dim, spacedim>::reset_cell_vertex_indices_cache()
 
                 const unsigned char orientate =
                   levels[l]->face_orientations.get_raw_orientation(
-                    cell->index() * 6 + face);
+                    cell->index() * GeometryInfo<3>::faces_per_cell + face);
                 std::array<unsigned int, 4> vertex_order{
                   {ref_cell.standard_to_real_face_vertex(0, face, orientate),
                    ref_cell.standard_to_real_face_vertex(1, face, orientate),

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.