]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use pre-compiled structdim for access to TriaObjects in Accessor 13931/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Wed, 8 Jun 2022 11:52:01 +0000 (13:52 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Wed, 8 Jun 2022 11:52:01 +0000 (13:52 +0200)
include/deal.II/grid/tria_accessor.templates.h

index 56c4409f82b079afa1b5d220ba7f745b0087cb5c..2186037c8216782960f2e2f9cf048554d1d9794f 100644 (file)
@@ -612,8 +612,9 @@ namespace internal
       line_index(const TriaAccessor<2, dim, spacedim> &accessor,
                  const unsigned int                    i)
       {
-        return accessor.objects().get_bounding_object_indices(
-          accessor.present_index)[i];
+        constexpr unsigned int max_faces_per_cell = 4;
+        return accessor.objects()
+          .cells[accessor.present_index * max_faces_per_cell + i];
       }
 
 
@@ -651,8 +652,9 @@ namespace internal
       inline static unsigned int
       quad_index(const TriaAccessor<3, 3, 3> &accessor, const unsigned int i)
       {
+        constexpr unsigned int max_faces_per_cell = 6;
         return accessor.tria->levels[accessor.present_level]
-          ->cells.get_bounding_object_indices(accessor.present_index)[i];
+          ->cells.cells[accessor.present_index * max_faces_per_cell + i];
       }
 
 
@@ -1010,8 +1012,9 @@ namespace internal
       vertex_index(const TriaAccessor<1, dim, spacedim> &accessor,
                    const unsigned int                    corner)
       {
-        return accessor.objects().get_bounding_object_indices(
-          accessor.present_index)[corner];
+        constexpr unsigned int max_faces_per_cell = 2;
+        return accessor.objects()
+          .cells[accessor.present_index * max_faces_per_cell + corner];
       }
 
 

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.