1 #ifndef OPM_CPGRIDCARTESIANINDEXMAPPER_HEADER
2 #define OPM_CPGRIDCARTESIANINDEXMAPPER_HEADER
7 #include <dune/grid/common/CartesianIndexMapper.hpp>
8 #include <dune/grid/CpGrid.hpp>
20 const int cartesianSize_;
22 int computeCartesianSize()
const
33 cartesianSize_( computeCartesianSize() )
39 return grid_.logicalCartesianSize();
44 return cartesianSize_;
49 return grid_.globalCell().size();
54 assert( compressedElementIndex >= 0 && compressedElementIndex <
compressedSize() );
55 return grid_.globalCell()[ compressedElementIndex ];
58 void cartesianCoordinate(
const int compressedElementIndex, std::array<int,dimension>& coords)
const
60 grid_.getIJK( compressedElementIndex, coords );
CartesianIndexMapper(const Grid &)
constructor taking grid
Definition: CartesianIndexMapper.hpp:22
int cartesianIndex(const int) const
return index of the cells in the logical Cartesian grid
Definition: CartesianIndexMapper.hpp:47
const std::array< int, dimension > & cartesianDimensions() const
return Cartesian dimensions, i.e.
Definition: CartesianIndexMapper.hpp:28
[ provides Dune::Grid ]
Definition: CpGrid.hpp:213
int cartesianSize() const
return total number of cells in the logical Cartesian grid
Definition: CartesianIndexMapper.hpp:35
int compressedSize() const
return number of cells in the active grid
Definition: CartesianIndexMapper.hpp:41
static const int dimension
dimension of the grid
Definition: CartesianIndexMapper.hpp:19
Interface class to access the logical Cartesian grid as used in industry standard simulator decks...
Definition: CartesianIndexMapper.hpp:15
void cartesianCoordinate(const int, std::array< int, dimension > &) const
return Cartesian coordinate, i.e.
Definition: CartesianIndexMapper.hpp:53