mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-02 05:49:09 -06:00
Merge pull request #5057 from aritorto/thermalLawMan
Function to lookup origin cell indices added in thermal field props.
This commit is contained in:
commit
05b61b12f8
@ -377,12 +377,6 @@ protected:
|
||||
using LookUpData = Opm::LookUpData<Grid,GridView>;
|
||||
const LookUpData lookUpData_;
|
||||
|
||||
auto getLookUpData(unsigned elemIdx) const
|
||||
{
|
||||
using GridType = std::remove_cv_t< typename std::remove_reference<decltype(gridView_.grid())>::type>;
|
||||
return lookUpData_.template getFieldPropIdx<GridType>(elemIdx);
|
||||
}
|
||||
|
||||
private:
|
||||
template<class T>
|
||||
void updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regions);
|
||||
|
@ -1955,6 +1955,38 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
// \brief Function to assign field properties of type double, 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<std::vector<double>(const FieldPropsManager&, const std::string&, const unsigned int&)>
|
||||
getFieldPropDoubleOnLeafAssigner_()
|
||||
{
|
||||
const auto& lookup = this->lookUpData_;
|
||||
return [&lookup](const FieldPropsManager& fieldPropManager, const std::string& propString,
|
||||
const unsigned int& numElems)
|
||||
{
|
||||
return lookup.assignFieldPropsDoubleOnLeaf(fieldPropManager, propString, numElems);
|
||||
};
|
||||
}
|
||||
|
||||
// \brief Function to assign field properties of type int, unsigned int, ..., 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.
|
||||
template<typename IntType>
|
||||
std::function<std::vector<IntType>(const FieldPropsManager&, const std::string&, const unsigned int&, bool)>
|
||||
getFieldPropIntTypeOnLeafAssigner_()
|
||||
{
|
||||
const auto& lookup = this->lookUpData_;
|
||||
return [&lookup](const FieldPropsManager& fieldPropManager, const std::string& propString,
|
||||
const unsigned int& numElems, bool needsTranslation)
|
||||
{
|
||||
return lookup.template assignFieldPropsIntOnLeaf<IntType>(fieldPropManager, propString,
|
||||
numElems, needsTranslation);
|
||||
};
|
||||
}
|
||||
|
||||
void readMaterialParameters_()
|
||||
{
|
||||
OPM_TIMEBLOCK(readMaterialParameters);
|
||||
@ -1999,7 +2031,9 @@ protected:
|
||||
|
||||
// fluid-matrix interactions (saturation functions; relperm/capillary pressure)
|
||||
thermalLawManager_ = std::make_shared<EclThermalLawManager>();
|
||||
thermalLawManager_->initParamsForElements(eclState, this->model().numGridDof());
|
||||
thermalLawManager_->initParamsForElements(eclState, this->model().numGridDof(),
|
||||
this-> getFieldPropDoubleOnLeafAssigner_(),
|
||||
this-> template getFieldPropIntTypeOnLeafAssigner_<unsigned int>());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user