25#ifndef SUPER_STRUCTURE_HH
26#define SUPER_STRUCTURE_HH
33template<
typename T,
unsigned D>
37 : _cuboidDecomposition(cuboidDecomposition),
38 _loadBalancer(loadBalancer),
40 clout(std::cout,
"SuperStructure" + std::to_string(D) +
"D")
44template<
typename T,
unsigned D>
47 return _cuboidDecomposition;
50template<
typename T,
unsigned D>
53 return _cuboidDecomposition;
56template<
typename T,
unsigned D>
62template<
typename T,
unsigned D>
68template<
typename T,
unsigned D>
74template<
typename T,
unsigned D>
80template<
typename T,
unsigned D>
87 const loc L = _cuboidDecomposition.getMotherCuboid().getDeltaR();
88 for (loc iX=minPhysR[0]; iX < maxPhysR[0]; iX+=L) {
89 for (loc iY=minPhysR[1]; iY < maxPhysR[1]; iY+=L) {
90 if constexpr (D == 3) {
91 for (loc iZ=minPhysR[2]; iZ < maxPhysR[2]; iZ+=L) {
92 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
99 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
109template<
typename T,
unsigned D>
116 const loc L = _cuboidDecomposition.getDeltaR();
117 for (loc iX=std::max(minPhysR[0],min[0]); iX < std::min(maxPhysR[0],max[0]+L); iX+=L) {
118 for (loc iY=std::max(minPhysR[1],min[1]); iY < std::min(maxPhysR[1],max[1]+L); iY+=L) {
119 if constexpr (D == 3) {
120 for (loc iZ=std::max(minPhysR[2],min[2]); iZ < std::min(maxPhysR[2],max[2]+L); iZ+=L) {
121 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
128 if constexpr (std::is_invocable_v<F, PhysR<T,D>>) {
138template<
typename T,
unsigned D>
143 auto latticeR = _cuboidDecomposition.getLatticeR(physLoc);
145 if constexpr (std::is_invocable_v<F, LatticeR<D+1>>) {
149 if constexpr (D == 3) {
150 f(lR[0],lR[1],lR[2],lR[3]);
152 f(lR[0],lR[1],lR[2]);
159template<
typename T,
unsigned D>
163 forCorePhysLocations(min, max, [&](
PhysR<T,D> physLoc){
164 auto latticeR = _cuboidDecomposition.getLatticeR(physLoc.
data());
166 if constexpr (std::is_invocable_v<F, LatticeR<D+1>>) {
170 if constexpr (D == 3) {
171 f(lR[0],lR[1],lR[2],lR[3]);
173 f(lR[0],lR[1],lR[2]);
Decomposition of a physical volume into a set of disjoint cuboids.
Base class for all LoadBalancer.
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(CuboidDecomposition< T, D > &cuboidDecomposition, LoadBalancer< T > &loadBalancer, int overlap=2)
Construction of a super structure.
CuboidDecomposition< T, D > & getCuboidDecomposition()
Read and write access to cuboid geometry.
constexpr const T * data() const any_platform
Top level namespace for all of OpenLB.