OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters > Class Template Referencefinal

#include <superLatticeCoupling.h>

+ Inheritance diagram for olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >:
+ Collaboration diagram for olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >:

Public Member Functions

template<typename LATTICES >
 ConcreteBlockCouplingO (LATTICES &&lattices)
 
std::type_index id () const override
 
AbstractCouplingO< COUPLEES >::AbstractParametersgetParameters () override
 Return reference to parameters of coupling operator.
 
void set (CellID iCell, bool state) override
 Set whether iCell is covered by the present coupling.
 
void execute () override
 Execute coupling operation.
 
- Public Member Functions inherited from olb::AbstractBlockO
virtual ~AbstractBlockO ()=default
 

Additional Inherited Members

- Public Types inherited from olb::AbstractCouplingO< COUPLEES >
using value_t = typename COUPLEES::values_t::template get<0>::value_t
 Value type used for coupling parameters.
 
using descriptor_t = typename COUPLEES::values_t::template get<0>::descriptor_t
 Descriptor type used for coupling parameters.
 
using AbstractParameters = olb::AbstractParameters<value_t,descriptor_t>
 
using ParametersD = olb::ParametersD<value_t,descriptor_t>
 
using LatticeR = olb::LatticeR<descriptor_t::d>
 
template<typename FIELD >
using FieldD = olb::FieldD<value_t,descriptor_t,FIELD>
 

Detailed Description

template<typename COUPLER, typename COUPLEES, Platform PLATFORM>
class olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >

Definition at line 133 of file superLatticeCoupling.h.

Constructor & Destructor Documentation

◆ ConcreteBlockCouplingO()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
template<typename LATTICES >
olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >::ConcreteBlockCouplingO ( LATTICES && lattices)
inline

Definition at line 163 of file superLatticeCoupling.h.

163 :
164 _lattices{lattices}
165 { }

Member Function Documentation

◆ execute()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
void olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >::execute ( )
inlineoverridevirtual

Execute coupling operation.

Implements olb::AbstractCouplingO< COUPLEES >.

Definition at line 186 of file superLatticeCoupling.h.

187 {
189 auto* lattice = _lattices.template get<0>();
190 if (_mask) {
191 #ifdef PARALLEL_MODE_OMP
192 #pragma omp parallel for schedule(static) collapse(1)
193 #endif
194 for (loc iX=0; iX < lattice->getNx(); ++iX) {
195 for (loc iY=0; iY < lattice->getNy(); ++iY) {
196 if constexpr (AbstractCouplingO<COUPLEES>::descriptor_t::d == 3) {
197 for (loc iZ=0; iZ < lattice->getNz(); ++iZ) {
198 if (_mask->operator[](lattice->getCellId(iX,iY,iZ))) {
199 execute({iX,iY,iZ});
200 }
201 }
202 } else {
203 if (_mask->operator[](lattice->getCellId(iX,iY))) {
204 execute({iX,iY});
205 }
206 }
207 }
208 }
209 } else {
210 #ifdef PARALLEL_MODE_OMP
211 #pragma omp parallel for schedule(static) collapse(1)
212 #endif
213 for (loc iX=0; iX < lattice->getNx(); ++iX) {
214 for (loc iY=0; iY < lattice->getNy(); ++iY) {
215 if constexpr (AbstractCouplingO<COUPLEES>::descriptor_t::d == 3) {
216 for (loc iZ=0; iZ < lattice->getNz(); ++iZ) {
217 execute({iX,iY,iZ});
218 }
219 } else {
220 execute({iX,iY});
221 }
222 }
223 }
224 }
225 }

◆ getParameters()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
AbstractCouplingO< COUPLEES >::AbstractParameters & olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >::getParameters ( )
inlineoverridevirtual

Return reference to parameters of coupling operator.

Implements olb::AbstractCouplingO< COUPLEES >.

Definition at line 171 of file superLatticeCoupling.h.

171 {
172 return _parameters;
173 }

◆ id()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
std::type_index olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >::id ( ) const
inlineoverridevirtual

Implements olb::AbstractBlockO.

Definition at line 167 of file superLatticeCoupling.h.

167 {
168 return typeid(COUPLER);
169 }

◆ set()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
void olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >::set ( CellID iCell,
bool state )
inlineoverridevirtual

Set whether iCell is covered by the present coupling.

By default the entire non-overlap block area is coupled.

Implements olb::AbstractCouplingO< COUPLEES >.

Definition at line 175 of file superLatticeCoupling.h.

176 {
177 if (!_mask) {
178 _mask = std::make_unique<ConcreteBlockMask<typename COUPLEES::values_t::template get<0>::value_t,
179 PLATFORM>>(
180 _lattices.template get<0>()->template getData<CollisionSubdomainMask>()
181 );
182 }
183 _mask->set(iCell, state);
184 }

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