From a3679f8f5bfe55f6587cbb219aff5b7a8a2e3873 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Mon, 2 Jul 2018 21:33:51 +0200
Subject: [PATCH] [disc] Throw not implemented for sub-grid boundary segment
 index in scvf

---
 dumux/common/boundaryflag.hh | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/dumux/common/boundaryflag.hh b/dumux/common/boundaryflag.hh
index abbda33247..c8a46e5615 100644
--- a/dumux/common/boundaryflag.hh
+++ b/dumux/common/boundaryflag.hh
@@ -31,6 +31,12 @@
 #include <dune/alugrid/grid.hh>
 #endif
 
+// dune-subgrid specific includes
+#if HAVE_DUNE_SUBGRID
+#include <dune/subgrid/subgrid.hh>
+#endif
+
+
 namespace Dumux {
 
 /*!
@@ -85,6 +91,27 @@ private:
 };
 #endif
 
+#if HAVE_DUNE_SUBGRID
+//! dune-subgrid doesn't have this implemented
+template<int dim, class HostGrid>
+class BoundaryFlag<Dune::SubGrid<dim, HostGrid>>
+{
+public:
+    BoundaryFlag() : flag_(-1) {}
+
+    template<class Intersection>
+    BoundaryFlag(const Intersection& i) : flag_(-1) {}
+
+    using value_type = int;
+
+    value_type get() const
+    { DUNE_THROW(Dune::NotImplemented, "Sub-grid doesn't implement boundary segment indices!"); }
+
+private:
+    int flag_;
+};
+#endif
+
 }  // end namespace Dumux
 
 #endif
-- 
GitLab