29#ifndef CUBOID_GEOMETRY_2D_H
30#define CUBOID_GEOMETRY_2D_H
40template<
typename T>
class IndicatorF2D;
63 std::vector<Cuboid2D<T> > _cuboids;
67 std::vector<bool> _periodicityOn;
81 void reInit(T globPosX, T globPosY,
82 T delta,
int nX,
int nY,
int nC=1);
91 bool getC(std::vector<T> physR,
int& iC)
const;
95 bool getLatticeR(std::vector<T> physR, std::vector<int>& latticeR)
const;
96 bool getLatticeR(
int latticeR[],
const T physR[])
const;
99 bool getFloorLatticeR(std::vector<T> physR, std::vector<int>& latticeR)
const;
103 std::vector<T>
getPhysR(
int iCglob,
int iX,
int iY)
const;
105 std::vector<T>
getPhysR(std::vector<int> latticeR)
const;
106 void getPhysR(T output[2],
const int latticeR[3])
const;
107 void getPhysR(T output[2],
const int iCglob,
const int iX,
const int iY)
const;
135 int get_iC(T globX, T globY,
int offset = 0)
const;
141 int get_iC(T globX, T globY,
int orientationX,
int orientationY)
const;
150 void split(
int iC,
int p);
155 void getNeighbourhood(
int cuboid, std::vector<int>& neighbours,
int offset = 0);
168 std::map<
int,std::vector<int>>& neighbourhood,
171 for (
int iC=0; iC<cuboidGeometry.
getNc(); ++iC){
173 std::vector<int> neighbours;
175 neighbourhood[iC]=neighbours;
A regular single 2D cuboid is the basic component of a 2D cuboid structure which defines the grid.
A cuboid structure represents the grid of a considered domain.
void reInit(T globPosX, T globPosY, T delta, int nX, int nY, int nC=1)
Re init.
bool getFloorLatticeR(std::vector< T > physR, std::vector< int > &latticeR) const
Returns true and the util::floor lattice position to the given physical position if the physical posi...
void getPhysR(T output[3], LatticeR< 3 > latticeR) const
void remove(int iC)
Removes the cuboid iC.
void print() const
Prints cuboid geometry details.
T getMaxPhysVolume() const
int getNc() const
Returns the number of cuboids in t < 2he structure.
size_t getMinLatticeVolume() const
Returns the maximum/minimum number of nodes in the structure.
void printExtended()
Prints cuboid geometry details plus details of all cuboids.
CuboidGeometry2D()
Constructs empty Geometry.
void shrink(IndicatorF2D< T > &indicatorF)
Shrink all cuboids so that no empty planes are left.
Cuboid2D< T > getMotherCuboid() const
Returns the smallest cuboid that includes all cuboids of the structure.
void setPeriodicity(bool periodicityX, bool periodicityY)
Set flag to enable/disable periodicity.
size_t getMaxLatticeVolume() const
bool getC(std::vector< T > physR, int &iC) const
Returns true and the cuboid number of the nearest lattice position to the given physical position if ...
Cuboid2D< T > & get(int i)
Read and write access to the cuboids.
T getMinRatio() const
Returns the maximum/minimum of the ratio nX/NY in the structure.
T getMinDeltaR() const
Returns the maximum/minimum delata in the structure.
std::vector< T > getPhysR(int iCglob, int iX, int iY) const
Returns the physical position to the given lattice position respecting periodicity for the overlap no...
std::vector< T > getMinPhysR() const
Returns the minimum coordinate in the structure.
void getNeighbourhood(int cuboid, std::vector< int > &neighbours, int offset=0)
stores the neighbouring cuboids in array neighbours;
bool getLatticeR(std::vector< T > physR, std::vector< int > &latticeR) const
Returns true and the nearest lattice position to the given physical position if the physical position...
T getMinPhysVolume() const
Returns the maximum/minimum volume in the structure.
void add(Cuboid2D< T > cuboid)
Adds a cuboid.
std::vector< T > getMaxPhysR() const
Returns the maximum coordinate in the structure.
void split(int iC, int p)
Removes all cuboids where geometryData = 0.
int get_iC(T globX, T globY, int offset=0) const
for a given point (globX/globY), returns the related cuboidID and _p if the point is not in any of th...
IndicatorF2D is an application from .
class for marking output with some text
The description of a single 2D cuboid – header file.
Top level namespace for all of OpenLB.
void evaluateCuboidGeometryNeighbourhood(CuboidGeometry2D< T > &cuboidGeometry, std::map< int, std::vector< int > > &neighbourhood, int offset=0)
Evaluate complete neighbourhood and store in std::map.