OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters > Class Template Referencefinal

Application of a parametrized cell-wise OPERATOR on a concrete CUDA block. More...

#include <operator.h>

+ Inheritance diagram for olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >:
+ Collaboration diagram for olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >:

Public Member Functions

 ConcreteBlockO ()
 
std::type_index id () const override
 
std::size_t weight () const override
 Get number of cells covered by operator (optional)
 
void set (CellID iCell, bool state) override
 Set whether iCell is covered by the operator (optional)
 
void setup (ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > &block) override
 
void apply (ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > &block) override
 
- Public Member Functions inherited from olb::BlockO< T, DESCRIPTOR, Platform::GPU_CUDA >
virtual void setup (ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block)=0
 Setup operator context.
 
virtual void apply (ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block)=0
 Apply operator on block.
 
- Public Member Functions inherited from olb::AbstractBlockO
virtual ~AbstractBlockO ()=default
 

Detailed Description

template<typename T, typename DESCRIPTOR, concepts::CellOperator OPERATOR>
class olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >

Application of a parametrized cell-wise OPERATOR on a concrete CUDA block.

Definition at line 170 of file operator.h.

Constructor & Destructor Documentation

◆ ConcreteBlockO()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >::ConcreteBlockO ( )

Definition at line 669 of file operator.hh.

669 :
670 _cells(0),
671 _modified{false},
672 _stream{cudaStreamDefault}
673{ }

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >::apply ( ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > & block)
override

Definition at line 676 of file operator.hh.

678{
679 if (_cells.size() > 0) {
680 if (_modified) {
681 _cells.deduplicate();
683 _modified = false;
684 }
685 using namespace gpu::cuda;
686 DeviceBlockLattice<T,DESCRIPTOR> lattice(block);
688 lattice,
689 _cells,
690 ListedPostProcessorWithParameters<T,DESCRIPTOR,OPERATOR>{_parameters->parameters});
691 }
692}
void deduplicate()
Combined ascending sort and removal of duplicate entries.
Definition column.hh:109
void setProcessingContext(ProcessingContext)
Definition column.hh:158
std::size_t size() const override
Definition column.hh:128
void async_call_list_operators(cudaStream_t stream, CONTEXT &lattice, const gpu::cuda::Column< CellID > &cells, ARGS &&... args)
Apply operators to listed cell indices (async version)
Definition operator.hh:483
@ Simulation
Data available on host for e.g. functor evaluation.

References olb::Simulation.

◆ id()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
std::type_index olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >::id ( ) const
inlineoverridevirtual

Implements olb::AbstractBlockO.

Definition at line 183 of file operator.h.

184 {
185 return typeid(OPERATOR);
186 }
#define OPERATOR(OP, rhs)
Definition aDiffTape.h:64

References OPERATOR.

◆ set()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >::set ( CellID iCell,
bool state )
inlineoverridevirtual

Set whether iCell is covered by the operator (optional)

Implements olb::BlockO< T, DESCRIPTOR, Platform::GPU_CUDA >.

Definition at line 193 of file operator.h.

194 {
195 if (state) {
196 _cells.push_back(iCell);
197 _modified = true;
198 }
199 }
void push_back(T value)
Definition column.hh:102

References olb::gpu::cuda::Column< T >::push_back().

+ Here is the call graph for this function:

◆ setup()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >::setup ( ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > & block)
inlineoverride

Definition at line 201 of file operator.h.

202 {
203 _modified = false;
204 _parameters = &block.template getData<OperatorParameters<OPERATOR>>();
205 }

◆ weight()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
std::size_t olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCellWithParameters >::weight ( ) const
inlineoverridevirtual

Get number of cells covered by operator (optional)

Implements olb::BlockO< T, DESCRIPTOR, Platform::GPU_CUDA >.

Definition at line 188 of file operator.h.

189 {
190 return _cells.size();
191 }

References olb::gpu::cuda::Column< T >::size().

+ Here is the call graph for this function:

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