changed: use updateProperty_ in updateHysteresis_

This commit is contained in:
Arne Morten Kvarving 2022-10-05 11:26:44 +02:00
parent f4cd69f422
commit 0841b2baf4

View File

@ -2744,23 +2744,11 @@ private:
// we need to update the hysteresis data for _all_ elements (i.e., not just the // we need to update the hysteresis data for _all_ elements (i.e., not just the
// interior ones) to avoid desynchronization of the processes in the parallel case! // interior ones) to avoid desynchronization of the processes in the parallel case!
const auto& simulator = this->simulator(); this->updateProperty_("EclProblem::updateHysteresis_() failed:",
ElementContext elemCtx(simulator); [this](unsigned compressedDofIdx, const IntensiveQuantities& iq)
const auto& vanguard = simulator.vanguard(); {
auto elemIt = vanguard.gridView().template begin</*codim=*/0>(); materialLawManager_->updateHysteresis(iq.fluidState(), compressedDofIdx);
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& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
materialLawManager_->updateHysteresis(intQuants.fluidState(), compressedDofIdx);
}
OPM_END_PARALLEL_TRY_CATCH("EclProblem::updateHyteresis_(): ", vanguard.grid().comm());
return true; return true;
} }