Merge pull request #5077 from aritorto/throwMULTZlgrs

Throw for LGR combined with MULTZ keyword
This commit is contained in:
Markus Blatt 2023-12-19 17:59:35 +01:00 committed by GitHub
commit 67594ed051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -730,10 +730,20 @@ applyAllZMultipliers_(Scalar& trans,
const std::array<int, dimWorld>& cartDims,
bool pinchTop)
{
if(grid_.maxLevel()> 0) {
OPM_THROW(std::invalid_argument, "MULTZ not support with LGRS, yet.");
}
if (insideFaceIdx > 3) { // top or or bottom
assert(insideFaceIdx==5); // as insideCartElemIdx < outsideCartElemIdx holds for the Z column
assert(outsideCartElemIdx > insideCartElemIdx);
auto lastCartElemIdx = outsideCartElemIdx - cartDims[0]*cartDims[1];
// For CpGrid with LGRs, insideCartElemIdx == outsideCartElemIdx when cells on the leaf have the same parent cell on level zero.
assert(outsideCartElemIdx >= insideCartElemIdx);
unsigned lastCartElemIdx;
if (outsideCartElemIdx == insideCartElemIdx) {
lastCartElemIdx = outsideCartElemIdx;
}
else {
lastCartElemIdx = outsideCartElemIdx - cartDims[0]*cartDims[1];
}
// Last multiplier using (Z+)*(Z-)
Scalar mult = transMult.getMultiplier(lastCartElemIdx , FaceDir::ZPlus) *
transMult.getMultiplier(outsideCartElemIdx , FaceDir::ZMinus);