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

#include <superLatticeCoupling.h>

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

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::PerCell >

Definition at line 38 of file superLatticeCoupling.h.

Constructor & Destructor Documentation

◆ ConcreteBlockCouplingO()

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

Definition at line 66 of file superLatticeCoupling.h.

66 :
67 _lattices{lattices}
68 { }

Member Function Documentation

◆ execute()

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

Execute coupling operation.

Implements olb::AbstractCouplingO< COUPLEES >.

Definition at line 89 of file superLatticeCoupling.h.

90 {
92 auto* lattice = _lattices.template get<0>();
93 if (_mask) {
94 #ifdef PARALLEL_MODE_OMP
95 #pragma omp parallel for schedule(static) collapse(1)
96 #endif
97 for (loc iX=0; iX < lattice->getNx(); ++iX) {
98 for (loc iY=0; iY < lattice->getNy(); ++iY) {
99 if constexpr (AbstractCouplingO<COUPLEES>::descriptor_t::d == 3) {
100 for (loc iZ=0; iZ < lattice->getNz(); ++iZ) {
101 if (_mask->operator[](lattice->getCellId(iX,iY,iZ))) {
102 execute({iX,iY,iZ});
103 }
104 }
105 } else {
106 if (_mask->operator[](lattice->getCellId(iX,iY))) {
107 execute({iX,iY});
108 }
109 }
110 }
111 }
112 } else {
113 #ifdef PARALLEL_MODE_OMP
114 #pragma omp parallel for schedule(static) collapse(1)
115 #endif
116 for (loc iX=0; iX < lattice->getNx(); ++iX) {
117 for (loc iY=0; iY < lattice->getNy(); ++iY) {
118 if constexpr (AbstractCouplingO<COUPLEES>::descriptor_t::d == 3) {
119 for (loc iZ=0; iZ < lattice->getNz(); ++iZ) {
120 execute({iX,iY,iZ});
121 }
122 } else {
123 execute({iX,iY});
124 }
125 }
126 }
127 }
128 }

◆ getParameters()

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

Return reference to parameters of coupling operator.

Implements olb::AbstractCouplingO< COUPLEES >.

Definition at line 74 of file superLatticeCoupling.h.

74 {
75 return _parameters;
76 }

◆ id()

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

Implements olb::AbstractBlockO.

Definition at line 70 of file superLatticeCoupling.h.

70 {
71 return typeid(COUPLER);
72 }

◆ set()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
void olb::ConcreteBlockCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCell >::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 78 of file superLatticeCoupling.h.

79 {
80 if (!_mask) {
81 _mask = std::make_unique<ConcreteBlockMask<typename COUPLEES::values_t::template get<0>::value_t,
82 PLATFORM>>(
83 _lattices.template get<0>()->template getData<CollisionSubdomainMask>()
84 );
85 }
86 _mask->set(iCell, state);
87 }

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