Use FieldPropsManager to get SATNUM vector

This commit is contained in:
Joakim Hove
2019-11-27 17:55:29 +01:00
parent 589e55d30d
commit 2ac41b75ca
2 changed files with 18 additions and 2 deletions

View File

@@ -126,6 +126,17 @@ public:
// copy the SATNUM grid property. in some cases this is not necessary, but it
// should not require much memory anyway...
#ifdef ENABLE_3DPROPS_TESTING
const auto& fp = eclState.fieldProps();
satnumRegionArray_ = fp.get<int>("SATNUM");
std::transform(satnumRegionArray_.begin(), satnumRegionArray_.end(), satnumRegionArray_.begin(), [](const int& satnum_value) { return satnum_value - 1; });
if (fp.has<double>("IMBNUM")) {
imbnumRegionArray_ = fp.get<int>("IMBNUM");
std::transform(imbnumRegionArray_.begin(), imbnumRegionArray_.end(), imbnumRegionArray_.begin(), [](const int& imbnum_value) { return imbnum_value - 1; });
} else
imbnumRegionArray_ = satnumRegionArray_;
#else
satnumRegionArray_.resize(numCompressedElems);
if (eclState.get3DProperties().hasDeckIntGridProperty("SATNUM")) {
const auto& satnumRawData = eclState.get3DProperties().getIntGridProperty("SATNUM").getData();
@@ -147,7 +158,7 @@ public:
imbnumRegionArray_[elemIdx] = imbnumRawData[cartesianElemIdx] - 1;
}
}
#endif
readGlobalEpsOptions_(deck, eclState);
readGlobalHysteresisOptions_(deck);
readGlobalThreePhaseOptions_(deck);

View File

@@ -180,6 +180,11 @@ private:
solidEnergyApproach_ = SolidEnergyLawParams::specrockApproach;
// initialize the element index -> SATNUM index mapping
#ifdef ENABLE_3DPROPS_TESTING
const auto& fp = eclState.fieldProps();
elemToSatnumIdx_ = fp.get<int>("SATNUM");
std::transform(elemToSatnumIdx_.begin(), elemToSatnumIdx_.end(), elemToSatnumIdx_.begin(), [](const int& satnum_value) { return satnum_value - 1; });
#else
const auto& props = eclState.get3DProperties();
const std::vector<int>& satnumData = props.getIntGridProperty("SATNUM").getData();
elemToSatnumIdx_.resize(compressedToCartesianElemIdx.size());
@@ -190,7 +195,7 @@ private:
// of 0!
elemToSatnumIdx_[elemIdx] = satnumData[cartesianElemIdx] - 1;
}
#endif
// internalize the SPECROCK table
unsigned numSatRegions = eclState.runspec().tabdims().getNumSatTables();
const auto& tableManager = eclState.getTableManager();