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>(); const auto& fs = iq.fluidState();
OPM_BEGIN_PARALLEL_TRY_CATCH(); const Scalar Sw = decay<Scalar>(fs.saturation(waterPhaseIdx));
for (; elemIt != elemEndIt; ++elemIt) { auto& mow = this->maxWaterSaturation_;
const Element& elem = *elemIt; mow[compressedDofIdx] = std::max(mow[compressedDofIdx], Sw);
});
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();
Scalar Sw = decay<Scalar>(fs.saturation(waterPhaseIdx));
this->maxWaterSaturation_[compressedDofIdx] = std::max(this->maxWaterSaturation_[compressedDofIdx], Sw);
}
OPM_END_PARALLEL_TRY_CATCH("EclProblem::updateMayWaterSaturation() failed: ", vanguard.grid().comm());
return true; return true;
} }