lookupIdxOnLevelZeroAssigner added

This commit is contained in:
Antonella Ritorto 2023-12-14 15:01:12 +01:00
parent fc73a51310
commit 0a8e1fa757

View File

@ -1987,6 +1987,18 @@ protected:
}; };
} }
// \brief Function to assign the origin cell index on level zero, for a cell on the leaf grid view.
//
// For CpGrid with local grid refinement, the field property of a cell on the leaf
// is inherited from its parent or equivalent (when has no parent) cell on level zero.
std::function<unsigned(unsigned)> lookupIdxOnLevelZeroAssigner_()
{
const auto& lookup = this->lookUpData_;
// Get Grid Type
using Grid = std::remove_cv_t< typename std::remove_reference<decltype(this->gridView().grid())>::type>;
return [&lookup](unsigned elemIdx) { return lookup.template getFieldPropIdx<Grid>(elemIdx);};
}
void readMaterialParameters_() void readMaterialParameters_()
{ {
OPM_TIMEBLOCK(readMaterialParameters); OPM_TIMEBLOCK(readMaterialParameters);
@ -2018,7 +2030,8 @@ protected:
materialLawManager_ = std::make_shared<EclMaterialLawManager>(); materialLawManager_ = std::make_shared<EclMaterialLawManager>();
materialLawManager_->initFromState(eclState); materialLawManager_->initFromState(eclState);
materialLawManager_->initParamsForElements(eclState, this->model().numGridDof(), materialLawManager_->initParamsForElements(eclState, this->model().numGridDof(),
this-> template fieldPropIntTypeOnLeafAssigner_<int>()); this-> template fieldPropIntTypeOnLeafAssigner_<int>(),
this-> lookupIdxOnLevelZeroAssigner_());
//////////////////////////////// ////////////////////////////////
} }