OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::SuperLatticePointCoupling< COUPLER, COUPLEES > Class Template Reference

Coupling operator COUPLER on named COUPLEES. More...

#include <superLatticePointCoupling.h>

+ Inheritance diagram for olb::SuperLatticePointCoupling< COUPLER, COUPLEES >:
+ Collaboration diagram for olb::SuperLatticePointCoupling< COUPLER, COUPLEES >:

Public Member Functions

template<typename... MAP>
 SuperLatticePointCoupling (COUPLER, MAP &&... args)
 
void execute ()
 Execute coupling operation on all blocks.
 
template<typename FIELD >
void setParameter (typename AbstractCouplingO< COUPLEES >::template FieldD< FIELD > &&field)
 Set coupling parameter FIELD.
 
AbstractCouplingO< COUPLEES > & getBlock (int iC)
 Return block-level abstract coupling operator.
 

Detailed Description

template<typename COUPLER, typename COUPLEES>
class olb::SuperLatticePointCoupling< COUPLER, COUPLEES >

Coupling operator COUPLER on named COUPLEES.

Definition at line 120 of file superLatticePointCoupling.h.

Constructor & Destructor Documentation

◆ SuperLatticePointCoupling()

template<typename COUPLER , typename COUPLEES >
template<typename... MAP>
olb::SuperLatticePointCoupling< COUPLER, COUPLEES >::SuperLatticePointCoupling ( COUPLER ,
MAP &&... args )
inline

Definition at line 160 of file superLatticePointCoupling.h.

161 {
162 auto map = std::make_tuple(&args...);
163 COUPLEES::keys_t::for_each([&](auto id) {
164 using name_t = typename decltype(id)::type;
165 constexpr unsigned idx = COUPLEES::keys_t::template index<name_t>();
166 _lattices.template set<name_t>(std::get<2*idx+1>(map));
167 });
168
169 auto& load = _lattices.template get<0>()->getLoadBalancer();
170 auto& cGeometry = _lattices.template get<0>()->getCuboidDecomposition();
171
172 for (int iC = 0; iC < load.size(); ++iC) {
173 Platform reference = _lattices.template get<0>()->getBlock(iC).getPlatform();
174
175 _lattices.for_each([&](auto name, auto lattice) {
176 if (lattice->getBlock(iC).getPlatform() != reference) {
177 throw std::runtime_error("Platforms of coupled block lattices must match");
178 }
179 });
180
182 [&](auto platform) {
183 _block.emplace_back(constructConcreteBlockPointCoupling<platform.value>(iC));
184 });
185 }
186
187 for (int iC = 0; iC < load.size(); ++iC) {
188 const auto origin = cGeometry.get(load.glob(iC)).getOrigin();
189 const auto deltaX = cGeometry.get(load.glob(iC)).getDeltaR();
190 _block[iC]->getParameters().template set<fields::BLOCK_LOWER>(origin);
191 _block[iC]->getParameters().template set<fields::converter::PHYS_DELTA_X>(deltaX);
192 }
193 }
plain_map< typename unzip_flattened_keys< KVs... >::type, typename unzip_flattened_values< KVs... >::type > map
Map of types.
Definition typeMap.h:88
auto callUsingConcretePlatform(Platform platform, typename CONCRETIZABLE::base_t *ptr, F f)
Dispatcher for concrete platform access.
Definition dispatch.h:41
Platform
OpenLB execution targets.
Definition platform.h:35
constexpr void for_each(F f) any_platform
Calls f(name, value) for all pairs.

References olb::callUsingConcretePlatform().

+ Here is the call graph for this function:

Member Function Documentation

◆ execute()

template<typename COUPLER , typename COUPLEES >
void olb::SuperLatticePointCoupling< COUPLER, COUPLEES >::execute ( )
inline

Execute coupling operation on all blocks.

Definition at line 196 of file superLatticePointCoupling.h.

197 {
198 auto& load = _lattices.template get<0>()->getLoadBalancer();
199 #ifdef PARALLEL_MODE_OMP
200 #pragma omp taskloop
201 #endif
202 for (int iC = 0; iC < load.size(); ++iC) {
203 _block[iC]->execute();
204 }
205 }

◆ getBlock()

template<typename COUPLER , typename COUPLEES >
AbstractCouplingO< COUPLEES > & olb::SuperLatticePointCoupling< COUPLER, COUPLEES >::getBlock ( int iC)
inline

Return block-level abstract coupling operator.

e.g. to set block-wise mask or parameter:

superCoupling.getBlock(iC).set(latticeR, false);

Definition at line 223 of file superLatticePointCoupling.h.

224 {
225 return *_block[iC];
226 }

◆ setParameter()

template<typename COUPLER , typename COUPLEES >
template<typename FIELD >
void olb::SuperLatticePointCoupling< COUPLER, COUPLEES >::setParameter ( typename AbstractCouplingO< COUPLEES >::template FieldD< FIELD > && field)
inline

Set coupling parameter FIELD.

Definition at line 209 of file superLatticePointCoupling.h.

210 {
211 auto& load = _lattices.template get<0>()->getLoadBalancer();
212 for (int iC = 0; iC < load.size(); ++iC) {
213 _block[iC]->getParameters().template set<FIELD>(std::forward<decltype(field)>(field));
214 }
215 }

The documentation for this class was generated from the following file: