Opm::LookUpCellCentroid< Grid, GridView > Struct Template Reference

#include <LookUpCellCentroid.hh>

Public Member Functions

 LookUpCellCentroid (const GridView &gridView, const Dune::CartesianIndexMapper< Grid > &cartMapper, const Opm::EclipseGrid *eclgrid)
 : Constructor taking a GridView, CartesianMapper More...
 
template<typename GridType = Grid>
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, std::array< double, 3 > > operator() (std::size_t elemIdx) const
 : Call operator More...
 
template<typename GridType = Grid>
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, std::array< double, 3 > > operator() (std::size_t elemIdx) const
 : Call operator More...
 

Public Attributes

const GridView & gridView_
 
const Dune::CartesianIndexMapper< Grid > * cartMapper_
 
const Opm::EclipseGrid * eclGrid_
 

Detailed Description

template<typename Grid, typename GridView>
struct Opm::LookUpCellCentroid< Grid, GridView >

LookUpCellCentroid struct - To search cell centroids 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

◆ LookUpCellCentroid()

template<typename Grid , typename GridView >
Opm::LookUpCellCentroid< Grid, GridView >::LookUpCellCentroid ( const GridView &  gridView,
const Dune::CartesianIndexMapper< Grid > &  cartMapper,
const Opm::EclipseGrid *  eclgrid 
)
inlineexplicit

: Constructor taking a GridView, CartesianMapper

Parameters
[in]GridView
[in]CartesianIndexMapper
[in]EclipseGrid

Member Function Documentation

◆ operator()() [1/2]

template<typename Grid , typename GridView >
template<typename GridType >
std::enable_if_t<!std::is_same_v< GridType, Dune::CpGrid >, std::array< double, 3 > > Opm::LookUpCellCentroid< Grid, GridView >::operator() ( std::size_t  elemIdx) const

: Call operator

    For grids different from Dune::CpGrid, it takes an element index, and
    returns its cell centroid, from an EclipseGrid.
Template Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.
Parameters
[in]elemIdxElement Index.
Returns
centroid Centroid of the element, computed as in Eclipse.

◆ operator()() [2/2]

template<typename Grid , typename GridView >
template<typename GridType >
std::enable_if_t< std::is_same_v< GridType, Dune::CpGrid >, std::array< double, 3 > > Opm::LookUpCellCentroid< Grid, GridView >::operator() ( std::size_t  elemIdx) const

: Call operator

    For Dune::CpGrid, it returns a function, taking an integer,
    returning cell centroid, computed as in Eclipse.
Template Parameters
GridTypeAuxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid.
Returns
centroid Element centroid, computed as in Eclipse.

Member Data Documentation

◆ cartMapper_

template<typename Grid , typename GridView >
const Dune::CartesianIndexMapper<Grid>* Opm::LookUpCellCentroid< Grid, GridView >::cartMapper_

◆ eclGrid_

template<typename Grid , typename GridView >
const Opm::EclipseGrid* Opm::LookUpCellCentroid< Grid, GridView >::eclGrid_

◆ gridView_

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

The documentation for this struct was generated from the following file: