]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Get rid of create_triangulation_compatibility in the GMSH reader. 12048/head
authorDavid Wells <drwells@email.unc.edu>
Fri, 16 Apr 2021 14:59:54 +0000 (10:59 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 16 Apr 2021 14:59:54 +0000 (10:59 -0400)
source/grid/grid_in.cc

index fde2b74b14920284856de48f0fd935b9679bc63c..19251b9a7fa4563c011dc76973c42e9603b60ef2 100644 (file)
@@ -1929,7 +1929,19 @@ GridIn<dim, spacedim>::read_msh(std::istream &in)
                 cells.emplace_back();
                 cells.back().vertices.resize(vertices_per_cell);
                 for (unsigned int i = 0; i < vertices_per_cell; ++i)
-                  in >> cells.back().vertices[i];
+                  {
+                    // hypercube cells need to be reordered
+                    if (vertices_per_cell ==
+                        GeometryInfo<dim>::vertices_per_cell)
+                      {
+                        in >> cells.back()
+                                .vertices[GeometryInfo<dim>::ucd_to_deal[i]];
+                      }
+                    else
+                      {
+                        in >> cells.back().vertices[i];
+                      }
+                  }
 
                 // to make sure that the cast won't fail
                 Assert(material_id <=
@@ -1944,8 +1956,7 @@ GridIn<dim, spacedim>::read_msh(std::istream &in)
 
                 cells.back().material_id = material_id;
 
-                // transform from ucd to
-                // consecutive numbering
+                // transform from gmsh to consecutive numbering
                 for (unsigned int i = 0; i < vertices_per_cell; ++i)
                   {
                     AssertThrow(
@@ -2108,15 +2119,10 @@ GridIn<dim, spacedim>::read_msh(std::istream &in)
       // ... and cells
       if (dim == spacedim)
         GridReordering<dim, spacedim>::invert_all_cells_of_negative_grid(
-          vertices, cells);
-      GridReordering<dim, spacedim>::reorder_cells(cells);
-      tria->create_triangulation_compatibility(vertices, cells, subcelldata);
-    }
-  else
-    {
-      // simplex or mixed mesh
-      tria->create_triangulation_compatibility(vertices, cells, subcelldata);
+          vertices, cells, true);
+      GridReordering<dim, spacedim>::reorder_cells(cells, true);
     }
+  tria->create_triangulation(vertices, cells, subcelldata);
 
   // in 1d, we also have to attach boundary ids to vertices, which does not
   // currently work through the call above

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.