OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::BlockRefinementOperatorPromise< T, DESCRIPTOR > Class Template Reference

Untyped promise to execute some block refinement operator. More...

#include <operatorPromise.h>

+ Collaboration diagram for olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >:

Public Member Functions

template<typename OPERATOR >
 BlockRefinementOperatorPromise (meta::id< OPERATOR >)
 
std::set< FieldTypePromise< T, refinement::DATA_DESCRIPTOR< DESCRIPTOR > > > requiredData () const
 
bool requiresContextNeighborAccess () const
 
std::type_index id () const
 
void apply (BlockRefinementContextD< T, DESCRIPTOR > &context)
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >

Untyped promise to execute some block refinement operator.

Definition at line 33 of file operatorPromise.h.

Constructor & Destructor Documentation

◆ BlockRefinementOperatorPromise()

template<typename T , typename DESCRIPTOR >
template<typename OPERATOR >
olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >::BlockRefinementOperatorPromise ( meta::id< OPERATOR > )
inline

Definition at line 42 of file operatorPromise.h.

42 :
43 _executor([](BlockRefinementContextD<T,DESCRIPTOR>& context) {
44 switch (context.getPlatform()) {
45#ifdef PLATFORM_CPU_SISD
47 ConcreteBlockRefinementO<T,DESCRIPTOR,Platform::CPU_SISD,OPERATOR>().apply(
48 context.template asConcrete<Platform::CPU_SISD>());
49 break;
50#endif
51#ifdef PLATFORM_CPU_SIMD
53 ConcreteBlockRefinementO<T,DESCRIPTOR,Platform::CPU_SIMD,OPERATOR>().apply(
54 context.template asConcrete<Platform::CPU_SIMD>());
55 break;
56#endif
57#ifdef PLATFORM_GPU_CUDA
59 ConcreteBlockRefinementO<T,DESCRIPTOR,Platform::GPU_CUDA,OPERATOR>().apply(
60 context.template asConcrete<Platform::GPU_CUDA>());
61 break;
62#endif
63 default:
64 throw std::runtime_error("Refinement executor not implemented for PLATFORM");
65 }
66 }),
67 _requiredData([]() -> std::set<FieldTypePromise<T,refinement::DATA_DESCRIPTOR<DESCRIPTOR>>> {
68 std::set<FieldTypePromise<T,refinement::DATA_DESCRIPTOR<DESCRIPTOR>>> fields;
69 OPERATOR::data::for_each([&fields](auto id) {
70 fields.emplace(meta::id<Array<decltype(id.get())>>{});
71 });
72 return fields;
73 }),
74 _requiresContextNeigborAccess{
75 OPERATOR::data::template contains<fields::refinement::CONTEXT_NEIGHBORS>()
76 },
77 _operatorId{typeid(OPERATOR)}
78 { }
#define OPERATOR(OP, rhs)
Definition aDiffTape.h:64
int get()
Get current device.
Definition device.hh:71
descriptors::LATTICE_DESCRIPTOR< DESCRIPTOR::d, DESCRIPTOR::q, fields::refinement::CELL_ID_COARSE, fields::refinement::CELL_ID_FINE > DATA_DESCRIPTOR
Definition fields.h:81
@ CPU_SIMD
Basic scalar CPU.
@ GPU_CUDA
Vector CPU (AVX2 / AVX-512 collision)

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR >
void olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >::apply ( BlockRefinementContextD< T, DESCRIPTOR > & context)
inline

Definition at line 92 of file operatorPromise.h.

92 {
93 for (auto promise : requiredData()) {
94 promise.ensureAvailabilityIn(context.getData());
95 }
96 _executor(context);
97 }
std::set< FieldTypePromise< T, refinement::DATA_DESCRIPTOR< DESCRIPTOR > > > requiredData() const

References olb::BlockRefinementContextD< T, DESCRIPTOR >::getData(), and olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >::requiredData().

+ Here is the call graph for this function:

◆ id()

template<typename T , typename DESCRIPTOR >
std::type_index olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >::id ( ) const
inline

Definition at line 88 of file operatorPromise.h.

88 {
89 return _operatorId;
90 }

◆ requiredData()

template<typename T , typename DESCRIPTOR >
std::set< FieldTypePromise< T, refinement::DATA_DESCRIPTOR< DESCRIPTOR > > > olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >::requiredData ( ) const
inline

Definition at line 80 of file operatorPromise.h.

80 {
81 return _requiredData();
82 }
+ Here is the caller graph for this function:

◆ requiresContextNeighborAccess()

template<typename T , typename DESCRIPTOR >
bool olb::BlockRefinementOperatorPromise< T, DESCRIPTOR >::requiresContextNeighborAccess ( ) const
inline

Definition at line 84 of file operatorPromise.h.

84 {
85 return _requiresContextNeigborAccess;
86 }

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