|
| LookUpData (const GridView &gridView, bool isFieldPropInLgr=false) |
| : Constructor taking a GridView and a bool
|
|
template<class ElementOrIndex , class FieldProperties > |
auto | operator() (const ElementOrIndex &elementOrIdx, const FieldProperties &fieldProp) const |
| : Get field propertry for an element or index in the leaf grid view, from a vector and element index.
|
|
std::vector< double > | assignFieldPropsDoubleOnLeaf (const FieldPropsManager &fieldPropsManager, const std::string &propString) const |
| : Get field property of type double from field properties manager by name.
|
|
template<typename IntType > |
std::vector< IntType > | assignFieldPropsIntOnLeaf (const FieldPropsManager &fieldPropsManager, const std::string &propString, const bool &needsTranslation, std::function< void(IntType, int)> valueCheck=[](IntType, int){}) const |
| : Get field property of type int from field properties manager by name.
|
|
template<typename ElemOrIndex > |
double | fieldPropDouble (const FieldPropsManager &fieldPropsManager, const std::string &propString, const ElemOrIndex &elemOrIndex) const |
| : Get property of type double from field properties manager by name, via element or its index.
|
|
template<typename ElemOrIndex > |
int | fieldPropInt (const FieldPropsManager &fieldPropsManager, const std::string &propString, const ElemOrIndex &elemOrIndex) const |
| : Get property of type int from field properties manager by name, via element.
|
|
template<typename ElementType > |
auto | getFieldPropIdx (const ElementType &elem) const |
| calls getFieldPropIdx<Grid, ElementType>(elem)
|
|
template<typename GridType , typename ElementType > |
auto | getFieldPropIdx (const ElementType &elem) const |
| Return the index used for retrieving field properties, depending on whether the grid is a CpGrid or a general grid, and whether the element is in an LGR.
|
|
template<typename GridType , typename IndexType > |
auto | getFieldPropIdx (const IndexType &elementOrIndex) const |
|
template<typename Grid, typename GridView>
class Opm::LookUpData< Grid, GridView >
LookUpData class - To search field properties of leaf grid view elements via element/elementIndex.
Instead of using a specialitation for Dune::CpGrid, we implement std::enable_if to overload methods with different definitions: for Dune:CpGrid and for other Grid types. An auxiliary defualt template parameter (GridType = Grid) is added to deal with the dependent names at template instantiation.
template<typename Grid , typename GridView >
template<typename GridType , typename ElementType >
auto Opm::LookUpData< Grid, GridView >::getFieldPropIdx |
( |
const ElementType & |
elem | ) |
const |
Return the index used for retrieving field properties, depending on whether the grid is a CpGrid or a general grid, and whether the element is in an LGR.
This method determines the appropriate index under two main conditions:
- Non-CpGrid: Returns the same element index that was passed in. If an entity is provided, it uses
elemMapper_
to retrieve the index. The function asserts that maxLevel()
== 0 (i.e., no LGR support) for non-CpGrid grids.
- CpGrid: Depending on whether
isFieldPropInLgr_
is true
and the element (or index) is in a refined level (> 0), the returned index is for the equivalent LGR cell; otherwise, the index of the origin (level 0) cell is returned.
- Template Parameters
-
GridType | Auxiliary type used to specialize the method for CpGrid vs. other grids. If GridType = Dune::CpGrid , local grid refinements (LGR) are considered; otherwise, LGR is not supported. |
ElementType | The type of the element or index passed in. |
- Parameters
-
elementOrIndex | An integral cell index or a grid entity (e.g., Dune::cpgrid::Entity<0> ). |
- Returns
- The integer index to be used for looking up the relevant field properties. For non-CpGrid grids, this is the same index or one retrieved from
elemMapper_
. For CpGrid grids, it is either the LGR-based index or the origin index, depending on isFieldPropInLgr_
and whether the cell is refined.
- Note
- If
GridType
is not CpGrid, the method will assert that maxLevel()
== 0, since local grid refinements are only supported for CpGrid.
template<typename Grid , typename GridView >
template<class ElementOrIndex , class FieldProperties >
auto Opm::LookUpData< Grid, GridView >::operator() |
( |
const ElementOrIndex & |
elementOrIdx, |
|
|
const FieldProperties & |
fieldProp |
|
) |
| const |
: Get field propertry for an element or index in the leaf grid view, from a vector and element index.
LookUpData.
For general grids, the field property vector is assumed to be given for the gridView_.
For CpGrid, the field property vector is assumed to be given for level 0 when isFieldPropLgr_ == false,
and for certain LGR/level > 0 when isFieldPropLgr_ == true.
- Parameters
-
[in] | elementOrIdx | Element or index of the element in the leaf grid view. |
[in] | fieldProp | Vector (indexable collection) of field properties. |
- Template Parameters
-
ElementOrIndex | the type of the element or index passed in. |
FieldProperties | the type of the field properties vector. Should be an std::vector like type. |