From 739debc31e70d202b4a6ffe3ac4f335fe03c2d44 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 13 Jun 2020 20:31:37 +0200 Subject: [PATCH] Check in GridRefinement::refine()/coarsen() if cell is locally owned --- source/grid/grid_refinement.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); } -- 2.39.5