threshold pressures: take advantage of the fact that opm-parser handles them symmetrically

i.e., thpres->hasRegionBarrier(i, j) == thpres->hasRegionBarrier(j, i)

this allows to simplify the code a bit.
This commit is contained in:
Andreas Lauser 2016-09-26 16:33:10 +02:00
parent 97eda5bb55
commit e21f0b964e

View File

@ -259,18 +259,12 @@ private:
unsigned equilRegionInside = elemEquilRegion_[insideElemIdx];
unsigned equilRegionOutside = elemEquilRegion_[outsideElemIdx];
if (thpres->hasRegionBarrier(equilRegionInside + 1, equilRegionOutside + 1) ||
thpres->hasRegionBarrier(equilRegionOutside + 1, equilRegionInside + 1))
{
if (thpres->hasRegionBarrier(equilRegionInside + 1, equilRegionOutside + 1)) {
Scalar pth = 0.0;
if (thpres->hasThresholdPressure(equilRegionInside + 1, equilRegionOutside + 1)) {
// threshold pressure explicitly specified
pth = thpres->getThresholdPressure(equilRegionInside + 1, equilRegionOutside + 1);
}
else if (thpres->hasThresholdPressure(equilRegionOutside + 1, equilRegionInside + 1)) {
// threshold pressure explicitly specified
pth = thpres->getThresholdPressure(equilRegionOutside + 1, equilRegionInside + 1);
}
else {
// take the threshold pressure from the initial condition
unsigned offset = equilRegionInside*numEquilRegions_ + equilRegionOutside;