|
| LookUpData (const GridView &gridView) |
| : Constructor taking a GridView
|
|
template<typename EntityType , typename FeatureType > |
FeatureType | operator() (const EntityType &elem, const std::vector< FeatureType > &feature_vec) const |
| : Call operator taking an EntityObject and a FeatureVector.
|
|
template<typename FeatureType > |
FeatureType | operator() (const int &elemIdx, const std::vector< FeatureType > &feature_vec) const |
| : Call operator taking an Index and a FeatureVector.
|
|
template<typename EntityType , typename GridType = Grid> |
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, int > | getOriginIndexFromEntity (const EntityType &elem) const |
| : For general grids, it retunrs the same Entity index.
|
|
template<typename EntityType , typename GridType = Grid> |
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, int > | getOriginIndexFromEntity (const EntityType &elem) const |
| : For CpGrid, it returns index of origin cell (parent/equivalent cell when element has no father) in level 0.
|
|
template<typename GridType > |
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, int > | getOriginIndex (const int &elemIdx) const |
| : For general grids, it retunrs the same element index.
|
|
template<typename GridType = Grid> |
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, int > | getOriginIndex (const int &elemIdx) const |
| : For CpGrid, it returns index of origin cell (parent/equivalent cell when elem has no father) in level 0.
|
|
template<typename Grid, typename GridView>
class Opm::LookUpData< Grid, GridView >
LookUpData class - To search data via element index.
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 EntityType , typename GridType >
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, int > Opm::LookUpData< Grid, GridView >::getOriginIndexFromEntity |
( |
const EntityType & |
elem | ) |
const |
: For CpGrid, it returns index of origin cell (parent/equivalent cell when element has no father) in level 0.
- Template Parameters
-
EntityType | Element type. |
GridType | Auxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid. |
- Parameters
-
[in] | element | EntityType object. |
- Returns
- element origin index Index of the origin cell (parent/equivalent cell when element has no father) in level 0.
template<typename Grid , typename GridView >
template<typename EntityType , typename FeatureType >
FeatureType Opm::LookUpData< Grid, GridView >::operator() |
( |
const EntityType & |
elem, |
|
|
const std::vector< FeatureType > & |
feature_vec |
|
) |
| const |
: Call operator taking an EntityObject and a FeatureVector.
LookUpData.
Return feature of the entity, via (ACTIVE) INDEX
For general grids, the feature vector is given for the gridView_.
For CpGrid, the feature vector is given for level 0.
- Template Parameters
-
EntityType | Element type. |
FeatureType | Type of the property of the element, e.g. int, double, float, etc. |
- Parameters
-
[in] | element | EntityType object. |
[in] | feature_vec | Vector with each entry, the feature of an element of the gridView_ [for general grids], or level 0 for CpGrid. |
- Returns
- feature of the given element.
template<typename Grid , typename GridView >
template<typename FeatureType >
FeatureType Opm::LookUpData< Grid, GridView >::operator() |
( |
const int & |
elemIdx, |
|
|
const std::vector< FeatureType > & |
feature_vec |
|
) |
| const |
: Call operator taking an Index and a FeatureVector.
Return feature of the entity, via (ACTIVE) INDEX
For general grids, the feature vector is given for the gridView_.
For CpGrid, the feature vector is given for level 0.
- Template Parameters
-
FeatureType | Type of the property of the element, e.g. int, double, float, etc. |
- Parameters
-
[in] | element | index |
[in] | feature_vec | Vector with each entry, the feature of an element of the gridView_ [for general grids], or level 0 for CpGrid. |
- Returns
- feature of the element of the gridView_ associated to the given index.