From: Wolfgang Bangerth Date: Sun, 9 Oct 2016 15:38:02 +0000 (-0600) Subject: Rename a function; also make it run faster. X-Git-Tag: v8.5.0-rc1~581^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=445475578c73cc860e03570ce6e6af38a3379b92;p=dealii.git 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. --- 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