ebos: hysteresis needs to be updated for all elements

in the parallel case, this avoids the participating processes from
desyncronizing if the solution is consistent on all processes.
This commit is contained in:
Andreas Lauser 2017-04-15 15:09:34 +02:00
parent 626db3a0fa
commit 346710c5af

View File

@ -1318,16 +1318,16 @@ private:
if (!materialLawManager_->enableHysteresis()) if (!materialLawManager_->enableHysteresis())
return false; return false;
// 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!
ElementContext elemCtx(this->simulator()); ElementContext elemCtx(this->simulator());
const auto& gridManager = this->simulator().gridManager(); const auto& gridManager = this->simulator().gridManager();
auto elemIt = gridManager.gridView().template begin</*codim=*/0>(); auto elemIt = gridManager.gridView().template begin</*codim=*/0>();
const auto& elemEndIt = gridManager.gridView().template end</*codim=*/0>(); const auto& elemEndIt = gridManager.gridView().template end</*codim=*/0>();
for (; elemIt != elemEndIt; ++elemIt) { for (; elemIt != elemEndIt; ++elemIt) {
const Element& elem = *elemIt; const Element& elem = *elemIt;
if (elem.partitionType() != Dune::InteriorEntity)
continue;
elemCtx.updateStencil(elem); elemCtx.updatePrimaryStencil(elem);
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0); elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
unsigned compressedDofIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0); unsigned compressedDofIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);