OpenLB 1.7
|
A regular single 2D cuboid is the basic component of a 2D cuboid structure which defines the grid. More...
#include <cuboid2D.h>
Public Member Functions | |
Cuboid2D (T globPosX, T globPosY, T delta, int nX, int nY) | |
Construction of a cuboid. | |
Cuboid2D (Vector< T, 2 > origin, T delta, Vector< int, 2 > extend) | |
Construction of a cuboid vector version. | |
Cuboid2D (Cuboid2D< T > const &rhs, int overlap=0) | |
Copy constructor. | |
Cuboid2D & | operator= (Cuboid2D const &rhs) |
Copy assignment. | |
void | init (T globPosX, T globPosY, T delta, int nX, int nY) |
Initializes the cuboid. | |
T | get_globPosX () const |
Read access to left lower corner coordinates. | |
T | get_globPosY () const |
Vector< T, 2 > const | getOrigin () const |
Read only access to left lower corner coordinates. | |
T | getDeltaR () const |
Read access to the distance of cuboid nodes. | |
int | getNx () const |
Read access to cuboid width. | |
int | getNy () const |
Read access to cuboid height. | |
Vector< int, 2 > const | getExtent () const |
Read only access to the number of voxels in every dimension. | |
T | getPhysVolume () const |
Returns the volume of the cuboid. | |
size_t | getLatticeVolume () const |
Returns the number of Nodes in the volume. | |
T | getPhysPerimeter () const |
Returns the perimeter of the cuboid. | |
int | getLatticePerimeter () const |
Returns the number of Nodes at the perimeter. | |
void | print () const |
Prints cuboid details. | |
void | getPhysR (T physR[2], const int latticeR[2]) const |
void | getPhysR (T physR[2], const int &iX, const int &iY) const |
void | getPhysR (T physR[3], LatticeR< 2 > latticeR) const |
void | getLatticeR (int latticeR[2], const T physR[2]) const |
void | getLatticeR (int latticeR[2], const Vector< T, 2 > &physR) const |
void | getFloorLatticeR (const std::vector< T > &physR, std::vector< int > &latticeR) const |
void | getFloorLatticeR (int latticeR[2], const T physR[2]) const |
size_t | getWeight () const |
Returns the number of full cells. | |
void | setWeight (size_t fullCells) |
Sets the number of full cells. | |
bool | checkPoint (T globX, T globY, int overlap=0) const |
Checks whether a point (globX/globY) is contained in the cuboid extended with an layer of size overlap*delta. | |
bool | checkPoint (Vector< T, 2 > &globXY, int overlap=0) const |
bool | checkPoint (T globX, T globY, int &locX, int &locY, int overlap=0) const |
Checks whether a point (globX/gloxY) is contained and is a node in the cuboid extended with an layer of size overlap*delta and returns the local active node. | |
bool | checkInters (T globX0, T globX1, T globY0, T globY1, int overlap=0) const |
Checks whether there is an intersection with the cuboid extended with an layer of size overlap*delta. | |
bool | checkInters (T globX, T globY, int overlap=0) const |
Checks whether a given point intersects the cuboid extended by a layer of size overlap*delta. | |
bool | checkInters (T globX0, T globX1, T globY0, T globY1, int &locX0, int &locX1, int &locY0, int &locY1, int overlap=0) const |
Checks whether there is an intersection and returns the local active node range which can be empty by means of locX0=1, locX1=0, locY0=1, locY1=0 of the cuboid extended with an layer of size overlap*delta. | |
void | divide (int p, int q, std::vector< Cuboid2D< T > > &childrenC) const |
Divides the cuboid in p*q cuboids and adds them to the given vector. | |
void | divide (int p, std::vector< Cuboid2D< T > > &childrenC) const |
Divides the cuboid in p cuboids and add them to the given vector. | |
void | resize (int X, int Y, int nX, int nY) |
resize the cuboid to the passed size | |
A regular single 2D cuboid is the basic component of a 2D cuboid structure which defines the grid.
A cuboid is given with its left lower corner, the number of nodes in the direction x and y and the distance between two nodes. Among other useful methods, a cuboid can divide itself in a given number of disjoint subcuboids. The number of nodes at the boundary is minimized.
This class is not intended to be derived from.
Definition at line 54 of file cuboid2D.h.
olb::Cuboid2D< T >::Cuboid2D | ( | T | globPosX, |
T | globPosY, | ||
T | delta, | ||
int | nX, | ||
int | nY ) |
Construction of a cuboid.
Definition at line 45 of file cuboid2D.hh.
References olb::Cuboid2D< T >::init().
olb::Cuboid2D< T >::Cuboid2D | ( | Vector< T, 2 > | origin, |
T | delta, | ||
Vector< int, 2 > | extend ) |
Construction of a cuboid vector version.
Definition at line 52 of file cuboid2D.hh.
References olb::Cuboid2D< T >::init().
olb::Cuboid2D< T >::Cuboid2D | ( | Cuboid2D< T > const & | rhs, |
int | overlap = 0 ) |
Copy constructor.
Definition at line 60 of file cuboid2D.hh.
References olb::Cuboid2D< T >::init().
bool olb::Cuboid2D< T >::checkInters | ( | T | globX, |
T | globY, | ||
int | overlap = 0 ) const |
Checks whether a given point intersects the cuboid extended by a layer of size overlap*delta.
Definition at line 256 of file cuboid2D.hh.
bool olb::Cuboid2D< T >::checkInters | ( | T | globX0, |
T | globX1, | ||
T | globY0, | ||
T | globY1, | ||
int & | locX0, | ||
int & | locX1, | ||
int & | locY0, | ||
int & | locY1, | ||
int | overlap = 0 ) const |
Checks whether there is an intersection and returns the local active node range which can be empty by means of locX0=1, locX1=0, locY0=1, locY1=0 of the cuboid extended with an layer of size overlap*delta.
Definition at line 262 of file cuboid2D.hh.
References olb::Cuboid2D< T >::checkInters().
bool olb::Cuboid2D< T >::checkInters | ( | T | globX0, |
T | globX1, | ||
T | globY0, | ||
T | globY1, | ||
int | overlap = 0 ) const |
Checks whether there is an intersection with the cuboid extended with an layer of size overlap*delta.
Definition at line 241 of file cuboid2D.hh.
References olb::util::max(), and olb::util::min().
bool olb::Cuboid2D< T >::checkPoint | ( | T | globX, |
T | globY, | ||
int & | locX, | ||
int & | locY, | ||
int | overlap = 0 ) const |
Checks whether a point (globX/gloxY) is contained and is a node in the cuboid extended with an layer of size overlap*delta and returns the local active node.
Definition at line 224 of file cuboid2D.hh.
References olb::Cuboid2D< T >::checkPoint(), and olb::util::floor().
bool olb::Cuboid2D< T >::checkPoint | ( | T | globX, |
T | globY, | ||
int | overlap = 0 ) const |
Checks whether a point (globX/globY) is contained in the cuboid extended with an layer of size overlap*delta.
Definition at line 203 of file cuboid2D.hh.
bool olb::Cuboid2D< T >::checkPoint | ( | Vector< T, 2 > & | globXY, |
int | overlap = 0 ) const |
Definition at line 218 of file cuboid2D.hh.
void olb::Cuboid2D< T >::divide | ( | int | p, |
int | q, | ||
std::vector< Cuboid2D< T > > & | childrenC ) const |
Divides the cuboid in p*q cuboids and adds them to the given vector.
Definition at line 298 of file cuboid2D.hh.
void olb::Cuboid2D< T >::divide | ( | int | p, |
std::vector< Cuboid2D< T > > & | childrenC ) const |
Divides the cuboid in p cuboids and add them to the given vector.
Definition at line 321 of file cuboid2D.hh.
References olb::Cuboid2D< T >::divide(), olb::util::fabs(), and OLB_PRECONDITION.
T olb::Cuboid2D< T >::get_globPosX | ( | ) | const |
Read access to left lower corner coordinates.
Definition at line 88 of file cuboid2D.hh.
T olb::Cuboid2D< T >::get_globPosY | ( | ) | const |
Definition at line 94 of file cuboid2D.hh.
T olb::Cuboid2D< T >::getDeltaR | ( | ) | const |
Read access to the distance of cuboid nodes.
Definition at line 106 of file cuboid2D.hh.
Vector< int, 2 > const olb::Cuboid2D< T >::getExtent | ( | ) | const |
Read only access to the number of voxels in every dimension.
Definition at line 124 of file cuboid2D.hh.
|
inline |
Definition at line 111 of file cuboid2D.h.
References olb::Cuboid2D< T >::getFloorLatticeR().
|
inline |
Definition at line 116 of file cuboid2D.h.
References olb::util::floor().
int olb::Cuboid2D< T >::getLatticePerimeter | ( | ) | const |
Returns the number of Nodes at the perimeter.
Definition at line 148 of file cuboid2D.hh.
void olb::Cuboid2D< T >::getLatticeR | ( | int | latticeR[2], |
const T | physR[2] ) const |
Definition at line 189 of file cuboid2D.hh.
References olb::util::floor().
void olb::Cuboid2D< T >::getLatticeR | ( | int | latticeR[2], |
const Vector< T, 2 > & | physR ) const |
Definition at line 196 of file cuboid2D.hh.
References olb::util::floor().
size_t olb::Cuboid2D< T >::getLatticeVolume | ( | ) | const |
Returns the number of Nodes in the volume.
Definition at line 136 of file cuboid2D.hh.
int olb::Cuboid2D< T >::getNx | ( | ) | const |
Read access to cuboid width.
Definition at line 112 of file cuboid2D.hh.
int olb::Cuboid2D< T >::getNy | ( | ) | const |
Read access to cuboid height.
Definition at line 118 of file cuboid2D.hh.
Vector< T, 2 > const olb::Cuboid2D< T >::getOrigin | ( | ) | const |
Read only access to left lower corner coordinates.
Definition at line 100 of file cuboid2D.hh.
T olb::Cuboid2D< T >::getPhysPerimeter | ( | ) | const |
Returns the perimeter of the cuboid.
Definition at line 142 of file cuboid2D.hh.
void olb::Cuboid2D< T >::getPhysR | ( | T | physR[2], |
const int & | iX, | ||
const int & | iY ) const |
Definition at line 175 of file cuboid2D.hh.
void olb::Cuboid2D< T >::getPhysR | ( | T | physR[2], |
const int | latticeR[2] ) const |
Definition at line 168 of file cuboid2D.hh.
void olb::Cuboid2D< T >::getPhysR | ( | T | physR[3], |
LatticeR< 2 > | latticeR ) const |
T olb::Cuboid2D< T >::getPhysVolume | ( | ) | const |
Returns the volume of the cuboid.
Definition at line 130 of file cuboid2D.hh.
size_t olb::Cuboid2D< T >::getWeight | ( | ) | const |
Returns the number of full cells.
Definition at line 386 of file cuboid2D.hh.
void olb::Cuboid2D< T >::init | ( | T | globPosX, |
T | globPosY, | ||
T | delta, | ||
int | nX, | ||
int | nY ) |
Initializes the cuboid.
Definition at line 77 of file cuboid2D.hh.
Cuboid2D< T > & olb::Cuboid2D< T >::operator= | ( | Cuboid2D< T > const & | rhs | ) |
Copy assignment.
Definition at line 69 of file cuboid2D.hh.
void olb::Cuboid2D< T >::print | ( | ) | const |
Prints cuboid details.
Definition at line 154 of file cuboid2D.hh.
void olb::Cuboid2D< T >::resize | ( | int | X, |
int | Y, | ||
int | nX, | ||
int | nY ) |
resize the cuboid to the passed size
Definition at line 377 of file cuboid2D.hh.
void olb::Cuboid2D< T >::setWeight | ( | size_t | fullCells | ) |
Sets the number of full cells.
Definition at line 397 of file cuboid2D.hh.