]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New Triangulation signal `post_p4est_refinement`. 11969/head
authorMarc Fehling <mafehling.git@gmail.com>
Wed, 24 Mar 2021 20:15:10 +0000 (14:15 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Sat, 27 Mar 2021 00:35:00 +0000 (18:35 -0600)
include/deal.II/grid/tria.h
source/distributed/tria.cc
source/dofs/dof_handler.cc

index 8b9c753406b727cb79897dc53489e20b15d1f613..0a6b7c0f2700c6929dfb48cc20848e182477dea9 100644 (file)
@@ -2219,6 +2219,15 @@ public:
      */
     boost::signals2::signal<void()> pre_distributed_refinement;
 
+    /**
+     * This signal is triggered during execution of the
+     * parallel::distributed::Triangulation::execute_coarsening_and_refinement()
+     * function. At the time this signal is triggered, the p4est oracle has been
+     * refined and the cell relations have been updated. The triangulation is
+     * unchanged otherwise, and the p4est oracle has not yet been repartitioned.
+     */
+    boost::signals2::signal<void()> post_p4est_refinement;
+
     /**
      * This signal is triggered at the end of execution of the
      * parallel::distributed::Triangulation::execute_coarsening_and_refinement()
index 583464bbfcbd34845ade0c92a909cc05e6c268da..6510f76761e359a2de1d5525d2495b5c4e27e6f3 100644 (file)
@@ -2689,6 +2689,10 @@ namespace parallel
       // has happened, we need to update the quadrant cell relations
       update_cell_relations();
 
+      // signals that parallel_forest has been refined and cell relations have
+      // been updated
+      this->signals.post_p4est_refinement();
+
       // before repartitioning the mesh, save a copy of the current positions of
       // quadrants
       // only if data needs to be transferred later
index 0fb78f4f63d5ff8cb42349a7400977e7067b29da..7529d0e29e33d2d98c1f7c65a44bf6e4be540331 100644 (file)
@@ -20,6 +20,7 @@
 #include <deal.II/base/mpi.templates.h>
 
 #include <deal.II/distributed/cell_data_transfer.templates.h>
+#include <deal.II/distributed/fully_distributed_tria.h>
 #include <deal.II/distributed/shared_tria.h>
 #include <deal.II/distributed/tria.h>
 
@@ -3049,8 +3050,14 @@ DoFHandler<dim, spacedim>::connect_to_triangulation_signals()
   // attach corresponding callback functions dealing with the transfer of
   // active FE indices depending on the type of triangulation
   if (dynamic_cast<
-        const dealii::parallel::DistributedTriangulationBase<dim, spacedim> *>(
-        &this->get_triangulation()))
+        const dealii::parallel::fullydistributed::Triangulation<dim, spacedim>
+          *>(&this->get_triangulation()))
+    {
+      // no transfer of active FE indices for this class
+    }
+  else if (dynamic_cast<
+             const dealii::parallel::distributed::Triangulation<dim, spacedim>
+               *>(&this->get_triangulation()))
     {
       // repartitioning signals
       this->tria_listeners_for_transfer.push_back(
@@ -3067,7 +3074,7 @@ DoFHandler<dim, spacedim>::connect_to_triangulation_signals()
 
       // refinement signals
       this->tria_listeners_for_transfer.push_back(
-        this->tria->signals.pre_distributed_refinement.connect(
+        this->tria->signals.post_p4est_refinement.connect(
           [this]() { this->pre_distributed_transfer_action(); }));
       this->tria_listeners_for_transfer.push_back(
         this->tria->signals.post_distributed_refinement.connect(

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.