44template<
typename T>
class IndicatorF3D;
61 T _globPosX, _globPosY, _globPosZ;
79 Cuboid3D(T globPosX, T globPosY, T globPosZ, T delta,
int nX,
int nY,
int nZ);
81 Cuboid3D(std::vector<T> origin, T delta, std::vector<int> extend);
90 void init(T globPosX, T globPosY, T globPosZ, T delta,
int nX,
int nY,
int nZ);
129 auto globR =
Vector<T,3>{_globPosX, _globPosY, _globPosZ};
130 auto physLatticeR = (physR - globR) / _delta;
131 if ( std::fabs(std::roundf(physLatticeR[0]) - physLatticeR[0]) <= eps
132 && std::fabs(std::roundf(physLatticeR[1]) - physLatticeR[1]) <= eps
133 && std::fabs(std::roundf(physLatticeR[2]) - physLatticeR[2]) <= eps) {
134 latticeR[0] = std::roundf(physLatticeR[0]);
135 latticeR[1] = std::roundf(physLatticeR[1]);
136 latticeR[2] = std::roundf(physLatticeR[2]);
151 bool*
getBlock(std::size_t iBlock, std::size_t& sizeBlock,
bool loadingMode)
override;
156 void getPhysR(T physR[3],
const int latticeR[3])
const;
157 void getPhysR(T physR[3],
const int& iX,
const int& iY,
const int& iZ)
const;
160 void getLatticeR(
int latticeR[3],
const T physR[3])
const;
163 void getFloorLatticeR(
const std::vector<T>& physR, std::vector<int>& latticeR)
const;
168 bool checkPoint(T globX, T globY, T globZ,
int overlap = 0)
const;
171 bool physCheckPoint(T globX, T globY, T globZ,
double overlap = 0)
const;
176 [[deprecated]]
bool checkPoint(T globX, T globY, T globZ,
int &locX,
int &locY,
int &locZ,
int overlap = 0)
const;
179 bool checkInters(T globX0, T globX1, T globY0, T globY1, T globZ0, T globZ1,
int overlap = 0)
const;
182 bool checkInters(T globX, T globY, T globZ,
int overlap = 0)
const;
187 bool checkInters(T globX0, T globX1, T globY0, T globY1, T globZ0, T globZ1,
188 int &locX0,
int &locX1,
int &locY0,
int &locY1,
int &locZ0,
int &locZ1,
189 int overlap = 0)
const;
201 void resize(
int X,
int Y,
int Z,
int nX,
int nY,
int nZ);
A regular single 3D cuboid is the basic component of a 3D cuboid structure which defines the grid.
void divideFractional(int iD, std::vector< T > fractions, std::vector< Cuboid3D< T > > &childrenC) const
Divides the cuboid into fractions along the iDth dimension.
std::size_t getWeightIn(IndicatorF3D< T > &indicator) const
Returns the number of full cells w.r.t. indicator.
size_t getLatticeVolume() const
Returns the number of Nodes in the volume.
std::size_t getNblock() const override
Number of data blocks for the serializable interface.
Cuboid3D & operator=(Cuboid3D const &rhs)
Copy assignment.
Vector< T, 3 > getOrigin() const
Read only access to left lower corner coordinates.
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.
Cuboid3D()
Construction of an empty cuboid at position 0, 0, 0 with delta 0 and nX = nY = nZ = 0.
int getWeightValue() const
Returns the actual value of weight (-1 for getLatticeVolume())
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.
T getDeltaR() const
Read only access to the distance of cuboid nodes.
bool physCheckPoint(T globX, T globY, T globZ, double overlap=0) const
Same for physical overlap.
bool * getBlock(std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override
static Cuboid3D< T > motherOf(Cuboid3D< T > a, Cuboid3D< T > b)
Return minimum bounding cuboid encompassing both a and b.
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 init(T globPosX, T globPosY, T globPosZ, T delta, int nX, int nY, int nZ)
Initializes the cuboid.
void getFloorLatticeR(const std::vector< T > &physR, std::vector< int > &latticeR) const
int getLatticePerimeter() const
Returns the number of Nodes at the perimeter.
int getNz() const
Read access to cuboid depth.
T getFraction() const
Returns fraction of full cells (weight / volume)
int getNy() const
Read access to cuboid height.
bool operator==(const Cuboid3D< T > &rhs) const
equal operator
void setWeight(size_t fullCells)
Sets the number of full cells.
T getPhysPerimeter() const
Returns the perimeter of the cuboid.
int getNx() const
Read access to cuboid width.
void print() const
Prints cuboid details.
bool getLatticeR(Vector< T, 3 > physR, Vector< int, 3 > &latticeR, T eps=1e-5)
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 ...
void getPhysR(T physR[3], const int latticeR[3]) const
std::size_t getSerializableSize() const override
Binary size for the serializer interface.
std::size_t getWeight() const
Returns the number of full cells.
void refine(int factor)
Refines by splitting each cell into factor^3 cells.
void resize(int X, int Y, int Z, int nX, int nY, int nZ)
resize the cuboid to the passed size
IndicatorF3D is an application from .
class for marking output with some text
Base class for serializable objects of constant size. For dynamic size use BufferSerializable.
This file contains indicator functions.
Top level namespace for all of OpenLB.