43#ifndef SUPER_GEOMETRY_H
44#define SUPER_GEOMETRY_H
67template<
typename T,
unsigned D>
68class SuperGeometry :
public SuperStructure<T,D>
69 ,
public BufferSerializable {
72 std::vector<std::unique_ptr<BlockGeometry<T,D>>> _block{};
74 std::unique_ptr<SuperCommunicator<T,SuperGeometry<T,D>>> _communicator{};
76 bool _communicationNeeded{};
80 OstreamManager _clout;
83 std::size_t _iConstructionT;
85 bool _writeIncrementalVtkEnabled;
87 void writeIncrementalVTK();
90 constexpr static unsigned d = D;
101 template <
typename... L>
102 std::enable_if_t<
sizeof...(L) == (D+1),
int>
103 get(L... latticeR)
const {
113 void getPhysR(T output[D],
const int latticeR[D+1])
const;
121 template <
typename BLOCK = BlockGeometry<T,D>>
124 template <
typename BLOCK = BlockGeometry<T,D>>
125 const BLOCK&
getBlock(
int locIC)
const;
140 template <
typename DESCRIPTOR=std::conditional_t<D==2,descriptors::D2Q9<>,descriptors::D3Q27<>>>
141 int clean(
bool verbose=
true, std::vector<int> bulkMaterials={1});
143 int outerClean(
bool verbose=
true, std::vector<int> bulkMaterials={1});
147 int innerClean(
int material,
bool verbose=
true);
152 void reset(IndicatorF<T,D>& domain);
155 void rename(
int fromM,
int toM);
157 void rename(
int fromM,
int toM, FunctorPtr<IndicatorF<T,D>>&& condition);
161 void rename(
int fromM,
int toM,
int testM, Vector<int,D> testDirection);
163 void rename(
int fromBcMat,
int toBcMat,
int fluidMat, IndicatorF<T,D>& condition);
165 void rename(
int fromBcMat,
int toBcMat,
int fluidMat, FunctorPtr<IndicatorF<T,D>>&& condition);
172 _writeIncrementalVtkEnabled = state;
176 return _writeIncrementalVtkEnabled;
180 void print(
const T physR[D],
int offset);
201 if (_communicationNeeded) {
202 _communicator->communicate();
203 _communicationNeeded =
false;
212 bool*
getBlock(std::size_t iBlock, std::size_t& sizeBlock,
bool loadingMode)
override;
Representation of the 2D block geometry view – header file.
Representation of a block geometry.
Decomposition of a physical volume into a set of disjoint cuboids.
Base class for all LoadBalancer.
int get(LatticeR< D+1 > latticeR) const
Read only access to the material numbers, error handling: returns 0 if data is not available.
std::size_t getSerializableSize() const override
Binary size for the serializer.
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 n...
bool & getStatisticsStatus()
Read and write access to the statistic status flag, update needed = true.
SuperGeometry(CuboidDecomposition< T, D > &cuboidDecomposition, LoadBalancer< T > &loadBalancer, int overlap=3)
Vector< T, D > getPhysR(LatticeR< D+1 > latticeR) const
Transforms a lattice to physical position (SI units)
void communicate() override
void print()
Prints some information about the super geometry.
void updateStatistics(bool verbose=true)
Updates the super geometry at the boundaries if needed and afterwards the statisics if needed.
bool getWriteIncrementalVTKState()
void reset(IndicatorF< T, D > &domain)
reset all cell materials inside of a domain to 0
bool checkForErrors(bool verbose=true)
check for errors (searches for all outer voxels (=0) with an inner voxel (=1) as a direct neighbour)
int innerClean(bool verbose=true)
inner cleaning for all boundary types
static constexpr unsigned d
SuperGeometryStatistics< T, D > & getStatistics()
Returns the statistics object.
void rename(int fromM, int toM)
replace one material with another
std::enable_if_t< sizeof...(L)==(D+1), int > get(L... latticeR) const
std::unique_ptr< SuperIndicatorF< T, D > > getMaterialIndicator(std::vector< int > &&materials)
Returns a material indicator using the given vector of materials.
std::size_t getNblock() const override
Number of data blocks for the serializable interface.
int getAndCommunicate(LatticeR< D+1 > latticeR) const
Read only access to the material numbers with global communication to all ranks.
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
void setWriteIncrementalVTK(bool state)
Toggles whether geometry should be written out as VTK after every modification.
BLOCK & getBlock(int locIC)
Read and write access to a single extended block geometry.
int outerClean(bool verbose=true, std::vector< int > bulkMaterials={1})
Removes not needed fluid cells from the outer domain.
This file contains indicator functions.
This file contains indicator functions.
Top level namespace for all of OpenLB.
std::conditional_t< DIM==2, SuperGeometryStatistics2D< T >, SuperGeometryStatistics3D< T > > SuperGeometryStatistics
Vector< std::int32_t, D > LatticeR
Type for spatial block-local lattice coordinates.
Curried BlockGeometry template for use in callUsingConcretePlatform.
Representation of a statistic for a parallel 2D geometry – header file.
Representation of a statistic for a parallel 3D geometry – header file.