43#ifndef SUPER_GEOMETRY_H
44#define SUPER_GEOMETRY_H
68template<
typename T,
unsigned D>
73 std::vector<std::unique_ptr<BlockGeometry<T,D>>> _block{};
75 std::unique_ptr<SuperCommunicator<T,SuperGeometry<T,D>>> _communicator{};
77 bool _communicationNeeded{};
84 constexpr static unsigned d = D;
94 int get(
const int latticeR[D+1])
const;
97 template <
typename... L>
98 std::enable_if_t<
sizeof...(L) == (D+1),
int>
99 get(L... latticeR)
const {
112 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);
159 void rename(
int fromM,
int toM, LatticeR<D> offset);
161 void rename(
int fromM,
int toM,
int testM, std::vector<int> 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);
190 if (_communicationNeeded) {
191 _communicator->communicate();
192 _communicationNeeded =
false;
201 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.
Base class for serializable objects of dynamic size
Base class for all LoadBalancer.
class for marking output with some text
Representation of a statistic for a parallel 2D geometry.
SuperGeometry(CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=3)
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.
int getAndCommunicate(int iCglob, LatticeR< D > latticeR) const
Read only access to the material numbers with global communication to all ranks.
int get(int iCglob, LatticeR< D > latticeR) const
Read only access to the material numbers, error handling: returns 0 if data is not available.
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.
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.
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
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.
std::vector< T > getPhysR(int iCglob, LatticeR< D > latticeR) const
Transforms a lattice to physical position (SI unites)
The description of a vector of 2D cuboid – header file.
The description of a vector of 3D cuboid – header file.
This file contains indicator functions.
This file contains indicator functions.
Descriptor for all types of 2D and 3D lattices.
Top level namespace for all of OpenLB.
std::conditional_t< DIM==2, SuperGeometryStatistics2D< T >, SuperGeometryStatistics3D< T > > SuperGeometryStatistics
std::conditional_t< D==2, CuboidGeometry2D< T >, CuboidGeometry3D< T > > CuboidGeometry
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.