Skip to content

Commit

Permalink
Merge pull request #626 from totto82/updateIntensive
Browse files Browse the repository at this point in the history
Make a method that invalidate and updates the intensive quantities
  • Loading branch information
atgeirr authored Sep 28, 2020
2 parents c89f660 + d662902 commit f79c543
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions opm/models/discretization/common/fvbasediscretization.hh
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,26 @@ public:
}
}

void invalidateAndUpdateIntensiveQuantities(unsigned timeIdx) const
{
invalidateIntensiveQuantitiesCache(timeIdx);

// loop over all elements...
ThreadedEntityIterator<GridView, /*codim=*/0> threadedElemIt(gridView_);
#ifdef _OPENMP
#pragma omp parallel
#endif
{
ElementContext elemCtx(simulator_);
ElementIterator elemIt = threadedElemIt.beginParallel();
for (; !threadedElemIt.isFinished(elemIt); elemIt = threadedElemIt.increment()) {
const Element& elem = *elemIt;
elemCtx.updatePrimaryStencil(elem);
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
}
}
}

/*!
* \brief Move the intensive quantities for a given time index to the back.
*
Expand Down

0 comments on commit f79c543

Please sign in to comment.