]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check in GridRefinement::refine()/coarsen() if cell is locally owned 10527/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 13 Jun 2020 18:31:37 +0000 (20:31 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 13 Jun 2020 18:31:37 +0000 (20:31 +0200)
source/grid/grid_refinement.cc

index e6121786395ee5d179fe3c24491eec26455e4901..f24f82709de27185a976d52e071d3da46c9db0f9 100644 (file)
@@ -71,7 +71,8 @@ GridRefinement::refine(Triangulation<dim, spacedim> &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<dim, spacedim> &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();
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.