Merge pull request #2426 from blattms/shrink-eclequilinitializer

Shrink EclEquilInitializer::initialFluidStates_.
This commit is contained in:
Atgeirr Flø Rasmussen 2020-03-08 18:24:07 +01:00 committed by GitHub
commit ae0ace4b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,6 @@ public:
const auto& eclState = vanguard.eclState(); const auto& eclState = vanguard.eclState();
unsigned numElems = vanguard.grid().size(0); unsigned numElems = vanguard.grid().size(0);
unsigned numCartesianElems = vanguard.cartesianSize();
EQUIL::DeckDependent::InitialStateComputer<TypeTag> initialState(materialLawManager, EQUIL::DeckDependent::InitialStateComputer<TypeTag> initialState(materialLawManager,
eclState, eclState,
@ -117,10 +116,9 @@ public:
simulator.problem().gravity()[dimWorld - 1]); simulator.problem().gravity()[dimWorld - 1]);
// copy the result into the array of initial fluid states // copy the result into the array of initial fluid states
initialFluidStates_.resize(numCartesianElems); initialFluidStates_.resize(numElems);
for (unsigned int elemIdx = 0; elemIdx < numElems; ++elemIdx) { for (unsigned int elemIdx = 0; elemIdx < numElems; ++elemIdx) {
unsigned cartesianElemIdx = vanguard.cartesianIndex(elemIdx); auto& fluidState = initialFluidStates_[elemIdx];
auto& fluidState = initialFluidStates_[cartesianElemIdx];
// get the PVT region index of the current element // get the PVT region index of the current element
unsigned regionIdx = simulator_.problem().pvtRegionIndex(elemIdx); unsigned regionIdx = simulator_.problem().pvtRegionIndex(elemIdx);
@ -173,10 +171,7 @@ public:
*/ */
const ScalarFluidState& initialFluidState(unsigned elemIdx) const const ScalarFluidState& initialFluidState(unsigned elemIdx) const
{ {
const auto& vanguard = simulator_.vanguard(); return initialFluidStates_[elemIdx];
unsigned cartesianElemIdx = vanguard.cartesianIndex(elemIdx);
return initialFluidStates_[cartesianElemIdx];
} }
protected: protected: