]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the vertex swapping algorithm work with the new-style ordering.
authorDavid Wells <drwells@email.unc.edu>
Fri, 16 Apr 2021 17:03:17 +0000 (13:03 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 16 Apr 2021 17:03:59 +0000 (13:03 -0400)
This is necessary for the tecplot reader, which relies on this behavior.

source/grid/grid_reordering.cc

index 90f93551c67b3dc2ec5ec83b8c98cc8f86adf3c8..922af99583743a0052d10b48bb42a029948424ec 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.