![]() |
DUNE: Uniform Navigational Environment
2022.04.0
|
Converts between grid indices, coordinate points and row-major ordering.
dim | number of dimensions. |
Public Member Functions | |
Grid (std::vector< double > const &min, std::vector< double > const &max, std::vector< size_t > const &dimensions) | |
size_t | getOffset (std::array< size_t, dim > const &indices) const |
std::array< size_t, dim > | getIndices (size_t offset) const |
std::array< size_t, dim > | getCorner (std::array< double, dim > const &coordinates) const |
std::array< double, dim > | getCoordinates (std::array< size_t, dim > const &indices) const |
std::array< double, dim > | getCoordinates (size_t offset) const |
size_t | getDimensions (size_t dimension) const |
size_t | size () const |
double | getUpper (size_t dimension) const |
double | getLower (size_t dimension) const |
double | getSpacing (size_t dimension) const |
DUNE::Math::Grid< dim >::Grid | ( | std::vector< double > const & | min, |
std::vector< double > const & | max, | ||
std::vector< size_t > const & | dimensions | ||
) |
Constructor.
[in] | min | the lower limits of the grid in each dimension. |
[in] | max | the upper limits of the grid in each dimension. |
[in] | dimensions | the number of points in each dimension. |
std::array< double, dim > DUNE::Math::Grid< dim >::getCoordinates | ( | std::array< size_t, dim > const & | indices | ) | const |
Get the coordinates of a gridpoint given by an array of indices.
[in] | indices | indices of a gridpoint. |
Referenced by DUNE::Math::Grid< 3 >::getCoordinates(), and Simulators::StreamVelocity::StreamGenerator::Gridded2DModelDataStreamGenerator::getVelocity().
std::array< double, dim > DUNE::Math::Grid< dim >::getCoordinates | ( | size_t | offset | ) | const |
Get the coordinates of a gridpoint given by a row-major offset.
[in] | offset | the row-major offset of the gridpoint. |
std::array< size_t, dim > DUNE::Math::Grid< dim >::getCorner | ( | std::array< double, dim > const & | coordinates | ) | const |
Get the indices of the "lower corner" of the grid cell where a point lies.
[in] | coordinates | coordinates of a point in dim-dimensional space. |
Referenced by Simulators::StreamVelocity::StreamGenerator::Gridded2DModelDataStreamGenerator::getVelocity().
|
inline |
Get the number of points in the grid along a dimension.
[in] | dimension | index of the dimension to query. |
Referenced by Simulators::StreamVelocity::StreamGenerator::Gridded2DModelDataStreamGenerator::getVelocity(), and Simulators::StreamVelocity::StreamGenerator::Gridded2DModelDataStreamGenerator::Gridded2DModelDataStreamGenerator().
std::array< size_t, dim > DUNE::Math::Grid< dim >::getIndices | ( | size_t | offset | ) | const |
Convert a row-major ordered offset to an array of grid indices.
[in] | offset | the row-major offset of the gridpoint. |
Referenced by DUNE::Math::Grid< 3 >::getCoordinates().
|
inline |
Get the loer limit of the grid along a dimension.
[in] | dimension | index of the dimension to query. |
Referenced by Simulators::StreamVelocity::StreamGenerator::Gridded2DModelDataStreamGenerator::getVelocity().
size_t DUNE::Math::Grid< dim >::getOffset | ( | std::array< size_t, dim > const & | indices | ) | const |
Convert an array of grid indices to a row-major ordered offset.
[in] | indices | the indices of the grid point. |
Referenced by Simulators::StreamVelocity::StreamGenerator::Gridded2DModelDataStreamGenerator::getVelocity().
|
inline |
Get the grid spacing along a dimension.
[in] | dimension | index of the dimension to query. |
Referenced by Simulators::StreamVelocity::StreamGenerator::Gridded2DModelDataStreamGenerator::getVelocity().
|
inline |
Get the upper limit of the grid along a dimension.
[in] | dimension | index of the dimension to query. |
|
inline |