OpenLB 1.7
|
A regular single 3D cuboid is the basic component of a 3D cuboid structure which defines the grid. More...
#include <cuboid3D.h>
Public Member Functions | |
Cuboid3D () | |
Construction of an empty cuboid at position 0, 0, 0 with delta 0 and nX = nY = nZ = 0. | |
Cuboid3D (T globPosX, T globPosY, T globPosZ, T delta, int nX, int nY, int nZ) | |
Construction of a cuboid. | |
Cuboid3D (std::vector< T > origin, T delta, std::vector< int > extend) | |
Construction of a cuboid vector version. | |
Cuboid3D (Vector< T, 3 > origin, T delta, Vector< int, 3 > extend) | |
Cuboid3D (IndicatorF3D< T > &indicatorF, T voxelSize) | |
Construction of a cuboid using indicator. | |
Cuboid3D (Cuboid3D< T > const &rhs, int overlap=0) | |
Copy constructor. | |
Cuboid3D & | operator= (Cuboid3D const &rhs) |
Copy assignment. | |
void | init (T globPosX, T globPosY, T globPosZ, T delta, int nX, int nY, int nZ) |
Initializes the cuboid. | |
Vector< T, 3 > | getOrigin () const |
Read only access to left lower corner coordinates. | |
T | getDeltaR () const |
Read only access to the distance of cuboid nodes. | |
int | getNx () const |
Read access to cuboid width. | |
int | getNy () const |
Read access to cuboid height. | |
int | getNz () const |
Read access to cuboid depth. | |
Vector< int, 3 > const | getExtent () const |
Read only access to the number of voxels in every dimension. | |
T | getPhysVolume () const |
Returns the volume of the cuboid. | |
int | getWeightValue () const |
Returns the actual value of weight (-1 for getLatticeVolume()) | |
std::size_t | getWeight () const |
Returns the number of full cells. | |
std::size_t | getWeightIn (IndicatorF3D< T > &indicator) const |
Returns the number of full cells w.r.t. indicator. | |
void | setWeight (size_t fullCells) |
Sets the number of full cells. | |
T | getFraction () const |
Returns fraction of full cells (weight / volume) | |
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 | refine (int factor) |
Refines by splitting each cell into factor^3 cells. | |
bool | getLatticeR (Vector< T, 3 > physR, Vector< int, 3 > &latticeR, T eps=1e-5) |
bool | operator== (const Cuboid3D< T > &rhs) const |
equal operator | |
std::size_t | getNblock () const override |
Number of data blocks for the serializable interface. | |
std::size_t | getSerializableSize () const override |
Binary size for the serializer interface. | |
bool * | getBlock (std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override |
void | print () const |
Prints cuboid details. | |
void | getPhysR (T physR[3], const int latticeR[3]) const |
void | getPhysR (T physR[3], const int &iX, const int &iY, const int &iZ) const |
void | getPhysR (T physR[3], LatticeR< 3 > latticeR) const |
void | getLatticeR (int latticeR[3], const T physR[3]) const |
void | getLatticeR (int latticeR[3], const Vector< T, 3 > &physR) const |
void | getFloorLatticeR (const std::vector< T > &physR, std::vector< int > &latticeR) const |
void | getFloorLatticeR (int latticeR[3], const T physR[3]) const |
bool | checkPoint (T globX, T globY, T globZ, int overlap=0) const |
Checks whether a point (globX/gloxY/globZ) is contained in the cuboid extended with an layer of size overlap*delta. | |
bool | checkPoint (Vector< T, 3 > &globXYZ, int overlap=0) const |
bool | physCheckPoint (T globX, T globY, T globZ, double overlap=0) const |
Same for physical overlap. | |
bool | checkPoint (T globX, T globY, T globZ, int &locX, int &locY, int &locZ, int overlap=0) const |
Checks whether a point (globX/gloxY/globZ) 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, T globZ0, T globZ1, 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, T globZ, 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, T globZ0, T globZ1, int &locX0, int &locX1, int &locY0, int &locY1, int &locZ0, int &locZ1, 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, locZ0=1; locZ1=0 of the cuboid extended with an layer of size overlap*delta. | |
bool | checkInters (Cuboid3D< T > &child) const |
Returns true iff cuboid intersects child. | |
void | divide (int p, int q, int r, std::vector< Cuboid3D< T > > &childrenC) const |
Divides the cuboid in p*q*r cuboids of equal volume and add them to the given vector. | |
void | divide (int p, std::vector< Cuboid3D< T > > &childrenC) const |
Divides the cuboid in p cuboids of equal volume and add them to the given vector. | |
void | divideFractional (int iD, std::vector< T > fractions, std::vector< Cuboid3D< T > > &childrenC) const |
Divides the cuboid into fractions along the iDth dimension. | |
void | resize (int X, int Y, int Z, int nX, int nY, int nZ) |
resize the cuboid to the passed size | |
Public Member Functions inherited from olb::Serializable | |
virtual | ~Serializable ()=default |
template<bool includeLogOutputDir = true> | |
bool | save (std::string fileName="", const bool enforceUint=false) |
Save Serializable into file fileName | |
template<bool includeLogOutputDir = true> | |
bool | load (std::string fileName="", const bool enforceUint=false) |
Load Serializable from file fileName | |
bool | save (std::uint8_t *buffer) |
Save Serializable into buffer of length getSerializableSize | |
bool | load (const std::uint8_t *buffer) |
Load Serializable from buffer of length getSerializableSize | |
virtual void | postLoad () |
Static Public Member Functions | |
static Cuboid3D< T > | motherOf (Cuboid3D< T > a, Cuboid3D< T > b) |
Return minimum bounding cuboid encompassing both a and b. | |
Additional Inherited Members | |
Protected Member Functions inherited from olb::Serializable | |
template<typename DataType > | |
void | registerVar (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, const DataType &data, const size_t arrayLength=1) const |
Register primitive data types (int , double , ...) or arrays of those. | |
template<typename DataType > | |
void | registerSerializableOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType &data, const bool loadingMode=false) |
Register Serializable object of constant size. | |
template<typename DataType > | |
void | registerSerializablesOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType *data, const size_t arrayLength, const bool loadingMode=false) |
Register an array of Serializable objects of constant size. | |
A regular single 3D cuboid is the basic component of a 3D cuboid structure which defines the grid.
A cuboid is given with its left lower corner, the number of nodes in the direction x, y and z and the distance between two nodes. Among after 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 58 of file cuboid3D.h.
olb::Cuboid3D< T >::Cuboid3D | ( | ) |
Construction of an empty cuboid at position 0, 0, 0 with delta 0 and nX = nY = nZ = 0.
Definition at line 50 of file cuboid3D.hh.
olb::Cuboid3D< T >::Cuboid3D | ( | T | globPosX, |
T | globPosY, | ||
T | globPosZ, | ||
T | delta, | ||
int | nX, | ||
int | nY, | ||
int | nZ ) |
Construction of a cuboid.
Definition at line 55 of file cuboid3D.hh.
References olb::Cuboid3D< T >::init().
olb::Cuboid3D< T >::Cuboid3D | ( | std::vector< T > | origin, |
T | delta, | ||
std::vector< int > | extend ) |
Construction of a cuboid vector version.
Definition at line 63 of file cuboid3D.hh.
References olb::Cuboid3D< T >::init().
olb::Cuboid3D< T >::Cuboid3D | ( | Vector< T, 3 > | origin, |
T | delta, | ||
Vector< int, 3 > | extend ) |
Definition at line 71 of file cuboid3D.hh.
References olb::Cuboid3D< T >::init().
olb::Cuboid3D< T >::Cuboid3D | ( | IndicatorF3D< T > & | indicatorF, |
T | voxelSize ) |
Construction of a cuboid using indicator.
Definition at line 79 of file cuboid3D.hh.
olb::Cuboid3D< T >::Cuboid3D | ( | Cuboid3D< T > const & | rhs, |
int | overlap = 0 ) |
Copy constructor.
Definition at line 91 of file cuboid3D.hh.
bool olb::Cuboid3D< T >::checkInters | ( | Cuboid3D< T > & | child | ) | const |
Returns true iff cuboid intersects child.
Definition at line 431 of file cuboid3D.hh.
References olb::Cuboid3D< T >::getDeltaR(), olb::Cuboid3D< T >::getExtent(), and olb::Cuboid3D< T >::getOrigin().
bool olb::Cuboid3D< T >::checkInters | ( | T | globX, |
T | globY, | ||
T | globZ, | ||
int | overlap = 0 ) const |
Checks whether a given point intersects the cuboid extended by a layer of size overlap*delta.
Definition at line 425 of file cuboid3D.hh.
bool olb::Cuboid3D< T >::checkInters | ( | T | globX0, |
T | globX1, | ||
T | globY0, | ||
T | globY1, | ||
T | globZ0, | ||
T | globZ1, | ||
int & | locX0, | ||
int & | locX1, | ||
int & | locY0, | ||
int & | locY1, | ||
int & | locZ0, | ||
int & | locZ1, | ||
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, locZ0=1; locZ1=0 of the cuboid extended with an layer of size overlap*delta.
Definition at line 440 of file cuboid3D.hh.
References olb::Cuboid3D< T >::checkInters().
bool olb::Cuboid3D< T >::checkInters | ( | T | globX0, |
T | globX1, | ||
T | globY0, | ||
T | globY1, | ||
T | globZ0, | ||
T | globZ1, | ||
int | overlap = 0 ) const |
Checks whether there is an intersection with the cuboid extended with an layer of size overlap*delta.
Definition at line 409 of file cuboid3D.hh.
References olb::util::max(), and olb::util::min().
bool olb::Cuboid3D< T >::checkPoint | ( | T | globX, |
T | globY, | ||
T | globZ, | ||
int & | locX, | ||
int & | locY, | ||
int & | locZ, | ||
int | overlap = 0 ) const |
Checks whether a point (globX/gloxY/globZ) 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 389 of file cuboid3D.hh.
References olb::Cuboid3D< T >::checkPoint(), and olb::util::floor().
bool olb::Cuboid3D< T >::checkPoint | ( | T | globX, |
T | globY, | ||
T | globZ, | ||
int | overlap = 0 ) const |
Checks whether a point (globX/gloxY/globZ) is contained in the cuboid extended with an layer of size overlap*delta.
Definition at line 361 of file cuboid3D.hh.
bool olb::Cuboid3D< T >::checkPoint | ( | Vector< T, 3 > & | globXYZ, |
int | overlap = 0 ) const |
Definition at line 372 of file cuboid3D.hh.
void olb::Cuboid3D< T >::divide | ( | int | p, |
int | q, | ||
int | r, | ||
std::vector< Cuboid3D< T > > & | childrenC ) const |
Divides the cuboid in p*q*r cuboids of equal volume and add them to the given vector.
Definition at line 488 of file cuboid3D.hh.
void olb::Cuboid3D< T >::divide | ( | int | p, |
std::vector< Cuboid3D< T > > & | childrenC ) const |
Divides the cuboid in p cuboids of equal volume and add them to the given vector.
Definition at line 561 of file cuboid3D.hh.
References olb::CuboidGeometry2D< T >::get(), olb::CuboidGeometry2D< T >::getNc(), and OLB_PRECONDITION.
void olb::Cuboid3D< T >::divideFractional | ( | int | iD, |
std::vector< T > | fractions, | ||
std::vector< Cuboid3D< T > > & | childrenC ) const |
Divides the cuboid into fractions along the iDth dimension.
Definition at line 530 of file cuboid3D.hh.
References olb::Cuboid3D< T >::print().
|
overridevirtual |
Implements olb::Serializable.
Definition at line 266 of file cuboid3D.hh.
T olb::Cuboid3D< T >::getDeltaR | ( | ) | const |
Read only access to the distance of cuboid nodes.
Definition at line 141 of file cuboid3D.hh.
Vector< int, 3 > const olb::Cuboid3D< T >::getExtent | ( | ) | const |
Read only access to the number of voxels in every dimension.
Definition at line 165 of file cuboid3D.hh.
void olb::Cuboid3D< T >::getFloorLatticeR | ( | const std::vector< T > & | physR, |
std::vector< int > & | latticeR ) const |
Definition at line 347 of file cuboid3D.hh.
void olb::Cuboid3D< T >::getFloorLatticeR | ( | int | latticeR[3], |
const T | physR[3] ) const |
Definition at line 353 of file cuboid3D.hh.
References olb::util::floor().
|
inline |
Returns fraction of full cells (weight / volume)
Definition at line 115 of file cuboid3D.h.
References olb::Cuboid3D< T >::getLatticeVolume(), and olb::Cuboid3D< T >::getWeight().
int olb::Cuboid3D< T >::getLatticePerimeter | ( | ) | const |
Returns the number of Nodes at the perimeter.
Definition at line 233 of file cuboid3D.hh.
void olb::Cuboid3D< T >::getLatticeR | ( | int | latticeR[3], |
const T | physR[3] ) const |
Definition at line 331 of file cuboid3D.hh.
References olb::util::floor().
void olb::Cuboid3D< T >::getLatticeR | ( | int | latticeR[3], |
const Vector< T, 3 > & | physR ) const |
Definition at line 339 of file cuboid3D.hh.
References olb::util::floor().
|
inline |
Definition at line 128 of file cuboid3D.h.
size_t olb::Cuboid3D< T >::getLatticeVolume | ( | ) | const |
Returns the number of Nodes in the volume.
Definition at line 221 of file cuboid3D.hh.
|
overridevirtual |
Number of data blocks for the serializable interface.
Implements olb::Serializable.
Definition at line 123 of file cuboid3D.hh.
int olb::Cuboid3D< T >::getNx | ( | ) | const |
Read access to cuboid width.
Definition at line 147 of file cuboid3D.hh.
int olb::Cuboid3D< T >::getNy | ( | ) | const |
Read access to cuboid height.
Definition at line 153 of file cuboid3D.hh.
int olb::Cuboid3D< T >::getNz | ( | ) | const |
Read access to cuboid depth.
Definition at line 159 of file cuboid3D.hh.
Vector< T, 3 > olb::Cuboid3D< T >::getOrigin | ( | ) | const |
Read only access to left lower corner coordinates.
Definition at line 135 of file cuboid3D.hh.
T olb::Cuboid3D< T >::getPhysPerimeter | ( | ) | const |
Returns the perimeter of the cuboid.
Definition at line 227 of file cuboid3D.hh.
void olb::Cuboid3D< T >::getPhysR | ( | T | physR[3], |
const int & | iX, | ||
const int & | iY, | ||
const int & | iZ ) const |
Definition at line 323 of file cuboid3D.hh.
void olb::Cuboid3D< T >::getPhysR | ( | T | physR[3], |
const int | latticeR[3] ) const |
Definition at line 307 of file cuboid3D.hh.
void olb::Cuboid3D< T >::getPhysR | ( | T | physR[3], |
LatticeR< 3 > | latticeR ) const |
Definition at line 315 of file cuboid3D.hh.
T olb::Cuboid3D< T >::getPhysVolume | ( | ) | const |
Returns the volume of the cuboid.
Definition at line 171 of file cuboid3D.hh.
|
overridevirtual |
Binary size for the serializer interface.
Implements olb::Serializable.
Definition at line 129 of file cuboid3D.hh.
size_t olb::Cuboid3D< T >::getWeight | ( | ) | const |
Returns the number of full cells.
Definition at line 183 of file cuboid3D.hh.
std::size_t olb::Cuboid3D< T >::getWeightIn | ( | IndicatorF3D< T > & | indicator | ) | const |
Returns the number of full cells w.r.t. indicator.
Definition at line 194 of file cuboid3D.hh.
int olb::Cuboid3D< T >::getWeightValue | ( | ) | const |
Returns the actual value of weight (-1 for getLatticeVolume())
Definition at line 177 of file cuboid3D.hh.
void olb::Cuboid3D< T >::init | ( | T | globPosX, |
T | globPosY, | ||
T | globPosZ, | ||
T | delta, | ||
int | nX, | ||
int | nY, | ||
int | nZ ) |
Initializes the cuboid.
Definition at line 111 of file cuboid3D.hh.
|
static |
Return minimum bounding cuboid encompassing both a and b.
Cuboid3D< T > & olb::Cuboid3D< T >::operator= | ( | Cuboid3D< T > const & | rhs | ) |
Copy assignment.
Definition at line 102 of file cuboid3D.hh.
bool olb::Cuboid3D< T >::operator== | ( | const Cuboid3D< T > & | rhs | ) | const |
equal operator
Definition at line 252 of file cuboid3D.hh.
bool olb::Cuboid3D< T >::physCheckPoint | ( | T | globX, |
T | globY, | ||
T | globZ, | ||
double | overlap = 0 ) const |
Same for physical overlap.
Definition at line 378 of file cuboid3D.hh.
void olb::Cuboid3D< T >::print | ( | ) | const |
Prints cuboid details.
Definition at line 284 of file cuboid3D.hh.
void olb::Cuboid3D< T >::refine | ( | int | factor | ) |
Refines by splitting each cell into factor^3 cells.
Definition at line 239 of file cuboid3D.hh.
void olb::Cuboid3D< T >::resize | ( | int | X, |
int | Y, | ||
int | Z, | ||
int | nX, | ||
int | nY, | ||
int | nZ ) |
resize the cuboid to the passed size
Definition at line 518 of file cuboid3D.hh.
void olb::Cuboid3D< T >::setWeight | ( | size_t | fullCells | ) |
Sets the number of full cells.
Definition at line 215 of file cuboid3D.hh.