]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Construct neighbors on all possible levels
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 22 Mar 2016 14:41:38 +0000 (15:41 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 29 Mar 2016 11:24:09 +0000 (13:24 +0200)
include/deal.II/grid/tria.h
source/grid/tria.cc

index bd6ece4cf14e38ae1dc7c5a9cd10ab5edbd19c46..83665a8c2cafc10fa76808b97aa7d41ffd41e5d3 100644 (file)
@@ -3107,7 +3107,6 @@ protected:
 
   /**
    * Recreate information about periodic neighbors from periodic_face_pairs_level_0.
-   * Only faces that belong to locally owned or ghosted cells are stored.
    */
   void update_periodic_face_map ();
 
index 69852420dc142b17544734463dcb9fc8ab481fa2..c7760c1c8f5fb1e4002abd4852087ebf354e6246 100644 (file)
@@ -934,6 +934,16 @@ namespace
     Assert(face_1->at_boundary()  &&face_2->at_boundary(),
            ExcMessage ("Periodic faces must be on the boundary"));
 
+    // insert periodic face pair for both cells
+    typedef std::pair<typename Triangulation<dim,spacedim>::cell_iterator, unsigned int> CellFace;
+    const CellFace cell_face_1 (cell_1, n_face_1);
+    const CellFace cell_face_2 (cell_2, n_face_2);
+    const std::pair<CellFace, CellFace> periodic_faces (cell_face_1, cell_face_2);
+
+    // Only one periodic neighbor is allowed
+    Assert(periodic_face_map.count(cell_face_1) == 0, ExcInternalError());
+    periodic_face_map.insert(periodic_faces);
+
     // A lookup table on how to go through the child cells depending on the
     // orientation:
     // see Documentation of GeometryInfo for details
@@ -1025,41 +1035,9 @@ namespace
           }
 
       }
-    else
-      {
-        // Otherwise at least one of the two faces is active and
-        // we need to do some work and enter the periodic face pairs!
-
-        //periodic boundary can only be on the boundary of the domain
-        Assert(cell_1->at_boundary(n_face_1), ExcInternalError());
-        Assert(cell_2->at_boundary(n_face_2), ExcInternalError());
-
-        //Ignore artificial cells, cell_2 may not be active
-        if (!cell_1->is_artificial())
-          {
-            // if cell_2 is active it must not be artificial
-            if (!cell_2->has_children() && cell_2->is_artificial())
-              {
-                std::cout<<"The artificial neighbor of the cell with center " <<cell_1->center()
-                         <<" is the cell with center "<<cell_2->center()<<std::endl;
-                //Assert(!cell_2->is_artificial(), ExcInternalError());
-              }
-            if (cell_2->has_children() || !cell_2->is_artificial())
-              {
-                // insert periodic face pair for both cells
-                typedef std::pair<typename Triangulation<dim,spacedim>::cell_iterator, unsigned int> CellFace;
-                const CellFace cell_face_1 (cell_1, n_face_1);
-                const CellFace cell_face_2 (cell_2, n_face_2);
-                const std::pair<CellFace, CellFace> periodic_faces (cell_face_1, cell_face_2);
-
-                // Only one periodic neighbor is allowed
-                Assert(periodic_face_map.count(cell_face_1) == 0, ExcInternalError());
-                periodic_face_map.insert(periodic_faces);
-              }
-          }
-      }
   }
 
+
 }// end of anonymous namespace
 
 
@@ -11813,8 +11791,7 @@ Triangulation<dim, spacedim>::execute_coarsening_and_refinement ()
                cells_with_distorted_children);
 
   // For parallel::distributed::Triangulations we update
-  // periodic_face_map later. At this point cells might be
-  // artificial which prevents us from storing the correct faces
+  // periodic_face_map later.
   const parallel::Triangulation< dim, spacedim > *distributed_triangulation
     = dynamic_cast<const parallel::Triangulation< dim, spacedim > *> (this);
   if (!distributed_triangulation)

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.