Loading...
Searching...
No Matches
CartesianIndexMapper.hpp
#ifndef OPM_CARTESIANINDEXMAPPER_HEADER
#define OPM_CARTESIANINDEXMAPPER_HEADER
#include <array>
#include <cassert>
#include <dune/common/exceptions.hh>
namespace Dune
{
template< class Grid >
class CartesianIndexMapper
{
public:
static const int dimension = Grid :: dimension ;
explicit CartesianIndexMapper( const Grid& )
{
DUNE_THROW(InvalidStateException,"CartesianIndexMapper not specialized for given grid");
}
const std::array<int, dimension>& cartesianDimensions() const
{
static std::array<int, dimension> a;
return a;
}
int cartesianSize() const
{
return 0;
}
int compressedSize() const
{
return 0;
}
int cartesianIndex( const int /* compressedElementIndex */) const
{
return 0;
}
void cartesianCoordinate(const int /* compressedElementIndex */, std::array<int,dimension>& /* coords */) const
{
}
};
} // end namespace Opm
#endif
Dune::CartesianIndexMapper::cartesianIndex
int cartesianIndex(const int) const
return index of the cells in the logical Cartesian grid
Definition CartesianIndexMapper.hpp:47
Dune::CartesianIndexMapper::compressedSize
int compressedSize() const
return number of cells in the active grid
Definition CartesianIndexMapper.hpp:41
Dune::CartesianIndexMapper::cartesianDimensions
const std::array< int, dimension > & cartesianDimensions() const
return Cartesian dimensions, i.e.
Definition CartesianIndexMapper.hpp:28
Dune::CartesianIndexMapper::dimension
static const int dimension
dimension of the grid
Definition CartesianIndexMapper.hpp:19
Dune::CartesianIndexMapper::CartesianIndexMapper
CartesianIndexMapper(const Grid &)
constructor taking grid
Definition CartesianIndexMapper.hpp:22
Dune::CartesianIndexMapper::cartesianSize
int cartesianSize() const
return total number of cells in the logical Cartesian grid
Definition CartesianIndexMapper.hpp:35
Dune::CartesianIndexMapper::cartesianCoordinate
void cartesianCoordinate(const int, std::array< int, dimension > &) const
return Cartesian coordinate, i.e.
Definition CartesianIndexMapper.hpp:53
Dune
The namespace Dune is the main namespace for all Dune code.
Definition CartesianIndexMapper.hpp:10