]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure periodicity is set before constructing hierarchy
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 30 Mar 2020 17:13:08 +0000 (19:13 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 30 Mar 2020 17:13:08 +0000 (19:13 +0200)
source/distributed/tria.cc

index 6e6ee051f38bab8aa795f3b5ee300ad0ee9d3bf3..8aa5670873f3aa06a8fefb9ab80818502f2b395f 100644 (file)
@@ -4516,7 +4516,7 @@ namespace parallel
       // to connect to a vertex that is 'dim' hops away from the locally owned
       // cell. Depending on the order of the periodic face map, we might
       // connect to that point by chance or miss it. However, after looping
-      // through all the periodict directions (which are at most as many as
+      // through all the periodic directions (which are at most as many as
       // the number of space dimensions) we can be sure that all connections
       // to vertices have been created.
       for (unsigned int repetition = 0; repetition < dim; ++repetition)
@@ -4592,6 +4592,11 @@ namespace parallel
       Assert(this->n_levels() == 1,
              ExcMessage("The triangulation is refined!"));
 
+      // call the base class for storing the periodicity information; we must
+      // do this before going to p4est and rebuilding the triangulation to get
+      // the level subdomain ids correct in the multigrid case
+      dealii::Triangulation<dim, spacedim>::add_periodicity(periodicity_vector);
+
       for (const auto &face_pair : periodicity_vector)
         {
           const cell_iterator first_cell  = face_pair.cell[0];
@@ -4721,7 +4726,6 @@ namespace parallel
         /* user_data_constructor = */ nullptr,
         /* user_pointer */ this);
 
-
       try
         {
           copy_local_forest_to_triangulation();
@@ -4733,9 +4737,6 @@ namespace parallel
           Assert(false, ExcInternalError());
         }
 
-      // finally call the base class for storing the periodicity information
-      dealii::Triangulation<dim, spacedim>::add_periodicity(periodicity_vector);
-
       // The range of ghost_owners might have changed so update that information
       this->update_number_cache();
     }

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.