Skip to content
Snippets Groups Projects
Commit 63202e7e authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[staggered][geometryhelper] Add hardcoded local index mapping

parent f321584a
No related branches found
No related tags found
1 merge request!2901Feature/improve staggered gridgeometry
......@@ -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)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment