34 #ifndef OPM_POLYHEDRALGRIDLEVELCARTESIANINDEXMAPPER_HH 35 #define OPM_POLYHEDRALGRIDLEVELCARTESIANINDEXMAPPER_HH 37 #include <opm/grid/common/LevelCartesianIndexMapper.hpp> 38 #include <opm/grid/polyhedralgrid.hh> 43 template<
int dim,
int dimworld,
typename coord_t>
59 template<
int dim,
int dimworld,
typename coord_t>
64 static constexpr
int dimension = 3 ;
67 : cartesianIndexMapper_{std::make_unique<Dune::CartesianIndexMapper<Grid>>(cartesian_index_mapper)}
70 const std::array<int,3>& cartesianDimensions(
int level)
const 72 throwIfLevelPositive(level);
73 return cartesianIndexMapper_->logicalCartesianSize();
76 int cartesianSize(
int level)
const 78 throwIfLevelPositive(level);
79 return cartesianIndexMapper_->cartesianSize();
82 int compressedSize(
int level)
const 84 throwIfLevelPositive(level);
85 return cartesianIndexMapper_->compressedSize();
88 int cartesianIndex(
const int compressedElementIndex,
const int level)
const 90 throwIfLevelPositive(level);
91 return cartesianIndexMapper_->cartesianIndex(compressedElementIndex);
94 void cartesianCoordinate(
const int compressedElementIndex, std::array<int,dimension>& coords,
int level)
const 96 throwIfLevelPositive(level);
97 cartesianIndexMapper_->cartesianCoordinate(compressedElementIndex, coords);
101 std::unique_ptr<Dune::CartesianIndexMapper<Grid>> cartesianIndexMapper_;
103 void throwIfLevelPositive(
int level)
const 106 throw std::invalid_argument(
"Invalid level.\n");
Definition: LevelCartesianIndexMapper.hpp:44
The namespace Dune is the main namespace for all Dune code.
Definition: CartesianIndexMapper.hpp:9
Holds the implementation of the CpGrid as a pimple.
Definition: CellQuadrature.cpp:71
identical grid wrapper
Definition: declaration.hh:10
Interface class to access the logical Cartesian grid as used in industry standard simulator decks...
Definition: CartesianIndexMapper.hpp:15