1#ifndef OPM_POLYHEDRALCARTESIANINDEXMAPPER_HEADER
2#define OPM_POLYHEDRALCARTESIANINDEXMAPPER_HEADER
4#include <opm/grid/common/CartesianIndexMapper.hpp>
5#include <opm/grid/polyhedralgrid.hh>
9 template<
int dim,
int dimworld,
typename coord_t >
15 const int cartesianSize_;
17 int computeCartesianSize()
const
20 for(
int d=1; d<dim; ++d )
25 static const int dimension = Grid :: dimension ;
29 cartesianSize_( computeCartesianSize() )
34 return grid_.logicalCartesianSize();
39 return cartesianSize_;
44 return grid_.
size( 0 );
50 return grid_.
size( 0 );
55 assert( compressedElementIndex >= 0 && compressedElementIndex <
compressedSize() );
56 return grid_.globalCell()[ compressedElementIndex ];
59 void cartesianCoordinate(
const int compressedElementIndex, std::array<int,dimension>& coords)
const
77 void cartesianCoordinateLevel(
const int compressedElementIndexOnLevel, std::array<int,dimension>& coordsOnLevel,
int level)
const
80 throw std::invalid_argument(
"Invalid level.\n");
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:53
int compressedLevelZeroSize() const
return number of cells in the active level zero 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
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:59
void cartesianCoordinateLevel(const int, std::array< int, dimension > &, int) const
return Cartesian coordinate, i.e.
Definition CartesianIndexMapper.hpp:64
identical grid wrapper
Definition idset.hh:10
int size(int, int codim) const
obtain number of entites on a level
Definition grid.hh:427
Copyright 2019 Equinor AS.
Definition CartesianIndexMapper.hpp:10