Opm::LookUpData< Grid, GridView > Class Template Reference

#include <LookUpData.hh>

Public Member Functions

 LookUpData (const GridView &gridView, bool isFieldPropInLgr=false)
 : Constructor taking a GridView and a bool More...
 
template<typename FieldPropType >
FieldPropType operator() (const int &elemIdx, const std::vector< FieldPropType > &fieldProp) const
 : Get field propertry for an element in the leaf grid view, from a vector and element index. More...
 
template<typename EntityType , typename FieldPropType >
std::enable_if_t<!std::is_same_v< EntityType, unsigned int >, FieldPropType > operator() (const EntityType &elem, const std::vector< FieldPropType > &fieldProp) const
 : Get field propertry for an element in the leaf grid view, from a vector. More...
 
std::vector< double > assignFieldPropsDoubleOnLeaf (const FieldPropsManager &fieldPropsManager, const std::string &propString) const
 : Get field property of type double from field properties manager by name. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename EntityType , typename GridType = Grid>
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid > &&!std::is_same_v< EntityType, unsigned int >, int > getFieldPropIdx (const EntityType &elem) const
 : Return the same element index for all grids different from CpGrid. More...
 
template<typename EntityType , typename GridType = Grid>
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid > &&!std::is_same_v< EntityType, unsigned int >, int > getFieldPropIdx (const EntityType &elem) const
 : Return index to search for the field propertries, for CpGrids. More...
 
template<typename GridType >
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, int > getFieldPropIdx (const int &elemIdx) const
 : Return the same element index for all grids different from CpGrid. More...
 
template<typename GridType = Grid>
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, int > getFieldPropIdx (const int &elemIdx) const
 : Return the index to search for the field properties, for CpGrids. More...
 

Protected Attributes

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ LookUpData()

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

: Constructor taking a GridView and a bool

Parameters
[in]GridView
[in]isFieldPropInLgrbool: default false (search field property in unrefined grid) true (search field property in refined grid; LGR-id/level required) Currently, isFieldPropInLgr_ == false means that all the field properties are given in the unrefined grid (level 0).

Member Function Documentation

◆ assignFieldPropsDoubleOnLeaf()

template<typename Grid , typename GridView >
std::vector< double > Opm::LookUpData< Grid, GridView >::assignFieldPropsDoubleOnLeaf ( const FieldPropsManager &  fieldPropsManager,
const std::string &  propString 
) const

: Get field property of type double from field properties manager by name.

◆ assignFieldPropsIntOnLeaf()

template<typename Grid , typename GridView >
template<typename IntType >
std::vector< IntType > Opm::LookUpData< Grid, GridView >::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.

◆ fieldPropDouble()

template<typename Grid , typename GridView >
template<typename ElemOrIndex >
double Opm::LookUpData< Grid, GridView >::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.

◆ fieldPropInt()

template<typename Grid , typename GridView >
template<typename ElemOrIndex >
int Opm::LookUpData< Grid, GridView >::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.

◆ getFieldPropIdx() [1/4]

template<typename Grid , typename GridView >
template<typename EntityType , typename GridType >
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid > &&!std::is_same_v< EntityType, unsigned int >, int > Opm::LookUpData< Grid, GridView >::getFieldPropIdx ( const EntityType &  elem) const

: Return the same element index for all grids different from CpGrid.

Template Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.

◆ getFieldPropIdx() [2/4]

template<typename Grid , typename GridView >
template<typename EntityType , typename GridType >
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid > &&!std::is_same_v< EntityType, unsigned int >, int > Opm::LookUpData< Grid, GridView >::getFieldPropIdx ( const EntityType &  elem) const

: Return index to search for the field propertries, for CpGrids.

    When isFieldPropInLgr_ == false : fieldPropIdx == Index of the origin cell (parent/equivalent cell when element
                                      has nofather) in level 0.
    When isFieldPropInLgr_ == true  : fieldPropIdx == Index of the equivalent cell in the LGR (level>0).
Template Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.

◆ getFieldPropIdx() [3/4]

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

: Return the same element index for all grids different from CpGrid.

Template Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.

◆ getFieldPropIdx() [4/4]

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

: Return the index to search for the field properties, for CpGrids.

    When isFieldPropInLgr_ == false : fieldPropIdx == Index of the origin cell (parent/equivalent cell when element
                                      has nofather) in level 0.
    When isFieldPropInLgr_ == true  : fieldPropIdx == Index of the equivalent cell in the LGR (level>0).
Template Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.

◆ operator()() [1/2]

template<typename Grid , typename GridView >
template<typename EntityType , typename FieldPropType >
std::enable_if_t<!std::is_same_v< EntityType, unsigned int >, FieldPropType > Opm::LookUpData< Grid, GridView >::operator() ( const EntityType &  elem,
const std::vector< FieldPropType > &  fieldProp 
) const

: Get field propertry for an element in the leaf grid view, from a vector.

    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. 

◆ operator()() [2/2]

template<typename Grid , typename GridView >
template<typename FieldPropType >
FieldPropType Opm::LookUpData< Grid, GridView >::operator() ( const int &  elemIdx,
const std::vector< FieldPropType > &  fieldProp 
) const

: Get field propertry for an element 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. 

Member Data Documentation

◆ elemMapper_

template<typename Grid , typename GridView >
Dune::MultipleCodimMultipleGeomTypeMapper<GridView> Opm::LookUpData< Grid, GridView >::elemMapper_
protected

◆ gridView_

template<typename Grid , typename GridView >
const GridView& Opm::LookUpData< Grid, GridView >::gridView_
protected

◆ isFieldPropInLgr_

template<typename Grid , typename GridView >
bool Opm::LookUpData< Grid, GridView >::isFieldPropInLgr_
protected

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