From: Marc Fehling <mafehling.git@gmail.com>
Date: Fri, 23 Jul 2021 23:21:46 +0000 (-0600)
Subject: Load: align dealii and p4est meshes before repartitioning.
X-Git-Tag: v9.4.0-rc1~1072^2~1
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bbce8d7168cf8d72096ad630e3b9e4d1d0b7038;p=dealii.git

Load: align dealii and p4est meshes before repartitioning.
---

diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc
index 333e12acc5..e7f0271692 100644
--- a/source/distributed/tria.cc
+++ b/source/distributed/tria.cc
@@ -1558,6 +1558,19 @@ namespace parallel
             }
           else
             {
+              // first, align both dealii and p4est meshes, which is a
+              // requirement of our internal cell weights algorithm
+              try
+                {
+                  copy_local_forest_to_triangulation();
+                }
+              catch (const typename Triangulation<dim>::DistortedCellList &)
+                {
+                  // the underlying triangulation should not be checking for
+                  // distorted cells
+                  Assert(false, ExcInternalError());
+                }
+
               // get cell weights for a weighted repartitioning.
               const std::vector<unsigned int> cell_weights = get_cell_weights();
 
@@ -1585,10 +1598,8 @@ namespace parallel
         }
       catch (const typename Triangulation<dim>::DistortedCellList &)
         {
-          // the underlying
-          // triangulation should not
-          // be checking for
-          // distorted cells
+          // the underlying triangulation should not be checking for distorted
+          // cells
           Assert(false, ExcInternalError());
         }