From 0a8e1fa757d723ca66ca0a124bd48e9579521559 Mon Sep 17 00:00:00 2001 From: Antonella Ritorto Date: Thu, 14 Dec 2023 15:01:12 +0100 Subject: [PATCH 1/3] 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_()); //////////////////////////////// } From 1f77b0c19957ab0c060ce109bca1f643c89a6aad Mon Sep 17 00:00:00 2001 From: Antonella Ritorto Date: Thu, 14 Dec 2023 16:25:11 +0100 Subject: [PATCH 2/3] Shadow declaration Grid(Type) fixed --- ebos/eclproblem.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 3fc82a7ef..9633d7d82 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -1995,8 +1995,8 @@ protected: { 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);}; + using GridType = std::remove_cv_t< typename std::remove_referencegridView().grid())>::type>; + return [&lookup](unsigned elemIdx) { return lookup.template getFieldPropIdx(elemIdx);}; } void readMaterialParameters_() From bba5833332a5bb7ed3e4c8b59ed19eae85b3b7fb Mon Sep 17 00:00:00 2001 From: Antonella Ritorto Date: Thu, 14 Dec 2023 19:59:55 +0100 Subject: [PATCH 3/3] Move lookupAssigner to remove shadow decl warnings --- ebos/eclgenericproblem.hh | 9 +++++++++ ebos/eclproblem.hh | 12 ------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ebos/eclgenericproblem.hh b/ebos/eclgenericproblem.hh index f4105b9c4..e83af70c7 100644 --- a/ebos/eclgenericproblem.hh +++ b/ebos/eclgenericproblem.hh @@ -377,6 +377,15 @@ protected: using LookUpData = Opm::LookUpData; const LookUpData lookUpData_; + // \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_() + { + return [this](unsigned elemIdx) { return lookUpData_.template getFieldPropIdx(elemIdx);}; + } + private: template void updateNum(const std::string& name, std::vector& numbers, std::size_t num_regions); diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 9633d7d82..4de6bb3c2 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -1987,18 +1987,6 @@ 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 GridType = std::remove_cv_t< typename std::remove_referencegridView().grid())>::type>; - return [&lookup](unsigned elemIdx) { return lookup.template getFieldPropIdx(elemIdx);}; - } - void readMaterialParameters_() { OPM_TIMEBLOCK(readMaterialParameters);