Commit 60653203 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'feature/facecentered_localidxfix' into 'master'

[facecentered][convexcorner] fix the local Index logic

See merge request !3154
parents 2427dd0c b7c21f27
Pipeline #17779 canceled with stage
......@@ -208,7 +208,7 @@ public:
const auto& lateralOrthogonalScvf = this->lateralOrthogonalScvf(scvf);
assert(!lateralOrthogonalScvf.boundary());
const auto otherLocalIdx = GG::GeometryHelper::localIndexOutsideScvfWithSameIntegrationPoint(scvf);
const auto otherLocalIdx = GG::GeometryHelper::localIndexOutsideScvfWithSameIntegrationPoint(scvf, scv(scvf.insideScvIdx()));
auto outsideFVGeometry = localView(gridGeometry());
const auto outsideElementIdx = scv(lateralOrthogonalScvf.outsideScvIdx()).elementIndex();
......@@ -420,7 +420,7 @@ public:
const SubControlVolumeFace& lateralOrthogonalScvf = this->lateralOrthogonalScvf(scvf);
assert(!lateralOrthogonalScvf.boundary());
const auto otherLocalIdx = GG::GeometryHelper::localIndexOutsideScvfWithSameIntegrationPoint(scvf);
const auto otherLocalIdx = GG::GeometryHelper::localIndexOutsideScvfWithSameIntegrationPoint(scvf, scv(scvf.insideScvIdx()));
auto outsideFVGeometry = localView(gridGeometry());
const auto outsideElementIdx = scv(lateralOrthogonalScvf.outsideScvIdx()).elementIndex();
......
......@@ -176,11 +176,16 @@ public:
}
}
template<class SubControlVolumeFace>
static SmallLocalIndexType localIndexOutsideScvfWithSameIntegrationPoint(const SubControlVolumeFace& scvf)
template<class SubControlVolumeFace, class SubControlVolume>
static SmallLocalIndexType localIndexOutsideScvfWithSameIntegrationPoint(const SubControlVolumeFace& scvf,
const SubControlVolume& scv)
{
// In 2D there are 3 non-boundary faces per scv. In 3D, there are 5.
// This number of scvfs per scv is used as an offset to find the indexes in the outside half-scv.
const SmallLocalIndexType offset = (dim == 2) ? 3 : 5;
return isOdd_(scvf.localIndex()) ? scvf.localIndex() - offset : scvf.localIndex() + offset;
// For half-scvs with odd indexes, the outside half-scv has scvf local indexes with + offset.
// For half-scvs with even indexes, the outside half-scv has scvf local indexes have a - offset.
return isOdd_(scv.indexInElement()) ? scvf.localIndex() - offset : scvf.localIndex() + offset;
}
template<class FVElementGeometry, class SubControlVolumeFace>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment