25#ifndef SUPER_STRUCTURE_HH
26#define SUPER_STRUCTURE_HH
33template<
typename T,
unsigned D>
37 : _cuboidGeometry(cuboidGeometry),
38 _loadBalancer(loadBalancer),
40 clout(std::cout,
"SuperGeometry" + std::to_string(D) +
"D")
44template<
typename T,
unsigned D>
51template<
typename T,
unsigned D>
54 return _cuboidGeometry;
57template<
typename T,
unsigned D>
60 return _cuboidGeometry;
63template<
typename T,
unsigned D>
69template<
typename T,
unsigned D>
75template<
typename T,
unsigned D>
81template<
typename T,
unsigned D>
87template<
typename T,
unsigned D>
94 const loc L = _cuboidGeometry.getMotherCuboid().getDeltaR();
95 for (loc iX=minPhysR[0]; iX < maxPhysR[0]; iX+=L) {
96 for (loc iY=minPhysR[1]; iY < maxPhysR[1]; iY+=L) {
97 if constexpr (D == 3) {
98 for (loc iZ=minPhysR[2]; iZ < maxPhysR[2]; iZ+=L) {
99 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
106 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
116template<
typename T,
unsigned D>
123 const loc L = _cuboidGeometry.getMotherCuboid().getDeltaR();
124 for (loc iX=std::max(minPhysR[0],min[0]); iX < std::min(maxPhysR[0],max[0]+L); iX+=L) {
125 for (loc iY=std::max(minPhysR[1],min[1]); iY < std::min(maxPhysR[1],max[1]+L); iY+=L) {
126 if constexpr (D == 3) {
127 for (loc iZ=std::max(minPhysR[2],min[2]); iZ < std::min(maxPhysR[2],max[2]+L); iZ+=L) {
128 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
135 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
145template<
typename T,
unsigned D>
151 _cuboidGeometry.getLatticeR( latticeR.
data(), physLoc.
data() );
152 if constexpr (std::is_invocable_v<F, LatticeR<D+1>>) {
155 if constexpr (D == 3) {
156 f(latticeR[0],latticeR[1],latticeR[2],latticeR[3]);
158 f(latticeR[0],latticeR[1],latticeR[2]);
164template<
typename T,
unsigned D>
168 forCorePhysLocations(min, max, [&](
PhysR<T,D> physLoc){
170 _cuboidGeometry.getLatticeR( latticeR.
data(), physLoc.
data() );
171 if constexpr (std::is_invocable_v<F, LatticeR<D+1>>) {
174 if constexpr (D == 3) {
175 f(latticeR[0],latticeR[1],latticeR[2],latticeR[3]);
177 f(latticeR[0],latticeR[1],latticeR[2]);
Base class for all LoadBalancer.
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.
int getOverlap()
Read and write access to the overlap.
void forCorePhysLocations(F f) const
Iterate over discrete physical locations.
void forCoreSpatialLocations(F f) const
Iterate over spatial locations NOTE: Based on physical locations (as opposed to its blockStructure ve...
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
SuperStructure(CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=2)
Construction of a super structure.
constexpr const T * data() const any_platform
Top level namespace for all of OpenLB.
std::conditional_t< D==2, CuboidGeometry2D< T >, CuboidGeometry3D< T > > CuboidGeometry