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

LookUpCartesianData - To search field properties of leaf grid view elements via CartesianIndex (cartesianMapper) More...

#include <LookUpData.hh>

Public Member Functions

 LookUpCartesianData (const GridView &gridView, const Dune::CartesianIndexMapper< Grid > &mapper, bool isFieldPropInLgr=false)
 : Constructor taking a GridView, a CartesianIndexMapper, and a bool
 
template<typename FieldPropType >
FieldPropType operator() (const int &elemIdx, const std::vector< FieldPropType > &fieldProp) const
 : Get field property for an element in the leaf grid view, from a vector, via Cartesian Index.
 
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 property for an element in the leaf grid view, from a vector, via Cartesian 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 or its index.
 
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 > getFieldPropCartesianIdx (const EntityType &elem) const
 : Return the same element index for all grids different from CpGrid.
 
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 > getFieldPropCartesianIdx (const EntityType &elem) const
 : Return index to search for the field propertries, for CpGrids.
 
template<typename GridType = Grid>
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, int > getFieldPropCartesianIdx (const int &elemIdx) const
 : Return the same element index for all grids different from CpGrid.
 
template<typename GridType = Grid>
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, int > getFieldPropCartesianIdx (const int &elemIdx) const
 : Return index to search for the field propertries, for CpGrids.
 

Protected Attributes

const GridView & gridView_
 
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > elemMapper_
 
const Dune::CartesianIndexMapper< Grid > * cartMapper_
 
bool isFieldPropInLgr_
 

Detailed Description

template<typename Grid, typename GridView>
class Opm::LookUpCartesianData< Grid, GridView >

LookUpCartesianData - To search field properties of leaf grid view elements via CartesianIndex (cartesianMapper)

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

◆ LookUpCartesianData()

template<typename Grid , typename GridView >
Opm::LookUpCartesianData< Grid, GridView >::LookUpCartesianData ( const GridView &  gridView,
const Dune::CartesianIndexMapper< Grid > &  mapper,
bool  isFieldPropInLgr = false 
)
inlineexplicit

: Constructor taking a GridView, a CartesianIndexMapper, and a bool

Parameters
[in]gridView
[in]mapperDune::CartesianIndexMapper<Grid>.
[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

◆ getFieldPropCartesianIdx() [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::LookUpCartesianData< Grid, GridView >::getFieldPropCartesianIdx ( 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.

◆ getFieldPropCartesianIdx() [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::LookUpCartesianData< Grid, GridView >::getFieldPropCartesianIdx ( 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.

◆ getFieldPropCartesianIdx() [3/4]

template<typename Grid , typename GridView >
template<typename GridType >
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, int > Opm::LookUpCartesianData< Grid, GridView >::getFieldPropCartesianIdx ( 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.

◆ getFieldPropCartesianIdx() [4/4]

template<typename Grid , typename GridView >
template<typename GridType >
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, int > Opm::LookUpCartesianData< Grid, GridView >::getFieldPropCartesianIdx ( const int &  elemIdx) 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.

◆ 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::LookUpCartesianData< Grid, GridView >::operator() ( const EntityType &  elem,
const std::vector< FieldPropType > &  fieldProp 
) const

: Get field property for an element in the leaf grid view, from a vector, via Cartesian Index.

    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::LookUpCartesianData< Grid, GridView >::operator() ( const int &  elemIdx,
const std::vector< FieldPropType > &  fieldProp 
) const

: Get field property for an element in the leaf grid view, from a vector, via Cartesian Index.

LookUpCartesianData.

    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. 

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