27#ifndef BLOCK_STRUCTURE_2D_H
28#define BLOCK_STRUCTURE_2D_H
56 _nx(nx+2*overlap),
_ny(ny+2*overlap) { };
74 return static_cast<std::size_t
>(
getNx())
75 *
static_cast<std::size_t
>(
getNy());
83 if(!(iX >= 0 && iX < this->
_nx && iY >= 0 && iY < this->
_ny)){
84 throw std::runtime_error{
"Bad access at: " + std::to_string(iX) +
" " + std::to_string(iY) +
" " + std::to_string(foo_x) +
" " + std::to_string(foo_y) +
" "+ std::to_string(
_nx) +
" " + std::to_string(
_ny)};
108 return 0 <= iX && iX <
getNx() &&
109 0 <= iY && iY <
getNy();
bool isInside(int iX, int iY) const
Return whether location is valid.
int getNx() const
Read only access to block width.
BlockStructure2D(int nx, int ny, int overlap)
BlockStructure2D(int nx, int ny)
std::ptrdiff_t getNeighborDistance(Vector< int, 2 > c) const
Get 1D neighbor distance.
std::size_t getCellId(int iX, int iY) const
Get 1D cell ID.
std::size_t getNcells() const
Get number of cells.
int getNy() const
Read only access to block height.
std::ptrdiff_t getNeighborDistance(int iX, int iY) const
Get 1D neighbor distance.
Top level namespace for all of OpenLB.
#define OLB_PRECONDITION(COND)
efficient implementation of a vector class