28#ifndef BLOCK_GEOMETRY_STATISTICS_3D_H
29#define BLOCK_GEOMETRY_STATISTICS_3D_H
49template<
typename T,
unsigned D>
58 bool _statisticsUpdateNeeded{};
60 int _nX{}, _nY{}, _nZ{};
67 std::map<int, std::size_t> _material2n{};
69 std::map<int, std::vector<int> > _material2min{};
71 std::map<int, std::vector<int> > _material2max{};
91 void update(
bool verbose=
false);
98 std::size_t
getNvoxel(
int material)
const;
130 std::vector<int>
getType(
int iX,
int iY,
int iZ,
bool anyNormal =
false);
131 std::vector<int>
getType(
const int* input,
bool anyNormal =
false)
const;
132 std::vector<int>
getType(
int iX,
int iY,
int iZ,
bool anyNormal =
false)
const;
136 std::vector<int>
computeNormal(
int iX,
int iY,
int iZ)
const;
146 bool check(
int material,
int iX,
int iY,
int iZ,
unsigned offsetX,
unsigned offsetY,
unsigned offsetZ);
147 bool check(
int material,
int iX,
int iY,
int iZ,
unsigned offsetX,
unsigned offsetY,
unsigned offsetZ)
const;
149 bool find(
int material,
unsigned offsetX,
unsigned offsetY,
unsigned offsetZ,
int& iX,
int& iY,
int& iZ);
150 bool find(
int material,
unsigned offsetX,
unsigned offsetY,
unsigned offsetZ,
int& iX,
int& iY,
int& iZ)
const;
159 void takeStatistics(
int iX,
int iY,
int iZ);
161 std::vector<int> checkExtraBoundary(std::vector<int> discreteNormal,
162 std::vector<int> discreteNormal2);
163 std::vector<int> checkExtraBoundary(std::vector<int> discreteNormal,
164 std::vector<int> discreteNormal2)
const;
std::vector< int > computeNormal(int iX, int iY, int iZ)
Returns normal that points into the fluid for paraxial surfaces.
std::vector< T > getCenterPhysR(int material)
Returns the center position.
std::vector< int > getMaxLatticeR(int material)
Returns the max. lattice position in each direction.
int getNmaterials()
Returns the number of different materials.
BlockGeometryStatistics3D(BlockGeometry< T, 3 > *blockGeometry)
Constructor.
std::vector< T > getMinPhysR(int material) const
Returns the min. phys position in each direction.
std::vector< int > getType(int iX, int iY, int iZ, bool anyNormal=false)
bool find(int material, unsigned offsetX, unsigned offsetY, unsigned offsetZ, int &iX, int &iY, int &iZ)
std::vector< T > getMaxPhysR(int material) const
Returns the max. phys position in each direction.
std::size_t getNvoxel()
Returns the number of voxels with material!=0.
std::vector< T > getLatticeExtend(int material)
Returns the lattice extend as length in each direction.
std::map< int, std::size_t > getMaterial2n()
Returns the map with the numbers of voxels for each material.
std::vector< T > getPhysExtend(int material)
Returns the phys extend as length in each direction.
std::vector< int > getMinLatticeR(int material)
Returns the min. lattice position in each direction.
void update(bool verbose=false)
Updates the statistics if it is really needed.
void print()
Prints some statistic information, i.e. the number of voxels and min. max. physical position for each...
std::vector< int > computeDiscreteNormal(int material, T maxNorm=1.1)
Returns discrete normal with norm maxNorm that points into the fluid for paraxial surfaces without up...
bool & getStatisticsStatus()
Read and write access to a flag, which indicates if an uptate is needed (=true)
bool check(int material, int iX, int iY, int iZ, unsigned offsetX, unsigned offsetY, unsigned offsetZ)
std::vector< T > getPhysRadius(int material)
Returns the phys radius as length in each direction.
Representation of a block geometry.
class for marking output with some text
Top level namespace for all of OpenLB.