51 using Element =
typename GridView::template Codim<0>::Entity;
52 using ElementIterator =
typename GridView::template Codim<0>::Iterator;
64 void invalidateAndUpdateIntensiveQuantities(
unsigned timeIdx)
const
67 this->invalidateIntensiveQuantitiesCache(timeIdx);
68 OPM_BEGIN_PARALLEL_TRY_CATCH()
75 ElementContext elemCtx(this->simulator_);
76 ElementIterator elemIt = threadedElemIt.beginParallel();
77 for (; !threadedElemIt.isFinished(elemIt); elemIt = threadedElemIt.increment()) {
78 const Element& elem = *elemIt;
79 elemCtx.updatePrimaryStencil(elem);
80 elemCtx.updatePrimaryIntensiveQuantities(timeIdx);
83 OPM_END_PARALLEL_TRY_CATCH(
"InvalideAndUpdateIntensiveQuantities: state error", this->simulator_.vanguard().grid().comm());
86 void invalidateAndUpdateIntensiveQuantitiesOverlap(
unsigned timeIdx)
const
90 OPM_BEGIN_PARALLEL_TRY_CATCH()
95 ElementContext elemCtx(this->simulator_);
96 auto elemIt = threadedElemIt.beginParallel();
97 for (; !threadedElemIt.isFinished(elemIt); elemIt = threadedElemIt.increment()) {
98 if (elemIt->partitionType() != Dune::OverlapEntity) {
101 const Element& elem = *elemIt;
102 elemCtx.updatePrimaryStencil(elem);
104 const std::size_t numPrimaryDof = elemCtx.numPrimaryDof(timeIdx);
105 for (
unsigned dofIdx = 0; dofIdx < numPrimaryDof; ++dofIdx) {
106 const unsigned globalIndex = elemCtx.globalSpaceIndex(dofIdx, timeIdx);
107 this->setIntensiveQuantitiesCacheEntryValidity(globalIndex, timeIdx,
false);
110 elemCtx.updatePrimaryIntensiveQuantities(0);
113 OPM_END_PARALLEL_TRY_CATCH(
"InvalideAndUpdateIntensiveQuantitiesOverlap: state error", this->simulator_.vanguard().grid().comm());
116 template <
class Gr
idSubDomain>
117 void invalidateAndUpdateIntensiveQuantities(
unsigned timeIdx,
const GridSubDomain& gridSubDomain)
const
120 using GridViewType =
decltype(gridSubDomain.view);
126 ElementContext elemCtx(this->simulator_);
127 auto elemIt = threadedElemIt.beginParallel();
128 for (; !threadedElemIt.isFinished(elemIt); elemIt = threadedElemIt.increment()) {
129 if (elemIt->partitionType() != Dune::InteriorEntity) {
132 const Element& elem = *elemIt;
133 elemCtx.updatePrimaryStencil(elem);
135 const std::size_t numPrimaryDof = elemCtx.numPrimaryDof(timeIdx);
136 for (
unsigned dofIdx = 0; dofIdx < numPrimaryDof; ++dofIdx) {
137 const unsigned globalIndex = elemCtx.globalSpaceIndex(dofIdx, timeIdx);
138 this->setIntensiveQuantitiesCacheEntryValidity(globalIndex, timeIdx,
false);
141 elemCtx.updatePrimaryIntensiveQuantities(0);
157 ParentType::updateFailed();
158 invalidateAndUpdateIntensiveQuantities(0);
162 const IntensiveQuantities& intensiveQuantities(
unsigned globalIdx,
unsigned timeIdx)
const
164 if (!this->enableIntensiveQuantityCache_) {
165 OPM_THROW(std::logic_error,
166 "Run without intensive quantites not enabled: Use --enable-intensive-quantity=true");
168 const auto* intquant = this->cachedIntensiveQuantities(globalIdx, timeIdx);
170 OPM_THROW(std::logic_error,
"Intensive quantites need to be updated in code");
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:235