1#ifndef OPM_CPGRIDCARTESIANINDEXMAPPER_HEADER
2#define OPM_CPGRIDCARTESIANINDEXMAPPER_HEADER
8#include <opm/grid/common/CartesianIndexMapper.hpp>
9#include <opm/grid/CpGrid.hpp>
21 const int cartesianSize_;
23 int computeCartesianSize()
const
34 cartesianSize_( computeCartesianSize() )
45 return cartesianSize_;
55 assert( compressedElementIndex >= 0 && compressedElementIndex <
compressedSize() );
56 return grid_.
globalCell()[ compressedElementIndex ];
59 void cartesianCoordinate(
const int compressedElementIndex, std::array<int,dimension>& coords)
const
61 grid_.
getIJK( compressedElementIndex, coords );
Interface class to access the logical Cartesian grid as used in industry standard simulator decks.
Definition CartesianIndexMapper.hpp:16
int cartesianIndex(const int) const
return index of the cells in the logical Cartesian grid
Definition CartesianIndexMapper.hpp:47
int compressedSize() const
return number of cells in the active grid
Definition CartesianIndexMapper.hpp:41
const std::array< int, dimension > & cartesianDimensions() const
return Cartesian dimensions, i.e.
Definition CartesianIndexMapper.hpp:28
static const int dimension
dimension of the grid
Definition CartesianIndexMapper.hpp:19
int cartesianSize() const
return total number of cells in the logical Cartesian grid
Definition CartesianIndexMapper.hpp:35
void cartesianCoordinate(const int, std::array< int, dimension > &) const
return Cartesian coordinate, i.e.
Definition CartesianIndexMapper.hpp:53
[ provides Dune::Grid ]
Definition CpGrid.hpp:198
const std::vector< int > & globalCell() const
Retrieve mapping from internal ("compressed") active grid cells to external ("uncompressed") cells.
Definition CpGrid.cpp:672
const std::array< int, 3 > & logicalCartesianSize() const
The logical cartesian size of the global grid.
Definition CpGrid.cpp:655
void getIJK(const int c, std::array< int, 3 > &ijk) const
Extract Cartesian index triplet (i,j,k) of an active cell.
Definition CpGrid.cpp:744
The namespace Dune is the main namespace for all Dune code.
Definition CartesianIndexMapper.hpp:10