threshold pressure: be more cautious when acessing the defaults

maybe it worked as-is, or maybe decks which lead to illegal accesses
to the map are incorrect (i.e., they specify threshold pressures for
EQUIL-regions that do not touch), but let's play save here...
This commit is contained in:
Andreas Lauser 2016-09-28 16:38:35 +02:00
parent 662d6e28cd
commit 4f4d7531af

View File

@ -277,7 +277,7 @@ void computeMaxDp(std::map<std::pair<int, int>, double>& maxDp,
// update the maximum pressure potential difference between the two // update the maximum pressure potential difference between the two
// regions // regions
const auto barrierId = std::make_pair(eq1, eq2); const auto barrierId = std::make_pair(std::min(eq1, eq2), std::max(eq1, eq2));
if (maxDp.count(barrierId) == 0) { if (maxDp.count(barrierId) == 0) {
maxDp[barrierId] = 0.0; maxDp[barrierId] = 0.0;
} }
@ -363,8 +363,11 @@ void computeMaxDp(std::map<std::pair<int, int>, double>& maxDp,
// set the threshold pressure for faces of PVT regions where the third item // set the threshold pressure for faces of PVT regions where the third item
// has been defaulted to the maximum pressure potential difference between // has been defaulted to the maximum pressure potential difference between
// these regions // these regions
const auto barrierId = std::make_pair(eq1, eq2); const auto barrierId = std::make_pair(std::min(eq1, eq2), std::max(eq1, eq2));
if (maxDp.count(barrierId) > 0)
thpres_vals[face] = maxDp.at(barrierId); thpres_vals[face] = maxDp.at(barrierId);
else
thpres_vals[face] = 0.0;
} }
} }