From bce3a5de3abb92d38086eac6b3808f582c4d7505 Mon Sep 17 00:00:00 2001 From: David Wells Date: Fri, 16 Apr 2021 10:59:54 -0400 Subject: [PATCH] Get rid of create_triangulation_compatibility in the GMSH reader. --- source/grid/grid_in.cc | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) 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 -- 2.39.5