From e268c88abdad5a3a090a2d8f82c6202c1a7a769a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= <dennis.glaeser@iws.uni-stuttgart.de>
Date: Tue, 16 Oct 2018 12:23:44 +0200
Subject: [PATCH] [boxdfm] fix compiler error from periodic bcs

---
 .../porousmediumflow/boxdfm/fvgridgeometry.hh | 32 +++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh
index 831c1af1ab..7bd9c21bb2 100644
--- a/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh
+++ b/dumux/porousmediumflow/boxdfm/fvgridgeometry.hh
@@ -238,7 +238,7 @@ public:
                                                                                referenceElement.subEntity(idxInInside, 1, vIdxLocal, dim),
                                                                                dim);
                 // maybe add boundary scvf
-                if (intersection.boundary())
+                if (intersection.boundary() && !intersection.neighbor())
                 {
                     numScvf_ += isGeometry.corners();
                     numBoundaryScvf_ += isGeometry.corners();
@@ -266,6 +266,9 @@ public:
                         boundaryDofIndices_[vIdxGlobal] = true;
                     }
                 }
+                // make sure we have no periodic boundaries
+                else if (intersection.boundary() && intersection.neighbor())
+                    DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme");
 
                 // maybe add fracture scvs & scvfs
                 if (fractureGridAdapter.composeFacetElement(isVertexIndices))
@@ -351,6 +354,16 @@ public:
     bool dofOnBoundary(unsigned int dofIdx) const { return boundaryDofIndices_[dofIdx]; }
     //! If a vertex / d.o.f. is on a fracture
     bool dofOnFracture(unsigned int dofIdx) const { return fractureDofIndices_[dofIdx]; }
+    //! Periodic boundaries are not supported for the box-dfm scheme
+    bool dofOnPeriodicBoundary(std::size_t dofIdx) const { return false; }
+
+    //! The index of the vertex / d.o.f. on the other side of the periodic boundary
+    std::size_t periodicallyMappedDof(std::size_t dofIdx) const
+    { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme"); }
+
+    //! Returns the map between dofs across periodic boundaries
+    std::unordered_map<std::size_t, std::size_t> periodicVertexMap() const
+    { return std::unordered_map<std::size_t, std::size_t>(); }
 
 private:
     const FeCache feCache_;
@@ -475,7 +488,7 @@ public:
                                                                                referenceElement.subEntity(idxInInside, 1, vIdxLocal, dim),
                                                                                dim);
 
-                if (intersection.boundary())
+                if (intersection.boundary() && !intersection.neighbor())
                 {
                     numScvf_ += numCorners;
                     numBoundaryScvf_ += numCorners;
@@ -492,6 +505,10 @@ public:
                     }
                 }
 
+                // make sure we have no periodic boundaries
+                else if (intersection.boundary() && intersection.neighbor())
+                    DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme");
+
                 // maybe add fracture scvs & scvfs
                 if (fractureGridAdapter.composeFacetElement(isVertexIndices))
                 {
@@ -513,10 +530,21 @@ public:
     bool dofOnBoundary(unsigned int dofIdx) const { return boundaryDofIndices_[dofIdx]; }
     //! If a vertex / d.o.f. is on a fracture
     bool dofOnFracture(unsigned int dofIdx) const { return fractureDofIndices_[dofIdx]; }
+    //! Periodic boundaries are not supported for the box-dfm scheme
+    bool dofOnPeriodicBoundary(std::size_t dofIdx) const { return false; }
+
     //! Returns true if an intersection coincides with a fracture element
     bool isOnFracture(const Element& element, const Intersection& intersection) const
     { return facetOnFracture_[facetMapper_.subIndex(element, intersection.indexInInside(), 1)]; }
 
+    //! The index of the vertex / d.o.f. on the other side of the periodic boundary
+    std::size_t periodicallyMappedDof(std::size_t dofIdx) const
+    { DUNE_THROW(Dune::InvalidStateException, "Periodic boundaries are not supported by the box-dfm scheme"); }
+
+    //! Returns the map between dofs across periodic boundaries
+    std::unordered_map<std::size_t, std::size_t> periodicVertexMap() const
+    { return std::unordered_map<std::size_t, std::size_t>(); }
+
 private:
 
     const FeCache feCache_;
-- 
GitLab