OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM > Class Template Reference

Map of post processors of a single priority and stage. More...

#include <blockPostProcessorMap.h>

+ Collaboration diagram for olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >:

Public Member Functions

 BlockPostProcessorMap (ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > *lattice)
 
void addLegacy (PostProcessor< T, DESCRIPTOR > *postProcessor)
 
void add (std::size_t iCell, PostProcessorPromise< T, DESCRIPTOR > &&promise)
 Schedule post processor for application at iCell.
 
void add (PostProcessorPromise< T, DESCRIPTOR > &&promise)
 Add post processor to map, do nothing if it already exists.
 
bool contains (PostProcessorPromise< T, DESCRIPTOR > &&promise) const
 Returns true if map contains post processor.
 
void apply ()
 Apply all managed post processors to lattice.
 

Detailed Description

template<typename T, typename DESCRIPTOR, Platform PLATFORM>
class olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >

Map of post processors of a single priority and stage.

Maintained in ConcreteBlockLattice

Definition at line 160 of file blockPostProcessorMap.h.

Constructor & Destructor Documentation

◆ BlockPostProcessorMap()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >::BlockPostProcessorMap ( ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > * lattice)
inline

Definition at line 192 of file blockPostProcessorMap.h.

192 :
193 _lattice{*lattice}
194 { }

Member Function Documentation

◆ add() [1/2]

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >::add ( PostProcessorPromise< T, DESCRIPTOR > && promise)
inline

Add post processor to map, do nothing if it already exists.

Definition at line 208 of file blockPostProcessorMap.h.

209 {
210 resolve(std::forward<decltype(promise)>(promise));
211 }

◆ add() [2/2]

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >::add ( std::size_t iCell,
PostProcessorPromise< T, DESCRIPTOR > && promise )
inline

Schedule post processor for application at iCell.

Definition at line 202 of file blockPostProcessorMap.h.

203 {
204 resolve(std::forward<decltype(promise)>(promise)).set(iCell, true);
205 }

◆ addLegacy()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >::addLegacy ( PostProcessor< T, DESCRIPTOR > * postProcessor)
inline

Definition at line 196 of file blockPostProcessorMap.h.

197 {
198 _legacyPostProcessors.add(postProcessor);
199 }

References olb::LegacyBlockPostProcessorO< T, DESCRIPTOR, PLATFORM >::add().

+ Here is the call graph for this function:

◆ apply()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
void olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >::apply ( )
inline

Apply all managed post processors to lattice.

All post processors within a single BlockPostProcessorMap should be expected to be executed in parallel as far as feasible. E.g. (non-)legacy post processors on CPU blocks are parallelized using OpenMP if enabled while per-cell operators on GPU blocks are parallelized both on the level of kernels and by running multiple kernels asynchronously in separate streams.

In general, interdependent post processors should be separated into different priorities (not doing so also works in many cases but leads to non-deterministic data relationships).

Definition at line 231 of file blockPostProcessorMap.h.

232 {
233 _legacyPostProcessors.apply(_lattice);
234
235 for (auto& [_, postProcessor] : _map) {
236 postProcessor->apply(_lattice);
237 }
238
239 #ifdef PLATFORM_GPU_CUDA
241 #endif
242 }
void synchronize()
Synchronize device.
Definition device.hh:64

References olb::LegacyBlockPostProcessorO< T, DESCRIPTOR, PLATFORM >::apply(), and olb::gpu::cuda::device::synchronize().

+ Here is the call graph for this function:

◆ contains()

template<typename T , typename DESCRIPTOR , Platform PLATFORM>
bool olb::BlockPostProcessorMap< T, DESCRIPTOR, PLATFORM >::contains ( PostProcessorPromise< T, DESCRIPTOR > && promise) const
inline

Returns true if map contains post processor.

Definition at line 214 of file blockPostProcessorMap.h.

215 {
216 return _map.find(promise.id()) != _map.end();
217 }

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