1#ifndef OPM_CPGRIDCARTESIANINDEXMAPPER_HEADER
2#define OPM_CPGRIDCARTESIANINDEXMAPPER_HEADER
8#include <opm/grid/common/CartesianIndexMapper.hpp>
9#include <opm/grid/CpGrid.hpp>
17 static const int dimension = 3 ;
21 const int cartesianSize_;
23 int computeCartesianSize()
const
26 for(
int d=1; d<dimension; ++d )
34 cartesianSize_( computeCartesianSize() )
44 return grid_.currentData().front()->logicalCartesianSize();
49 return cartesianSize_;
54 return grid_.globalCell().size();
59 assert( compressedElementIndex >= 0 && compressedElementIndex <
compressedSize() );
60 return grid_.globalCell()[ compressedElementIndex ];
63 void cartesianCoordinate(
const int compressedElementIndex, std::array<int,dimension>& coords)
const
65 grid_.getIJK( compressedElementIndex, coords );
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
CartesianIndexMapper(const Grid &)
constructor taking grid
Definition CartesianIndexMapper.hpp:22
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:203
The namespace Dune is the main namespace for all Dune code.
Definition CartesianIndexMapper.hpp:10