My Project
Loading...
Searching...
No Matches
Opm::LookUpData< Grid, GridView > Class Template Reference

LookUpData class - To search data via element index. More...

#include <LookUpData.hh>

Public Member Functions

 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.
 

Protected Attributes

const GridView & gridView_
 
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > elemMapper_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LookUpData()

template<typename Grid , typename GridView >
Opm::LookUpData< Grid, GridView >::LookUpData ( const GridView &  gridView)
inlineexplicit

: Constructor taking a GridView

Parameters
[in]GridView

Member Function Documentation

◆ getOriginIndex() [1/2]

template<typename Grid , typename GridView >
template<typename GridType >
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, int > Opm::LookUpData< Grid, GridView >::getOriginIndex ( const int &  elemIdx) const

: For general grids, it retunrs the same element index.

Template Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.
Parameters
[in]elementindex
Returns
element index

◆ getOriginIndex() [2/2]

template<typename Grid , typename GridView >
template<typename GridType >
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, int > Opm::LookUpData< Grid, GridView >::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 Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.
Parameters
[in]elementindex
Returns
element origin index Index of the origin cell (parent/equivalent cell when element has no father) in level 0.

◆ getOriginIndexFromEntity() [1/2]

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 general grids, it retunrs the same Entity index.

Template Parameters
EntityTypeElement type.
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.
Parameters
[in]elementEntityType object.
Returns
element index.

◆ getOriginIndexFromEntity() [2/2]

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
EntityTypeElement type.
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.
Parameters
[in]elementEntityType object.
Returns
element origin index Index of the origin cell (parent/equivalent cell when element has no father) in level 0.

◆ operator()() [1/2]

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
EntityTypeElement type.
FeatureTypeType of the property of the element, e.g. int, double, float, etc.
Parameters
[in]elementEntityType object.
[in]feature_vecVector 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.

◆ operator()() [2/2]

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
FeatureTypeType of the property of the element, e.g. int, double, float, etc.
Parameters
[in]elementindex
[in]feature_vecVector 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.

The documentation for this class was generated from the following files: