From 7a17b27ce74859ae075a92ce4fed542e6445b5ba Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Mon, 22 Nov 2021 11:28:34 +0100 Subject: [PATCH] Fix GridGenerator::merge_triangulations() for simplex meshes --- source/grid/grid_generator.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- 2.39.5