From: Peter Munch Date: Sat, 13 Jun 2020 18:31:37 +0000 (+0200) Subject: Check in GridRefinement::refine()/coarsen() if cell is locally owned X-Git-Tag: v9.3.0-rc1~1424^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10527%2Fhead;p=dealii.git Check in GridRefinement::refine()/coarsen() if cell is locally owned --- diff --git a/source/grid/grid_refinement.cc b/source/grid/grid_refinement.cc index e612178639..f24f82709d 100644 --- a/source/grid/grid_refinement.cc +++ b/source/grid/grid_refinement.cc @@ -71,7 +71,8 @@ GridRefinement::refine(Triangulation &tria, unsigned int marked = 0; for (const auto &cell : tria.active_cell_iterators()) - if (std::fabs(criteria(cell->active_cell_index())) >= new_threshold) + if (cell->is_locally_owned() && + std::fabs(criteria(cell->active_cell_index())) >= new_threshold) { if (max_to_mark != numbers::invalid_unsigned_int && marked >= max_to_mark) @@ -94,7 +95,8 @@ GridRefinement::coarsen(Triangulation &tria, Assert(criteria.is_non_negative(), ExcNegativeCriteria()); for (const auto &cell : tria.active_cell_iterators()) - if (std::fabs(criteria(cell->active_cell_index())) <= threshold) + if (cell->is_locally_owned() && + std::fabs(criteria(cell->active_cell_index())) <= threshold) if (!cell->refine_flag_set()) cell->set_coarsen_flag(); }