![]() |
OpenLB 1.7
|
Representation of a statistic for a parallel 2D geometry. More...
#include <superGeometry.h>
Public Types | |
using | block_t = ConcretizableBlockGeometry<T,D> |
![]() | |
using | value_t = T |
Public Member Functions | |
SuperGeometry (CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=3) | |
int | get (int iCglob, LatticeR< D > latticeR) const |
Read only access to the material numbers, error handling: returns 0 if data is not available. | |
int | get (const int latticeR[D+1]) const |
int | get (LatticeR< D+1 > latticeR) const |
template<typename... L> | |
std::enable_if_t< sizeof...(L)==(D+1), int > | get (L... latticeR) const |
int | getAndCommunicate (int iCglob, LatticeR< D > latticeR) const |
Read only access to the material numbers with global communication to all ranks. | |
int | getAndCommunicate (LatticeR< D+1 > latticeR) const |
std::vector< T > | getPhysR (int iCglob, LatticeR< D > latticeR) const |
Transforms a lattice to physical position (SI unites) | |
std::vector< T > | getPhysR (LatticeR< D+1 > latticeR) const |
Transforms a lattice to physical position (SI unites) | |
void | getPhysR (T output[D], const int latticeR[D+1]) const |
Transforms a lattice to physical position (SI unites) | |
void | getPhysR (T output[D], const int iCglob, LatticeR< D > latticeR) const |
BlockGeometry< T, D > & | getBlockGeometry (int locIC) |
Read and write access to a single block geometry. | |
BlockGeometry< T, D > const & | getBlockGeometry (int locIC) const |
Read only access to a single block geometry. | |
template<typename BLOCK = BlockGeometry<T,D>> | |
BLOCK & | getBlock (int locIC) |
Read and write access to a single extended block geometry. | |
template<typename BLOCK = BlockGeometry<T,D>> | |
const BLOCK & | getBlock (int locIC) const |
Read only access to a single extended block geometry. | |
SuperGeometryStatistics< T, D > & | getStatistics () |
Returns the statistics object. | |
const SuperGeometryStatistics< T, D > & | getStatistics () const |
Returns the statistics object (readonly) | |
bool & | getStatisticsStatus () |
Read and write access to the statistic status flag, update needed = true. | |
bool const & | getStatisticsStatus () const |
Read only access to the statistic status flag, update needed = true. | |
void | updateStatistics (bool verbose=true) |
Updates the super geometry at the boundaries if needed and afterwards the statisics if needed. | |
template<typename DESCRIPTOR = std::conditional_t<D==2,descriptors::D2Q9<>,descriptors::D3Q27<>>> | |
int | clean (bool verbose=true, std::vector< int > bulkMaterials={1}) |
Executes an outer cleaning: Sets all material numbers which are not bulk-materials to 0 if there is no neighbour from bulkMaterials. | |
int | outerClean (bool verbose=true, std::vector< int > bulkMaterials={1}) |
Removes not needed fluid cells from the outer domain. | |
int | innerClean (bool verbose=true) |
inner cleaning for all boundary types | |
int | innerClean (int material, bool verbose=true) |
inner cleaning for specific boundary types | |
bool | checkForErrors (bool verbose=true) |
check for errors (searches for all outer voxels (=0) with an inner voxel (=1) as a direct neighbour) | |
void | reset (IndicatorF< T, D > &domain) |
reset all cell materials inside of a domain to 0 | |
void | rename (int fromM, int toM) |
replace one material with another | |
void | rename (int fromM, int toM, FunctorPtr< IndicatorF< T, D > > &&condition) |
replace one material that fulfills an indicator functor condition with another | |
void | rename (int fromM, int toM, LatticeR< D > offset) |
replace one material with another respecting an offset (overlap) | |
void | rename (int fromM, int toM, int testM, std::vector< int > testDirection) |
renames all voxels of material fromM to toM if the number of voxels given by testDirection is of material testM | |
void | rename (int fromBcMat, int toBcMat, int fluidMat, IndicatorF< T, D > &condition) |
renames all boundary voxels of material fromBcMat to toBcMat if two neighbour voxel in the direction of the discrete normal are fluid voxel with material fluidM in the region where the indicator function is fulfilled | |
void | rename (int fromBcMat, int toBcMat, int fluidMat, FunctorPtr< IndicatorF< T, D > > &&condition) |
renames all boundary voxels of material fromBcMat to toBcMat if two neighbour voxel in the direction of the discrete normal are fluid voxel with material fluidM in the region where the indicator function is fulfilled | |
void | print () |
Prints some information about the super geometry. | |
std::unique_ptr< SuperIndicatorF< T, D > > | getMaterialIndicator (std::vector< int > &&materials) |
Returns a material indicator using the given vector of materials. | |
std::unique_ptr< SuperIndicatorF< T, D > > | getMaterialIndicator (int material) |
Returns a material indicator using a single material number. | |
void | communicate () override |
std::size_t | getNblock () const override |
Number of data blocks for the serializable interface. | |
std::size_t | getSerializableSize () const override |
Binary size for the serializer. | |
bool * | getBlock (std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override |
Return a pointer to the memory of the current block and its size for the serializable interface. | |
![]() | |
virtual | ~SuperStructure () |
Virtual Destructor for inheritance. | |
SuperStructure (CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=2) | |
Construction of a super structure. | |
SuperStructure (int overlap=1) | |
Default Constructor for empty SuperStructure. | |
CuboidGeometry< T, D > & | getCuboidGeometry () |
Read and write access to cuboid geometry. | |
CuboidGeometry< T, D > const & | getCuboidGeometry () const |
Read only access to cuboid geometry. | |
int | getOverlap () |
Read and write access to the overlap. | |
int | getOverlap () const |
Read only access to the overlap. | |
LoadBalancer< T > & | getLoadBalancer () |
Read and write access to the load balancer. | |
LoadBalancer< T > const & | getLoadBalancer () const |
Read only access to the load balancer. | |
template<typename F > | |
void | forCorePhysLocations (F f) const |
Iterate over discrete physical locations. | |
template<typename F > | |
void | forCorePhysLocations (PhysR< T, D > min, PhysR< T, D > max, F f) const |
Iterate over discrete physical locations between min and max. | |
template<typename F > | |
void | forCoreSpatialLocations (F f) const |
Iterate over spatial locations NOTE: Based on physical locations (as opposed to its blockStructure version) | |
template<typename F > | |
void | forCoreSpatialLocations (PhysR< T, D > min, PhysR< T, D > max, F f) const |
Iterate over spatial locations between min and max NOTE: Based on physical locations (as opposed to its blockStructure version) | |
![]() | |
virtual | ~Serializable ()=default |
template<bool includeLogOutputDir = true> | |
bool | save (std::string fileName="", const bool enforceUint=false) |
Save Serializable into file fileName | |
template<bool includeLogOutputDir = true> | |
bool | load (std::string fileName="", const bool enforceUint=false) |
Load Serializable from file fileName | |
bool | save (std::uint8_t *buffer) |
Save Serializable into buffer of length getSerializableSize | |
bool | load (const std::uint8_t *buffer) |
Load Serializable from buffer of length getSerializableSize | |
virtual void | postLoad () |
Static Public Attributes | |
static constexpr unsigned | d = D |
Additional Inherited Members | |
![]() | |
template<typename DataType > | |
void | registerSerializable (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, size_t &sizeBufferIndex, bool *&dataPtr, DataType &data, const bool loadingMode=false) |
Register Serializable object of dynamic size. | |
template<typename DataType > | |
void | registerStdVectorOfVars (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::vector< DataType > &data, const bool loadingMode=false) |
Method for registering a std::vector<DataType> of primitive DataType (int , double , ...) | |
template<typename DataType > | |
void | registerStdVectorOfSerializablesOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::vector< DataType > &data, const bool loadingMode=false) |
Method for registering a std::vector<DataType> of constant-sized Serializable | |
template<typename DataType > | |
void | registerStdVectorOfSerializables (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::vector< DataType > &data, const bool loadingMode=false) |
Method for registering a std::vector<DataType> of dynamic-sized DataType | |
template<typename DataTypeKey , typename DataTypeValue > | |
void | registerMap (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::map< DataTypeKey, DataTypeValue > &data, const bool loadingMode=false) |
Method for registering a std::map<DataTypeKey, DataTypeValue> of fixed-sized types (i.e. int , double ) | |
size_t | addSizeToBuffer (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, size_t &sizeBufferIndex, bool *&dataPtr, const size_t data) const |
Add a size_t to the sizeBuffer in the n-th util::round and return that size_t in all successive rounds. | |
![]() | |
template<typename DataType > | |
void | registerVar (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, const DataType &data, const size_t arrayLength=1) const |
Register primitive data types (int , double , ...) or arrays of those. | |
template<typename DataType > | |
void | registerSerializableOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType &data, const bool loadingMode=false) |
Register Serializable object of constant size. | |
template<typename DataType > | |
void | registerSerializablesOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType *data, const size_t arrayLength, const bool loadingMode=false) |
Register an array of Serializable objects of constant size. | |
![]() | |
CuboidGeometry< T, D > & | _cuboidGeometry |
The grid structure is stored here. | |
LoadBalancer< T > & | _loadBalancer |
Distribution of the cuboids of the cuboid structure. | |
int | _overlap |
Size of ghost cell layer (must be greater than 1 and greater_overlapBC, default =1) | |
OstreamManager | clout |
class specific output stream | |
![]() | |
std::vector< bool * > | _dataBuffer |
Data buffer for data that has to be buffered between two getBlock() iterations. | |
std::vector< size_t > | _sizeBuffer |
std::vector of integer buffers (e.g. for std::vector size) to be buffered for the whole iteration process | |
Representation of a statistic for a parallel 2D geometry.
Representation of a statistic for a parallel 3D geometry.
A super geomety statistic computes different integral values, like total number of different materials, materials of any kind, min./max. physical position, of an underlying super geoemtry.
This class is not intended to be derived from.
A super geometry statistic computes different integral values, like total number of different materials, materials of any kind, min./max. physical position, of an underlying super geometry.
This class is not intended to be derived from.
Definition at line 69 of file superGeometry.h.
using olb::SuperGeometry< T, D >::block_t = ConcretizableBlockGeometry<T,D> |
Definition at line 86 of file superGeometry.h.
olb::SuperGeometry< T, D >::SuperGeometry | ( | CuboidGeometry< T, D > & | cuboidGeometry, |
LoadBalancer< T > & | loadBalancer, | ||
int | overlap = 3 ) |
Definition at line 53 of file superGeometry.hh.
References olb::SuperStructure< T, D >::_overlap, olb::SuperStructure< T, D >::getLoadBalancer(), and olb::SuperGeometry< T, D >::updateStatistics().
bool olb::SuperGeometry< T, D >::checkForErrors | ( | bool | verbose = true | ) |
check for errors (searches for all outer voxels (=0) with an inner voxel (=1) as a direct neighbour)
Definition at line 313 of file superGeometry.hh.
int olb::SuperGeometry< T, D >::clean | ( | bool | verbose = true, |
std::vector< int > | bulkMaterials = {1} ) |
Executes an outer cleaning: Sets all material numbers which are not bulk-materials to 0 if there is no neighbour from bulkMaterials.
Definition at line 232 of file superGeometry.hh.
References olb::singleton::mpi(), and olb::singleton::MpiManager::reduceAndBcast().
|
inlineoverridevirtual |
Reimplemented from olb::SuperStructure< T, D >.
Definition at line 188 of file superGeometry.h.
int olb::SuperGeometry< T, D >::get | ( | const int | latticeR[D+1] | ) | const |
Definition at line 89 of file superGeometry.hh.
int olb::SuperGeometry< T, D >::get | ( | int | iCglob, |
LatticeR< D > | latticeR ) const |
Read only access to the material numbers, error handling: returns 0 if data is not available.
Definition at line 78 of file superGeometry.hh.
References olb::singleton::mpi().
|
inline |
Definition at line 99 of file superGeometry.h.
References olb::SuperGeometry< T, D >::get().
int olb::SuperGeometry< T, D >::get | ( | LatticeR< D+1 > | latticeR | ) | const |
Definition at line 99 of file superGeometry.hh.
int olb::SuperGeometry< T, D >::getAndCommunicate | ( | int | iCglob, |
LatticeR< D > | latticeR ) const |
Read only access to the material numbers with global communication to all ranks.
Definition at line 109 of file superGeometry.hh.
int olb::SuperGeometry< T, D >::getAndCommunicate | ( | LatticeR< D+1 > | latticeR | ) | const |
Definition at line 122 of file superGeometry.hh.
BLOCK & olb::SuperGeometry< T, D >::getBlock | ( | int | locIC | ) |
Read and write access to a single extended block geometry.
Definition at line 176 of file superGeometry.hh.
const BLOCK & olb::SuperGeometry< T, D >::getBlock | ( | int | locIC | ) | const |
Read only access to a single extended block geometry.
Definition at line 184 of file superGeometry.hh.
|
overridevirtual |
Return a pointer to the memory of the current block and its size for the serializable interface.
Implements olb::Serializable.
Definition at line 492 of file superGeometry.hh.
BlockGeometry< T, D > & olb::SuperGeometry< T, D >::getBlockGeometry | ( | int | locIC | ) |
Read and write access to a single block geometry.
Definition at line 162 of file superGeometry.hh.
BlockGeometry< T, D > const & olb::SuperGeometry< T, D >::getBlockGeometry | ( | int | locIC | ) | const |
Read only access to a single block geometry.
Definition at line 169 of file superGeometry.hh.
std::unique_ptr< SuperIndicatorF< T, D > > olb::SuperGeometry< T, D >::getMaterialIndicator | ( | int | material | ) |
Returns a material indicator using a single material number.
material | Material to be indicated |
Definition at line 469 of file superGeometry.hh.
std::unique_ptr< SuperIndicatorF< T, D > > olb::SuperGeometry< T, D >::getMaterialIndicator | ( | std::vector< int > && | materials | ) |
Returns a material indicator using the given vector of materials.
materials | Materials to be indicated |
Definition at line 457 of file superGeometry.hh.
|
overridevirtual |
Number of data blocks for the serializable interface.
Implements olb::Serializable.
Definition at line 475 of file superGeometry.hh.
std::vector< T > olb::SuperGeometry< T, D >::getPhysR | ( | int | iCglob, |
LatticeR< D > | latticeR ) const |
Transforms a lattice to physical position (SI unites)
Definition at line 132 of file superGeometry.hh.
std::vector< T > olb::SuperGeometry< T, D >::getPhysR | ( | LatticeR< D+1 > | latticeR | ) | const |
Transforms a lattice to physical position (SI unites)
Definition at line 141 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::getPhysR | ( | T | output[D], |
const int | iCglob, | ||
LatticeR< D > | latticeR ) const |
Definition at line 156 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::getPhysR | ( | T | output[D], |
const int | latticeR[D+1] ) const |
Transforms a lattice to physical position (SI unites)
Definition at line 150 of file superGeometry.hh.
|
overridevirtual |
Binary size for the serializer.
Implements olb::Serializable.
Definition at line 484 of file superGeometry.hh.
SuperGeometryStatistics< T, D > & olb::SuperGeometry< T, D >::getStatistics | ( | ) |
Returns the statistics object.
Definition at line 190 of file superGeometry.hh.
const SuperGeometryStatistics< T, D > & olb::SuperGeometry< T, D >::getStatistics | ( | ) | const |
Returns the statistics object (readonly)
Definition at line 200 of file superGeometry.hh.
bool & olb::SuperGeometry< T, D >::getStatisticsStatus | ( | ) |
Read and write access to the statistic status flag, update needed = true.
Definition at line 206 of file superGeometry.hh.
bool const & olb::SuperGeometry< T, D >::getStatisticsStatus | ( | ) | const |
Read only access to the statistic status flag, update needed = true.
Definition at line 212 of file superGeometry.hh.
int olb::SuperGeometry< T, D >::innerClean | ( | bool | verbose = true | ) |
inner cleaning for all boundary types
Definition at line 272 of file superGeometry.hh.
References olb::singleton::MpiManager::barrier(), olb::singleton::mpi(), and olb::singleton::MpiManager::reduceAndBcast().
int olb::SuperGeometry< T, D >::innerClean | ( | int | material, |
bool | verbose = true ) |
inner cleaning for specific boundary types
Definition at line 293 of file superGeometry.hh.
References olb::singleton::mpi(), and olb::singleton::MpiManager::reduceAndBcast().
int olb::SuperGeometry< T, D >::outerClean | ( | bool | verbose = true, |
std::vector< int > | bulkMaterials = {1} ) |
Removes not needed fluid cells from the outer domain.
Definition at line 252 of file superGeometry.hh.
References olb::singleton::mpi(), and olb::singleton::MpiManager::reduceAndBcast().
void olb::SuperGeometry< T, D >::print | ( | ) |
Prints some information about the super geometry.
Definition at line 450 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::rename | ( | int | fromBcMat, |
int | toBcMat, | ||
int | fluidMat, | ||
FunctorPtr< IndicatorF< T, D > > && | condition ) |
renames all boundary voxels of material fromBcMat to toBcMat if two neighbour voxel in the direction of the discrete normal are fluid voxel with material fluidM in the region where the indicator function is fulfilled
Definition at line 429 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::rename | ( | int | fromBcMat, |
int | toBcMat, | ||
int | fluidMat, | ||
IndicatorF< T, D > & | condition ) |
renames all boundary voxels of material fromBcMat to toBcMat if two neighbour voxel in the direction of the discrete normal are fluid voxel with material fluidM in the region where the indicator function is fulfilled
Definition at line 409 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::rename | ( | int | fromM, |
int | toM ) |
replace one material with another
Definition at line 345 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::rename | ( | int | fromM, |
int | toM, | ||
FunctorPtr< IndicatorF< T, D > > && | condition ) |
replace one material that fulfills an indicator functor condition with another
Definition at line 356 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::rename | ( | int | fromM, |
int | toM, | ||
int | testM, | ||
std::vector< int > | testDirection ) |
renames all voxels of material fromM to toM if the number of voxels given by testDirection is of material testM
Definition at line 382 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::rename | ( | int | fromM, |
int | toM, | ||
LatticeR< D > | offset ) |
replace one material with another respecting an offset (overlap)
Definition at line 366 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::reset | ( | IndicatorF< T, D > & | domain | ) |
reset all cell materials inside of a domain to 0
Definition at line 334 of file superGeometry.hh.
void olb::SuperGeometry< T, D >::updateStatistics | ( | bool | verbose = true | ) |
Updates the super geometry at the boundaries if needed and afterwards the statisics if needed.
Definition at line 218 of file superGeometry.hh.
|
staticconstexpr |
Definition at line 84 of file superGeometry.h.