From d326aa0ce800bb7b99371248482daffce0b646e5 Mon Sep 17 00:00:00 2001
From: alkaemper <alkaemper@mathematik.uni-stuttgart.de>
Date: Wed, 22 Aug 2018 10:55:04 +0200
Subject: [PATCH] avoid checking the artificial faces for periodic boundaries

---
 dune/alugrid/3d/gridfactory.cc | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/dune/alugrid/3d/gridfactory.cc b/dune/alugrid/3d/gridfactory.cc
index baa03e136..c8cb30992 100644
--- a/dune/alugrid/3d/gridfactory.cc
+++ b/dune/alugrid/3d/gridfactory.cc
@@ -975,6 +975,17 @@ namespace Dune
       const FaceMapIterator fend = faceMap.end();
       for( FaceMapIterator fit = faceMap.begin(); fit != fend; ++fit )
       {
+        //for dimension == 2 we do not want to search
+        // the artificially introduced faces
+        if(dimension == 2)
+        {
+          if(elementType == hexa)
+            if(fit->second.second > 3)
+              continue;
+          if(elementType == tetra)
+            if(fit->second.second > 2)
+              continue;
+        }
         FaceType key2;
         generateFace( fit->second, key2 );
 
@@ -1064,6 +1075,17 @@ namespace Dune
     {
       for(auto it = faceMap.begin(); it!=faceMap.end(); ++it)
       {
+        //for dimension == 2 we do not want to search
+        // the artificially introduced faces
+        if(dimension == 2)
+        {
+          if(elementType == hexa)
+            if(it->second.second > 3)
+              continue;
+          if(elementType == tetra)
+            if(it->second.second > 2)
+              continue;
+        }
         searchPeriodicNeighbor( faceMap, it, defaultId );
       }
     }
-- 
GitLab