From 7514b97b70ae55cbc17d6a3e90c829bb14990652 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Mon, 19 Dec 2022 12:15:49 +0100
Subject: [PATCH] [box] Expose cached element index

---
 dumux/discretization/box/fvelementgeometry.hh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dumux/discretization/box/fvelementgeometry.hh b/dumux/discretization/box/fvelementgeometry.hh
index 514d63759a..2b8c535900 100644
--- a/dumux/discretization/box/fvelementgeometry.hh
+++ b/dumux/discretization/box/fvelementgeometry.hh
@@ -189,6 +189,10 @@ public:
     const Element& element() const
     { return *element_; }
 
+    //! The bound element's index in the grid view
+    GridIndexType elementIndex() const
+    { return eIdx_; }
+
     //! The grid geometry we are a restriction of
     const GridGeometry& gridGeometry() const
     { return ggCache_->gridGeometry(); }
@@ -363,6 +367,10 @@ public:
     const Element& element() const
     { return *element_; }
 
+    //! The bound element's index in the grid view
+    GridIndexType elementIndex() const
+    { return eIdx_; }
+
     //! The grid geometry we are a restriction of
     const GridGeometry& gridGeometry() const
     { return ggCache_->gridGeometry(); }
-- 
GitLab