LookUpCellCentroid struct - To search cell centroids via element index.
More...
#include <LookUpCellCentroid.hh>
|
| | 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...
|
| |
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.
◆ LookUpCellCentroid()
template<typename Grid , typename GridView >
: Constructor taking a GridView, CartesianMapper
- Parameters
-
| [in] | gridView | Grid view |
| [in] | cartMapper | Cartesian index mapper |
| [in] | eclgrid | Eclipse grid |
◆ operator()() [1/2]
template<typename Grid , typename GridView >
template<typename GridType >
: Call operator
For grids different from Dune::CpGrid, it takes an element index, and returns its cell centroid, from an EclipseGrid.
- Template Parameters
-
| GridType | Auxiliary type to overload the method, distinguishing general grids from CpGrid, with std::enable_if. Default: GridType = Grid. |
- Parameters
-
| [in] | elemIdx | Element Index. |
- Returns
- centroid Centroid of the element, computed as in Eclipse.
◆ operator()() [2/2]
template<typename Grid , typename GridView >
template<typename GridType >
: Call operator
For Dune::CpGrid, it returns a function, taking an integer, returning cell centroid, computed as in Eclipse.
- Template Parameters
-
| GridType | Auxiliary 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.
The documentation for this struct was generated from the following file: