Merge pull request #5064 from aritorto/lookupAssigner

lookupIdxOnLevelZeroAssigner added
This commit is contained in:
Markus Blatt 2023-12-18 11:33:56 +01:00 committed by GitHub
commit acc08799a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -377,6 +377,15 @@ protected:
using LookUpData = Opm::LookUpData<Grid,GridView>;
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<unsigned(unsigned)> lookupIdxOnLevelZeroAssigner_()
{
return [this](unsigned elemIdx) { return lookUpData_.template getFieldPropIdx<Grid>(elemIdx);};
}
private:
template<class T>
void updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regions);

View File

@ -2018,7 +2018,8 @@ protected:
materialLawManager_ = std::make_shared<EclMaterialLawManager>();
materialLawManager_->initFromState(eclState);
materialLawManager_->initParamsForElements(eclState, this->model().numGridDof(),
this-> template fieldPropIntTypeOnLeafAssigner_<int>());
this-> template fieldPropIntTypeOnLeafAssigner_<int>(),
this-> lookupIdxOnLevelZeroAssigner_());
////////////////////////////////
}