From 63202e7e5415f2170cb62561d64a246da6468375 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Tue, 26 Oct 2021 16:03:43 +0200
Subject: [PATCH] [staggered][geometryhelper] Add hardcoded  local index
 mapping

---
 .../facecentered/staggered/geometryhelper.hh  | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/dumux/discretization/facecentered/staggered/geometryhelper.hh b/dumux/discretization/facecentered/staggered/geometryhelper.hh
index fbbeee8368..142b34f9b9 100644
--- a/dumux/discretization/facecentered/staggered/geometryhelper.hh
+++ b/dumux/discretization/facecentered/staggered/geometryhelper.hh
@@ -62,6 +62,73 @@ public:
         return (ownLocalFaceIndex % 2) ? (ownLocalFaceIndex - 1) : (ownLocalFaceIndex + 1);
     }
 
+       //! Return the local index of a lateral orthogonal scvf
+    static constexpr int lateralOrthogonalScvfLocalIndex(const SmallLocalIndexType ownLocalScvfIndex)
+    {
+        if constexpr(GridView::Grid::dimension == 1)
+        {
+            assert(false && "There are no lateral scvfs in 1D");
+            return -1;
+        }
+
+        if constexpr (GridView::Grid::dimension == 2)
+        {
+            switch (ownLocalScvfIndex)
+            {
+                case 1: return 7;
+                case 7: return 1;
+                case 2: return 10;
+                case 10: return 2;
+                case 4: return 8;
+                case 8: return 4;
+                case 5: return 11;
+                case 11: return 5;
+                default:
+                {
+                    assert(false && "No lateral orthogonal scvf found");
+                    return -1;
+                }
+            }
+        }
+        else
+        {
+            switch (ownLocalScvfIndex)
+            {
+                case 1: return 11;
+                case 11: return 1;
+                case 2: return 16;
+                case 16: return 2;
+                case 3: return 21;
+                case 21: return 3;
+                case 4: return 26;
+                case 26: return 4;
+                case 6: return 12;
+                case 12: return 6;
+                case 7: return 17;
+                case 17: return 7;
+                case 8: return 22;
+                case 22: return 8;
+                case 9: return 27;
+                case 27: return 9;
+                case 13: return 23;
+                case 23: return 13;
+                case 14: return 28;
+                case 28: return 14;
+                case 18: return 24;
+                case 24: return 18;
+                case 19: return 29;
+                case 29: return 19;
+
+                default:
+                {
+                    assert(false && "No lateral orthogonal scvf found");
+                    return -1;
+                }
+            }
+        }
+    }
+
+
      //! Returns the local indices of the faces lateral to the own one.
     static constexpr auto localLaterFaceIndices(const SmallLocalIndexType ownLocalFaceIndex)
     {
-- 
GitLab