From: David Wells Date: Fri, 16 Apr 2021 14:59:54 +0000 (-0400) Subject: Get rid of create_triangulation_compatibility in the GMSH reader. X-Git-Tag: v9.3.0-rc1~217^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12048%2Fhead;p=dealii.git Get rid of create_triangulation_compatibility in the GMSH reader. --- diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index fde2b74b14..19251b9a7f 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -1929,7 +1929,19 @@ GridIn::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::vertices_per_cell) + { + in >> cells.back() + .vertices[GeometryInfo::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::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::read_msh(std::istream &in) // ... and cells if (dim == spacedim) GridReordering::invert_all_cells_of_negative_grid( - vertices, cells); - GridReordering::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::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