]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Un-hardcode some constants.
authorDavid Wells <drwells@email.unc.edu>
Wed, 9 Jun 2021 20:02:46 +0000 (16:02 -0400)
committerDavid Wells <drwells@email.unc.edu>
Thu, 10 Jun 2021 00:42:53 +0000 (20:42 -0400)
source/grid/tria.cc

index d6e41c71f96db942844bc4ecad84f8d64187d965..640051c5c78f44cfc9eac67d886f6d5364dc47c0 100644 (file)
@@ -5342,7 +5342,7 @@ namespace internal
               // 2) create new lines (property is set later)
               boost::container::small_vector<
                 typename Triangulation<dim, spacedim>::raw_line_iterator,
-                4>
+                GeometryInfo<dim>::lines_per_cell>
                 new_lines(quad->n_lines());
               {
                 for (unsigned int i = 0; i < new_lines.size(); ++i)
@@ -5423,8 +5423,9 @@ namespace internal
               boost::container::small_vector<
                 typename Triangulation<dim, spacedim>::raw_line_iterator,
                 12>
-                lines(quad->n_lines() * 3);
-
+                lines(reference_face_type == ReferenceCells::Quadrilateral ?
+                        12 :
+                        9);
               {
                 unsigned int k = 0;
 
@@ -6206,7 +6207,9 @@ namespace internal
                         cell_face_vertices_hex :
                         cell_face_vertices_tet;
 
-                    for (unsigned int c = 0; c < 8; ++c)
+                    for (unsigned int c = 0;
+                         c < GeometryInfo<dim>::max_children_per_cell;
+                         ++c)
                       {
                         auto &new_hex = new_hexes[c];
 

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.