![]() |
OpenLB 1.8.1
|
Decomposition of a physical volume into a set of disjoint cuboids. More...
#include <cuboidDecomposition.h>
Public Member Functions | |
CuboidDecomposition (Vector< T, D > origin, T deltaR, Vector< int, D > extent, int nC=1) | |
Constructs cuboid decomposition of cuboid with origin and extent. | |
CuboidDecomposition (const Cuboid< T, D > &motherCuboid, int nC) | |
Construction from an given mother cuboid. | |
CuboidDecomposition (IndicatorF< T, D > &indicatorF, T voxelSize, int nC=1) | |
Constructs a cuboid decomposition with uniform spacing of voxelSize which consists of nC cuboids. | |
CuboidDecomposition (IndicatorF< T, D > &indicatorF, T voxelSize, int nC, std::string minimizeBy) | |
Constructs a cuboid decomposition with uniform spacing of voxelSize which consists of nC cuboids shrunken using the minimizeBy strategy. | |
int | size () const |
Returns number of cuboids in decomposition. | |
std::optional< int > | getC (Vector< T, D > physR, int padding=0) const |
Returns ID of cuboid containing physR within padding. | |
Vector< T, D > | getPhysR (LatticeR< D+1 > latticeR) const |
Returns physical position of lattice position. | |
std::optional< LatticeR< D+1 > > | getLatticeR (Vector< T, D > physR) const |
Returns lattice position for given physical position if it exists. | |
std::optional< LatticeR< D+1 > > | getFloorLatticeR (Vector< T, D > physR) const |
Returns floor lattice position for given physical position if it exists. | |
T | getDeltaR () const |
Returns spacing between lattice points in physical units. | |
bool | isInside (Vector< T, D > physR) const |
Returns true iff physR is covered by the decomposition. | |
const Cuboid< T, D > & | get (int iC) const |
Read access to a single cuboid. | |
Cuboid< T, D > & | get (int iC) |
Read and write access to a single cuboid. | |
const Cuboid< T, D > & | getMotherCuboid () const |
Returns the smallest cuboid that includes all cuboids of the structure. | |
Cuboid< T, D > & | getMotherCuboid () |
Returns the smallest cuboid that includes all cuboids of the structure. | |
void | setPeriodicity (Vector< bool, D > periodicity) |
Set flag to enable/disable periodicity depending of direction. Be aware that not all directions are true to ensure boundary conditions like for velocity are not disturbed. | |
std::vector< Cuboid< T, D > > & | cuboids () |
std::set< int > | getNeighborhood (int iCglob, int overlap=0) const |
Returns set of neighbors to cuboid iCglob within overlap. | |
void | setWeights (IndicatorF< T, D > &indicatorF) |
Sets the number of full cells of each cuboid. | |
void | split (int iC, int p) |
Splits cuboid iC, removes it and adds p cuboids of same volume. | |
void | splitRegular (int iC, int width) |
Splits cuboid iC, removes it, adds approx. width^3 sized new cuboids. | |
void | splitByWeight (int iC, int p, IndicatorF< T, D > &indicatorF) |
Splits cuboid iC, removes it and adds p cuboids of same weight. | |
void | splitFractional (int iC, int iD, std::vector< T > fractions) |
Splits cuboid iC along dimension iD into cuboids of fractions. | |
void | remove (int iC) |
Removes the cuboid iC. | |
void | remove (IndicatorF< T, D > &indicatorF) |
Removes all cuboids where indicatorF = 0. | |
void | removeByWeight () |
Removes all cuboids where weight = 0. | |
void | shrink (int iC, IndicatorF< T, D > &indicatorF) |
Shrink cuboid iC so that no empty planes are left. | |
void | shrink (IndicatorF< T, D > &indicatorF) |
Shrink all cuboids so that no empty planes are left. | |
void | refine (int factor) |
Refines mesh by splitting each cell into factor^3 cells. | |
bool | tryRefineTo (T deltaR) |
Tries to refine mesh to given deltaR. | |
void | print () const |
Prints cuboid geometry details. | |
void | printExtended () |
Prints cuboid geometry details plus details of all cuboids. | |
void | writeToExistingFile (std::string completeFileName, LoadBalancer< T > &loadBalancer) |
Save CuboidDecomposition into an existing XML File. | |
void | writeToFile (std::string fileName, LoadBalancer< T > &loadBalancer) |
Save CuboidDecomposition into XML File. | |
T | getMinRatio () const |
Returns the minimum of the ratio nX/nY/nZ in the structure. | |
T | getMaxRatio () const |
Returns the maximum of the ratio nX/nY/nZ in the structure. | |
Vector< T, D > | getMinPhysR () const |
Returns the minimum coordinate in the structure. | |
Vector< T, D > | getMaxPhysR () const |
Returns the maximum coordinate in the structure. | |
T | getMinPhysVolume () const |
Returns the minimum volume in the structure. | |
T | getMaxPhysVolume () const |
Returns the maximum volume in the structure. | |
std::size_t | getMinLatticeVolume () const |
Returns the minimum number of nodes in the structure. | |
std::size_t | getMaxLatticeVolume () const |
Returns the maximum number of nodes in the structure. | |
std::size_t | getMinLatticeWeight () const |
Returns the minimum number of nodes in the structure inside the indicator. | |
std::size_t | getMaxLatticeWeight () const |
Returns the maximum number of nodes in the structure inside the indicator. | |
std::size_t | getNumNodes () const |
Returns the total number cells (without overlap) | |
Decomposition of a physical volume into a set of disjoint cuboids.
The union of all cuboids is a superset of the decomposed volume. Cuboids are dimensioned s.t. they exactly represent a regular lattice with fixed spacing. Two cuboids are neighbors if the distance between them is less than the lattice spacing.
Definition at line 32 of file cuboidDecompositionMinimizer.h.
olb::CuboidDecomposition< T, D >::CuboidDecomposition | ( | Vector< T, D > | origin, |
T | deltaR, | ||
Vector< int, D > | extent, | ||
int | nC = 1 ) |
Constructs cuboid decomposition of cuboid with origin and extent.
Definition at line 43 of file cuboidDecomposition.hh.
References olb::CuboidDecomposition< T, D >::split().
olb::CuboidDecomposition< T, D >::CuboidDecomposition | ( | const Cuboid< T, D > & | motherCuboid, |
int | nC ) |
Construction from an given mother cuboid.
Definition at line 52 of file cuboidDecomposition.hh.
olb::CuboidDecomposition< T, D >::CuboidDecomposition | ( | IndicatorF< T, D > & | indicatorF, |
T | voxelSize, | ||
int | nC = 1 ) |
Constructs a cuboid decomposition with uniform spacing of voxelSize which consists of nC cuboids.
Definition at line 57 of file cuboidDecomposition.hh.
olb::CuboidDecomposition< T, D >::CuboidDecomposition | ( | IndicatorF< T, D > & | indicatorF, |
T | voxelSize, | ||
int | nC, | ||
std::string | minimizeBy ) |
Constructs a cuboid decomposition with uniform spacing of voxelSize which consists of nC cuboids shrunken using the minimizeBy strategy.
Definition at line 72 of file cuboidDecomposition.hh.
|
inline |
Definition at line 106 of file cuboidDecomposition.h.
Cuboid< T, D > & olb::CuboidDecomposition< T, D >::get | ( | int | iC | ) |
Read and write access to a single cuboid.
Definition at line 141 of file cuboidDecomposition.hh.
const Cuboid< T, D > & olb::CuboidDecomposition< T, D >::get | ( | int | iC | ) | const |
Read access to a single cuboid.
Definition at line 135 of file cuboidDecomposition.hh.
std::optional< int > olb::CuboidDecomposition< T, D >::getC | ( | Vector< T, D > | physR, |
int | padding = 0 ) const |
Returns ID of cuboid containing physR within padding.
Definition at line 92 of file cuboidDecomposition.hh.
T olb::CuboidDecomposition< T, D >::getDeltaR | ( | ) | const |
Returns spacing between lattice points in physical units.
Definition at line 120 of file cuboidDecomposition.hh.
std::optional< LatticeR< D+1 > > olb::CuboidDecomposition< T, D >::getFloorLatticeR | ( | Vector< T, D > | physR | ) | const |
Returns floor lattice position for given physical position if it exists.
Definition at line 111 of file cuboidDecomposition.hh.
std::optional< LatticeR< D+1 > > olb::CuboidDecomposition< T, D >::getLatticeR | ( | Vector< T, D > | physR | ) | const |
Returns lattice position for given physical position if it exists.
Definition at line 102 of file cuboidDecomposition.hh.
std::size_t olb::CuboidDecomposition< T, D >::getMaxLatticeVolume | ( | ) | const |
Returns the maximum number of nodes in the structure.
Definition at line 509 of file cuboidDecomposition.hh.
std::size_t olb::CuboidDecomposition< T, D >::getMaxLatticeWeight | ( | ) | const |
Returns the maximum number of nodes in the structure inside the indicator.
Definition at line 543 of file cuboidDecomposition.hh.
Vector< T, D > olb::CuboidDecomposition< T, D >::getMaxPhysR | ( | ) | const |
Returns the maximum coordinate in the structure.
Definition at line 456 of file cuboidDecomposition.hh.
T olb::CuboidDecomposition< T, D >::getMaxPhysVolume | ( | ) | const |
Returns the maximum volume in the structure.
Definition at line 485 of file cuboidDecomposition.hh.
T olb::CuboidDecomposition< T, D >::getMaxRatio | ( | ) | const |
Returns the maximum of the ratio nX/nY/nZ in the structure.
Definition at line 422 of file cuboidDecomposition.hh.
std::size_t olb::CuboidDecomposition< T, D >::getMinLatticeVolume | ( | ) | const |
Returns the minimum number of nodes in the structure.
Definition at line 497 of file cuboidDecomposition.hh.
std::size_t olb::CuboidDecomposition< T, D >::getMinLatticeWeight | ( | ) | const |
Returns the minimum number of nodes in the structure inside the indicator.
Definition at line 531 of file cuboidDecomposition.hh.
Vector< T, D > olb::CuboidDecomposition< T, D >::getMinPhysR | ( | ) | const |
Returns the minimum coordinate in the structure.
Definition at line 442 of file cuboidDecomposition.hh.
T olb::CuboidDecomposition< T, D >::getMinPhysVolume | ( | ) | const |
Returns the minimum volume in the structure.
Definition at line 473 of file cuboidDecomposition.hh.
T olb::CuboidDecomposition< T, D >::getMinRatio | ( | ) | const |
Returns the minimum of the ratio nX/nY/nZ in the structure.
Definition at line 402 of file cuboidDecomposition.hh.
Cuboid< T, D > & olb::CuboidDecomposition< T, D >::getMotherCuboid | ( | ) |
Returns the smallest cuboid that includes all cuboids of the structure.
Definition at line 153 of file cuboidDecomposition.hh.
const Cuboid< T, D > & olb::CuboidDecomposition< T, D >::getMotherCuboid | ( | ) | const |
Returns the smallest cuboid that includes all cuboids of the structure.
Definition at line 147 of file cuboidDecomposition.hh.
std::set< int > olb::CuboidDecomposition< T, D >::getNeighborhood | ( | int | iCglob, |
int | overlap = 0 ) const |
Returns set of neighbors to cuboid iCglob within overlap.
Definition at line 188 of file cuboidDecomposition.hh.
std::size_t olb::CuboidDecomposition< T, D >::getNumNodes | ( | ) | const |
Returns the total number cells (without overlap)
Definition at line 521 of file cuboidDecomposition.hh.
Vector< T, D > olb::CuboidDecomposition< T, D >::getPhysR | ( | LatticeR< D+1 > | latticeR | ) | const |
Returns physical position of lattice position.
Definition at line 159 of file cuboidDecomposition.hh.
bool olb::CuboidDecomposition< T, D >::isInside | ( | Vector< T, D > | physR | ) | const |
Returns true iff physR is covered by the decomposition.
Definition at line 125 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::print | ( | ) | const |
Prints cuboid geometry details.
Definition at line 977 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::printExtended | ( | ) |
Prints cuboid geometry details plus details of all cuboids.
Definition at line 993 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::refine | ( | int | factor | ) |
Refines mesh by splitting each cell into factor^3 cells.
Definition at line 710 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::remove | ( | IndicatorF< T, D > & | indicatorF | ) |
Removes all cuboids where indicatorF = 0.
Definition at line 561 of file cuboidDecomposition.hh.
References olb::Vector< T, Size >::data().
void olb::CuboidDecomposition< T, D >::remove | ( | int | iC | ) |
Removes the cuboid iC.
Definition at line 555 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::removeByWeight | ( | ) |
Removes all cuboids where weight = 0.
Definition at line 601 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::setPeriodicity | ( | Vector< bool, D > | periodicity | ) |
Set flag to enable/disable periodicity depending of direction. Be aware that not all directions are true to ensure boundary conditions like for velocity are not disturbed.
Definition at line 182 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::setWeights | ( | IndicatorF< T, D > & | indicatorF | ) |
Sets the number of full cells of each cuboid.
Definition at line 946 of file cuboidDecomposition.hh.
References olb::Vector< T, Size >::data().
void olb::CuboidDecomposition< T, D >::shrink | ( | IndicatorF< T, D > & | indicatorF | ) |
Shrink all cuboids so that no empty planes are left.
Definition at line 697 of file cuboidDecomposition.hh.
void olb::CuboidDecomposition< T, D >::shrink | ( | int | iC, |
IndicatorF< T, D > & | indicatorF ) |
Shrink cuboid iC so that no empty planes are left.
Definition at line 615 of file cuboidDecomposition.hh.
References olb::Vector< T, Size >::data(), olb::util::max(), and olb::util::min().
int olb::CuboidDecomposition< T, D >::size | ( | ) | const |
Returns number of cuboids in decomposition.
Definition at line 86 of file cuboidDecomposition.hh.
References OLB_PRECONDITION.
void olb::CuboidDecomposition< T, D >::split | ( | int | iC, |
int | p ) |
Splits cuboid iC, removes it and adds p cuboids of same volume.
Definition at line 748 of file cuboidDecomposition.hh.
References olb::Cuboid< T, D >::divideP().
void olb::CuboidDecomposition< T, D >::splitByWeight | ( | int | iC, |
int | p, | ||
IndicatorF< T, D > & | indicatorF ) |
Splits cuboid iC, removes it and adds p cuboids of same weight.
Definition at line 767 of file cuboidDecomposition.hh.
References olb::Vector< T, Size >::data().
void olb::CuboidDecomposition< T, D >::splitFractional | ( | int | iC, |
int | iD, | ||
std::vector< T > | fractions ) |
Splits cuboid iC along dimension iD into cuboids of fractions.
Definition at line 938 of file cuboidDecomposition.hh.
References olb::Cuboid< T, D >::divideFractional().
void olb::CuboidDecomposition< T, D >::splitRegular | ( | int | iC, |
int | width ) |
Splits cuboid iC, removes it, adds approx. width^3 sized new cuboids.
Definition at line 756 of file cuboidDecomposition.hh.
References olb::Cuboid< T, D >::divide(), olb::Cuboid< T, D >::getNx(), olb::Cuboid< T, D >::getNy(), and olb::Cuboid< T, D >::getNz().
bool olb::CuboidDecomposition< T, D >::tryRefineTo | ( | T | deltaR | ) |
Tries to refine mesh to given deltaR.
Definition at line 734 of file cuboidDecomposition.hh.
References olb::util::fabs().
void olb::CuboidDecomposition< T, D >::writeToExistingFile | ( | std::string | completeFileName, |
LoadBalancer< T > & | loadBalancer ) |
Save CuboidDecomposition into an existing XML File.
Definition at line 1006 of file cuboidDecomposition.hh.
References olb::singleton::mpi().
void olb::CuboidDecomposition< T, D >::writeToFile | ( | std::string | fileName, |
LoadBalancer< T > & | loadBalancer ) |
Save CuboidDecomposition into XML File.
Definition at line 1040 of file cuboidDecomposition.hh.
References olb::singleton::directories(), olb::singleton::Directories::getLogOutDir(), and olb::singleton::mpi().