From 0a8e1fa757d723ca66ca0a124bd48e9579521559 Mon Sep 17 00:00:00 2001 From: Antonella Ritorto Date: Thu, 14 Dec 2023 15:01:12 +0100 Subject: [PATCH] lookupIdxOnLevelZeroAssigner added --- ebos/eclproblem.hh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index f740ca44c..3fc82a7ef 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -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 lookupIdxOnLevelZeroAssigner_() + { + const auto& lookup = this->lookUpData_; + // Get Grid Type + using Grid = std::remove_cv_t< typename std::remove_referencegridView().grid())>::type>; + return [&lookup](unsigned elemIdx) { return lookup.template getFieldPropIdx(elemIdx);}; + } + void readMaterialParameters_() { OPM_TIMEBLOCK(readMaterialParameters); @@ -2018,7 +2030,8 @@ protected: materialLawManager_ = std::make_shared(); materialLawManager_->initFromState(eclState); materialLawManager_->initParamsForElements(eclState, this->model().numGridDof(), - this-> template fieldPropIntTypeOnLeafAssigner_()); + this-> template fieldPropIntTypeOnLeafAssigner_(), + this-> lookupIdxOnLevelZeroAssigner_()); //////////////////////////////// }