OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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
 
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, CONCEPT(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 158 of file operator.h.

Constructor & Destructor Documentation

◆ ConcreteBlockO()

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

Definition at line 598 of file operator.hh.

598 :
599 _cells(0),
600 _modified{false},
601 _stream{cudaStreamDefault}
602{ }

Member Function Documentation

◆ apply()

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

Definition at line 605 of file operator.hh.

607{
608 if (_cells.size() > 0) {
609 if (_modified) {
610 _cells.deduplicate();
612 _modified = false;
613 }
614 using namespace gpu::cuda;
615 DeviceBlockLattice<T,DESCRIPTOR> lattice(block);
617 lattice,
618 _cells,
619 ListedPostProcessorWithParameters<T,DESCRIPTOR,OPERATOR>{_parameters->parameters});
620 }
621}
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
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:423
@ Simulation
Data available on host for e.g. functor evaluation.

References olb::Simulation.

◆ id()

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

Implements olb::AbstractBlockO.

Definition at line 171 of file operator.h.

172 {
173 return typeid(OPERATOR);
174 }

◆ set()

template<typename T , typename DESCRIPTOR , CONCEPT(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 176 of file operator.h.

177 {
178 if (state) {
179 _cells.push_back(iCell);
180 _modified = true;
181 }
182 }
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 , CONCEPT(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 184 of file operator.h.

185 {
186 _modified = false;
187 _parameters = &block.template getData<OperatorParameters<OPERATOR>>();
188 }

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