Merge pull request #2781 from blattms/fix_pinchmode_all_parallel_3

fix insideCartElmIdx and outsideCartElmIdx order for faces in parallel (2)
This commit is contained in:
Bård Skaflestad 2020-09-09 23:30:24 +02:00 committed by GitHub
commit 8033e8fc67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,14 +273,14 @@ public:
A * (n*d)/(d*d); A * (n*d)/(d*d);
} }
// we only need to calculate a face's transmissibility
// once...
if (elemIdx > outsideElemIdx)
continue;
unsigned insideCartElemIdx = cartMapper.cartesianIndex(elemIdx); unsigned insideCartElemIdx = cartMapper.cartesianIndex(elemIdx);
unsigned outsideCartElemIdx = cartMapper.cartesianIndex(outsideElemIdx); unsigned outsideCartElemIdx = cartMapper.cartesianIndex(outsideElemIdx);
// we only need to calculate a face's transmissibility
// once...
if (insideCartElemIdx > outsideCartElemIdx)
continue;
// local indices of the faces of the inside and // local indices of the faces of the inside and
// outside elements which contain the intersection // outside elements which contain the intersection
int insideFaceIdx = intersection.indexInInside(); int insideFaceIdx = intersection.indexInInside();
@ -475,14 +475,13 @@ private:
if (insideFaceIdx > 3) { // top or or bottom if (insideFaceIdx > 3) { // top or or bottom
Scalar mult = 1e20; Scalar mult = 1e20;
unsigned cartElemIdx = insideCartElemIdx; unsigned cartElemIdx = insideCartElemIdx;
// pick the smallest multiplier while looking down the pillar untill reaching the other end of the connection assert(insideFaceIdx==5); // as insideCartElemIdx < outsideCartElemIdx holds for the Z column
// for the inbetween cells we apply it from both sides // pick the smallest multiplier for Z+ while looking down the pillar untill reaching the other end of the connection
// While Z- is not all used here. There is a call after this function that does
// applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult)
// and hence treats the other direction
while (cartElemIdx != outsideCartElemIdx) { while (cartElemIdx != outsideCartElemIdx) {
if (insideFaceIdx == 4 || cartElemIdx !=insideCartElemIdx ) mult = std::min(mult, transMult.getMultiplier(cartElemIdx, Opm::FaceDir::ZPlus));
mult = std::min(mult, transMult.getMultiplier(cartElemIdx, Opm::FaceDir::ZMinus));
if (insideFaceIdx == 5 || cartElemIdx !=insideCartElemIdx)
mult = std::min(mult, transMult.getMultiplier(cartElemIdx, Opm::FaceDir::ZPlus));
cartElemIdx += cartDims[0]*cartDims[1]; cartElemIdx += cartDims[0]*cartDims[1];
} }
trans *= mult; trans *= mult;