From: Peter Munch Date: Mon, 22 Nov 2021 10:28:34 +0000 (+0100) Subject: Fix GridGenerator::merge_triangulations() for simplex meshes X-Git-Tag: v9.4.0-rc1~812^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12979%2Fhead;p=dealii.git Fix GridGenerator::merge_triangulations() for simplex meshes --- diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 36f03a9226..7d961f01ba 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -6463,7 +6463,11 @@ namespace GridGenerator // reorder the cells to ensure that they satisfy the convention for // edge and face directions - GridTools::consistently_order_cells(cells); + if (std::all_of(cells.begin(), cells.end(), [](const auto &cell) { + return cell.vertices.size() == + ReferenceCells::get_hypercube().n_vertices(); + })) + GridTools::consistently_order_cells(cells); result.clear(); result.create_triangulation(vertices, cells, subcell_data); }