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");