From c1264d5774b4fcf1de05105a6d00c7e23af35075 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 15 Jan 2024 16:07:32 -0500 Subject: [PATCH] exchange refinement flags: doc and changelog --- doc/news/changes/minor/20240115tjhei | 7 ++++++ include/deal.II/distributed/tria.h | 37 ++++++++++++++++++---------- 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 doc/news/changes/minor/20240115tjhei diff --git a/doc/news/changes/minor/20240115tjhei b/doc/news/changes/minor/20240115tjhei new file mode 100644 index 0000000000..de5d27a531 --- /dev/null +++ b/doc/news/changes/minor/20240115tjhei @@ -0,0 +1,7 @@ +Changed: +parallel::distributed::Triangulation::prepare_coarsening_and_refinement() +is now a collective call that exchanges coarsen/refinement flags on +ghost cells. This makes adaptive refinement independent of the number +of MPI ranks involved. +
+(Timo Heister, Quang Hoang, Vladimir Yushutin, 2024/01/15) diff --git a/include/deal.II/distributed/tria.h b/include/deal.II/distributed/tria.h index 96856f4a42..908f17835b 100644 --- a/include/deal.II/distributed/tria.h +++ b/include/deal.II/distributed/tria.h @@ -484,14 +484,17 @@ namespace parallel * Coarsen and refine the mesh according to refinement and coarsening * flags set. * - * Since the current processor only has control over those cells it owns - * (i.e. the ones for which cell-@>subdomain_id() == - * this-@>locally_owned_subdomain()), refinement and coarsening - * flags are only respected for those locally owned cells. Flags may be - * set on other cells as well (and may often, in fact, if you call - * dealii::Triangulation::prepare_coarsening_and_refinement()) but will - * be largely ignored: the decision to refine the global mesh will only - * be affected by flags set on locally owned cells. + * Since the current processor only has control over those cells + * it owns (i.e. the ones for which cell-@>subdomain_id() + * == this-@>locally_owned_subdomain()), refinement and + * coarsening flags are only respected for those locally owned + * cells. Flags set on other cells will be ignored: the decision + * to refine the global mesh will only be affected by flags set + * on locally owned cells. + * + * This is a + * @ref GlossCollectiveOperation "collective operation" + * and needs to be called by all participating MPI ranks. * * @note This function by default partitions the mesh in such a way that * the number of cells on all processors is roughly equal. If you want @@ -513,10 +516,16 @@ namespace parallel execute_coarsening_and_refinement() override; /** - * Override the implementation of prepare_coarsening_and_refinement from - * the base class. This is necessary if periodic boundaries are enabled - * and the level difference over vertices over the periodic boundary - * must not be more than 2:1. + * Prepare the triangulation for coarsening and refinement. + * + * This function performs necessary modifications of the + * coarsening and refinement flags to be consistent in parallel, + * to conform to smoothing flags set, and to conform to 2:1 + * hanging node constraints. + * + * This is a + * @ref GlossCollectiveOperation "collective operation" + * and needs to be called by all participating MPI ranks. */ virtual bool prepare_coarsening_and_refinement() override; @@ -579,7 +588,9 @@ namespace parallel memory_consumption_p4est() const; /** - * A @ref GlossCollectiveOperation "collective operation" that produces a sequence of output files with + * A + * @ref GlossCollectiveOperation "collective operation" + * that produces a sequence of output files with * the given file base name that contain the mesh in VTK format. * * More than anything else, this function is useful for debugging the -- 2.39.5