From 7df92c7ab76f4fea69304b3df403d6afefe2b82c Mon Sep 17 00:00:00 2001 From: David Wells Date: Fri, 16 Apr 2021 13:03:17 -0400 Subject: [PATCH] Make the vertex swapping algorithm work with the new-style ordering. This is necessary for the tecplot reader, which relies on this behavior. --- source/grid/grid_reordering.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/grid/grid_reordering.cc b/source/grid/grid_reordering.cc index 90f93551c6..922af99583 100644 --- a/source/grid/grid_reordering.cc +++ b/source/grid/grid_reordering.cc @@ -1179,7 +1179,10 @@ GridReordering<2>::invert_all_cells_of_negative_grid( if (GridTools::cell_measure<2>(all_vertices, vertices_lex) < 0) { ++n_negative_cells; - std::swap(cell.vertices[1], cell.vertices[3]); + if (use_new_style_ordering) + std::swap(cell.vertices[1], cell.vertices[2]); + else + std::swap(cell.vertices[1], cell.vertices[3]); // Check whether the resulting cell is now ok. // If not, then the grid is seriously broken and -- 2.39.5