From: Martin Kronbichler Date: Tue, 30 Mar 2021 17:03:25 +0000 (+0200) Subject: Avoid quadratic complexity in coarse grid cells. X-Git-Tag: v9.3.0-rc1~266^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86749929b47a3417db9aeb3faa5af88d9ef8342b;p=dealii.git Avoid quadratic complexity in coarse grid cells. --- diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index 583464bbfc..69a280d741 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -2322,18 +2322,12 @@ namespace parallel // set all cells to artificial. we will later set it to the correct // subdomain in match_tree_recursively - for (typename Triangulation::cell_iterator cell = - this->begin(0); - cell != this->end(0); - ++cell) + for (const auto &cell : this->cell_iterators_on_level(0)) cell->recursively_set_subdomain_id(numbers::artificial_subdomain_id); do { - for (typename Triangulation::cell_iterator cell = - this->begin(0); - cell != this->end(0); - ++cell) + for (const auto &cell : this->cell_iterators_on_level(0)) { // if this processor stores no part of the forest that comes out // of this coarse grid cell, then we need to delete all children @@ -3355,10 +3349,7 @@ namespace parallel this->local_cell_relations.shrink_to_fit(); // recurse over p4est - for (typename Triangulation::cell_iterator cell = - this->begin(0); - cell != this->end(0); - ++cell) + for (const auto &cell : this->cell_iterators_on_level(0)) { // skip coarse cells that are not ours if (tree_exists_locally(