changed: use updateProperty_ in updateMaxWaterSaturation_

This commit is contained in:
Arne Morten Kvarving 2022-10-05 11:26:44 +02:00
parent 32995d34a1
commit 80b54a85ad

View File

@ -2234,26 +2234,14 @@ private:
return false; return false;
this->maxWaterSaturation_[/*timeIdx=*/1] = this->maxWaterSaturation_[/*timeIdx=*/0]; this->maxWaterSaturation_[/*timeIdx=*/1] = this->maxWaterSaturation_[/*timeIdx=*/0];
ElementContext elemCtx(this->simulator()); this->updateProperty_("EclProblem::updateMaxWaterSaturation_() failed:",
const auto& vanguard = this->simulator().vanguard(); [this](unsigned compressedDofIdx, const IntensiveQuantities& iq)
auto elemIt = vanguard.gridView().template begin</*codim=*/0>(); {
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
OPM_BEGIN_PARALLEL_TRY_CATCH();
for (; elemIt != elemEndIt; ++elemIt) {
const Element& elem = *elemIt;
elemCtx.updatePrimaryStencil(elem);
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
unsigned compressedDofIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
const auto& iq = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
const auto& fs = iq.fluidState(); const auto& fs = iq.fluidState();
const Scalar Sw = decay<Scalar>(fs.saturation(waterPhaseIdx));
Scalar Sw = decay<Scalar>(fs.saturation(waterPhaseIdx)); auto& mow = this->maxWaterSaturation_;
this->maxWaterSaturation_[compressedDofIdx] = std::max(this->maxWaterSaturation_[compressedDofIdx], Sw); mow[compressedDofIdx] = std::max(mow[compressedDofIdx], Sw);
} });
OPM_END_PARALLEL_TRY_CATCH("EclProblem::updateMayWaterSaturation() failed: ", vanguard.grid().comm());
return true; return true;
} }