OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::ConcreteBlockPointCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters > Class Template Referencefinal

#include <superLatticePointCoupling.h>

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

Public Member Functions

template<typename LATTICES >
 ConcreteBlockPointCouplingO (LATTICES &&lattices, Cuboid< typename AbstractCouplingO< COUPLEES >::value_t, AbstractCouplingO< COUPLEES >::descriptor_t::d > &cuboid)
 
std::type_index id () const override
 
AbstractCouplingO< COUPLEES >::AbstractParameters & getParameters () override
 Return reference to parameters of coupling operator.
 
void execute () override
 Execute coupling operation.
 
void set (CellID iCell, bool state) override
 Set whether iCell is covered by the present coupling.
 
- Public Member Functions inherited from olb::AbstractCouplingO< COUPLEES >
- 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::ConcreteBlockPointCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >

Definition at line 37 of file superLatticePointCoupling.h.

Constructor & Destructor Documentation

◆ ConcreteBlockPointCouplingO()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
template<typename LATTICES >
olb::ConcreteBlockPointCouplingO< COUPLEES, PLATFORM, COUPLER, OperatorScope::PerCellWithParameters >::ConcreteBlockPointCouplingO ( LATTICES && lattices,
Cuboid< typename AbstractCouplingO< COUPLEES >::value_t, AbstractCouplingO< COUPLEES >::descriptor_t::d > & cuboid )
inline

Definition at line 70 of file superLatticePointCoupling.h.

72 :
73 _lattices{lattices},
74 _cuboid{cuboid},
75 _parameters{}
76 { }

Member Function Documentation

◆ execute()

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

Execute coupling operation.

Implements olb::AbstractCouplingO< COUPLEES >.

Definition at line 86 of file superLatticePointCoupling.h.

87 {
88 using V = typename AbstractCouplingO<COUPLEES>::value_t;
89 using DESCRIPTOR = typename AbstractCouplingO<COUPLEES>::descriptor_t;
90 auto* points = _lattices.get(meta::id<names::Points>{});
91 const auto originR = _parameters.template get<fields::BLOCK_LOWER>();
92 const auto deltaX = _parameters.template get<fields::converter::PHYS_DELTA_X>();
93 #ifdef PARALLEL_MODE_OMP
94 #pragma omp parallel for schedule(static)
95 #endif
96 for (CellID iP=0; iP < points->getNcells(); ++iP) {
97 const auto physR = points->template getField<fields::PHYS_R>().get(iP);
98 const LatticeR<DESCRIPTOR::d> latticeR = util::floor((physR - originR) / deltaX + V{0.5});
99 const CellID iCell = _lattices.template get<0>()->getCellId(latticeR);
100 auto cells = _lattices.exchange_values([&](auto name) -> auto {
101 if constexpr (std::is_same_v<typename decltype(name)::type, names::Points>) {
102 return cpu::Row{*_lattices.get(name), iP};
103 } else {
104 return cpu::Cell{*_lattices.get(name), iCell};
105 }
106 });
107 COUPLER().apply(cells, _parameters);
108 }
109 }
std::string name()
Returns name of FIELD for human consumption.
Definition fields.h:49
ADf< T, DIM > floor(const ADf< T, DIM > &a)
Definition aDiff.h:869
std::uint32_t CellID
Type for sequential block-local cell indices.
olb::LatticeR< descriptor_t::d > LatticeR
Definition operator.h:117
typename COUPLEES::values_t::template get< 0 >::descriptor_t descriptor_t
Descriptor type used for coupling parameters.
Definition operator.h:112
typename COUPLEES::values_t::template get< 0 >::value_t value_t
Value type used for coupling parameters.
Definition operator.h:110
constexpr auto & get() any_platform
Access Ith element.
constexpr auto exchange_values(F f) any_platform
Returns new TypeIndexedTuple with same keys but values generated by f(key)

References olb::util::floor().

+ Here is the call graph for this function:

◆ getParameters()

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

Return reference to parameters of coupling operator.

Implements olb::AbstractCouplingO< COUPLEES >.

Definition at line 82 of file superLatticePointCoupling.h.

82 {
83 return _parameters;
84 }

◆ id()

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

Implements olb::AbstractBlockO.

Definition at line 78 of file superLatticePointCoupling.h.

78 {
79 return typeid(COUPLER);
80 }

◆ set()

template<typename COUPLER , typename COUPLEES , Platform PLATFORM>
void olb::ConcreteBlockPointCouplingO< 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 111 of file superLatticePointCoupling.h.

111 {
112 throw std::bad_function_call();
113 }

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