From 1e6713be1805f7abd2bb4ccc977f68795c5ed02a Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Thu, 20 Jul 2017 09:53:52 +0200
Subject: [PATCH] [common] Introduce trivial intersection mapper

---
 dumux/common/intersectionmapper.hh | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/dumux/common/intersectionmapper.hh b/dumux/common/intersectionmapper.hh
index dcee8ab505..321e6f0ab3 100644
--- a/dumux/common/intersectionmapper.hh
+++ b/dumux/common/intersectionmapper.hh
@@ -33,6 +33,36 @@
 namespace Dumux
 {
 
+template<class TypeTag>
+class ConformingGridIntersectionMapper
+{
+    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
+    using Element = typename GridView::template Codim<0>::Entity;
+    using IndexType = unsigned int;
+
+    static constexpr int codimIntersection =  1;
+public:
+
+    ConformingGridIntersectionMapper(const GridView& gridView) : gridView_(gridView) { }
+
+    void update()
+    {}
+
+    //! The total number of intersections
+    std::size_t numIntersections() const
+    {
+        return gridView_.size(1);
+    }
+
+    IndexType globalIntersectionIndex(const Element& element, const IndexType localFaceIdx) const
+    {
+        return gridView_.indexSet().subIndex(element, localFaceIdx, codimIntersection);
+    }
+
+private:
+    const GridView gridView_;
+};
+
 /*!
  * \brief defines an intersection mapper for mapping of global DOFs assigned
  *        to faces which also works for adaptive grids.
-- 
GitLab