Support at Least NTFIP Distinict Regions for Inter-Region Flow

This commit ensures that we have backing support for region IDs up
to and including NTFIP (TABDIMS(5), REGDIMS(1)).  The existing setup
would fail (segmentation violation) in the case of a summary vector
of the form

    ROFT
      36 31 /
    /

when the maximum FIPNUM value was 30.  We nevertheless support
maximum FIPNUM values exceeding NTFIP.

We add a new optional parameter to the EclInterRegionFlowMap
constructor.  The parameter allows client code to specifiy a
"minimum maximum" region ID that all ranks must support.  This value
will be enforced during parallel aggregation.
This commit is contained in:
Bård Skaflestad
2024-01-23 18:54:46 +01:00
parent 24ebb77257
commit eb9ead5577
4 changed files with 108 additions and 4 deletions

View File

@@ -105,7 +105,10 @@ assignGlobalMaxRegionID(const std::size_t regID)
return false;
}
this->maxGlobalRegionID_ = regID;
if (regID > this->maxGlobalRegionID_) {
this->maxGlobalRegionID_ = regID;
}
return true;
}
@@ -128,7 +131,8 @@ Opm::EclInterRegFlowMap::createMapFromNames(std::vector<std::string> names)
Opm::EclInterRegFlowMap::
EclInterRegFlowMap(const std::size_t numCells,
const std::vector<SingleRegion>& regions)
const std::vector<SingleRegion>& regions,
const std::size_t declaredMaxRegID)
{
this->regionMaps_.reserve(regions.size());
this->names_.reserve(regions.size());
@@ -139,6 +143,12 @@ EclInterRegFlowMap(const std::size_t numCells,
this->regionMaps_.emplace_back(region.definition);
this->names_.push_back(region.name);
}
if (declaredMaxRegID > std::size_t{0}) {
for (auto& regionMap : this->regionMaps_) {
regionMap.assignGlobalMaxRegionID(declaredMaxRegID);
}
}
}
void