28#ifndef BLOCK_GEOMETRY_STATISTICS_2D_H
29#define BLOCK_GEOMETRY_STATISTICS_2D_H
49template<
typename T,
unsigned D>
58 bool _statisticsUpdateNeeded{};
67 std::map<int, int> _material2n;
69 std::map<int, std::vector<int> > _material2min;
71 std::map<int, std::vector<int> > _material2max;
90 void update(
bool verbose=
true);
124 std::vector<int>
getType(
const int* input)
const;
125 std::vector<int>
getType(
int iX,
int iY)
const;
139 bool check(
int material,
int iX,
int iY,
unsigned offsetX,
unsigned offsetY);
140 bool check(
int material,
int iX,
int iY,
unsigned offsetX,
unsigned offsetY)
const;
143 bool find(
int material,
unsigned offsetX,
unsigned offsetY,
int& iX,
int& iY);
144 bool find(
int material,
unsigned offsetX,
unsigned offsetY,
int& iX,
int& iY)
const;
153 void takeStatistics(
int iX,
int iY);
std::vector< int > computeNormal(int iX, int iY)
Returns normal that points into the fluid for paraxial surfaces.
std::vector< int > getMaxLatticeR(int material)
Returns the max. lattice position in each direction.
std::map< int, int > getMaterial2n()
Returns the map with the numbers of voxels for each material.
std::vector< int > getMinLatticeR(int material)
Returns the min. lattice position in each direction.
std::vector< T > getLatticeExtend(int material)
Returns the lattice extend as length in each direction.
bool & getStatisticsStatus()
Read and write access to a flag, which indicates if an uptate is needed (=true)
void print()
Prints some statistic information, i.e. the number of voxels and min. max. physical position for each...
std::vector< T > getCenterPhysR(int material)
Returns the center position.
bool check(int material, int iX, int iY, unsigned offsetX, unsigned offsetY)
int getNvoxel()
Returns the number of voxels with material!=0.
std::vector< T > getPhysRadius(int material)
Returns the phys radius as length in each direction.
std::vector< T > getPhysExtend(int material)
Returns the phys extend as length in each direction.
std::vector< T > getMaxPhysR(int material) const
Returns the max. phys position in each direction.
std::vector< T > getMinPhysR(int material) const
Returns the min. phys position in each direction.
void update(bool verbose=true)
Updates the statistics if it is really needed.
BlockGeometryStatistics2D(BlockGeometry< T, 2 > *blockGeometry)
int getNmaterials()
Returns the number of different materials.
std::vector< int > getType(const int *input) const
Returns the boundary type which is characterized by a discrete normal (c.f. Zimny)
std::vector< int > computeDiscreteNormal(int material, T maxNorm=1.1)
Returns discrete normal with norm maxNorm that points into the fluid for paraxial surfaces maxNorm=1....
bool find(int material, unsigned offsetX, unsigned offsetY, int &iX, int &iY)
Representation of a block geometry.
class for marking output with some text
Top level namespace for all of OpenLB.