From 445475578c73cc860e03570ce6e6af38a3379b92 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 9 Oct 2016 09:38:02 -0600 Subject: [PATCH] Rename a function; also make it run faster. The new name is dimension independent. The speed is gained because we do not need to search a list from the top every time, but it is enough to start searching where we left off previously. --- source/grid/grid_reordering.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/grid/grid_reordering.cc b/source/grid/grid_reordering.cc index 1b6c80397c..d7db823bc5 100644 --- a/source/grid/grid_reordering.cc +++ b/source/grid/grid_reordering.cc @@ -463,10 +463,11 @@ namespace internal */ template unsigned int - get_next_unoriented_quad(const std::vector > &cells, - const std::vector > &edges) + get_next_unoriented_cell(const std::vector > &cells, + const std::vector > &edges, + const unsigned int current_cell) { - for (unsigned int c=0; c::lines_per_cell; ++l) if (edges[cells[c].edge_indices[l]].orientation_status == Edge::not_oriented) return c; @@ -704,8 +705,10 @@ namespace internal // then loop over all cells and start orienting parallel edge sets // of cells that still have non-oriented edges - unsigned int next_cell_with_unoriented_edge; - while ((next_cell_with_unoriented_edge = get_next_unoriented_quad(cell_list, edge_list)) != + unsigned int next_cell_with_unoriented_edge = 0; + while ((next_cell_with_unoriented_edge = get_next_unoriented_cell(cell_list, + edge_list, + next_cell_with_unoriented_edge)) != numbers::invalid_unsigned_int) { // see which edge sets are still not oriented -- 2.39.5