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

Application of a cell-wise OPERATOR on a concrete vector CPU block. More...

#include <operator.h>

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

Public Member Functions

 ConcreteBlockO ()=default
 
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::CPU_SIMD > &block) override
 
void apply (ConcreteBlockLattice< T, DESCRIPTOR, Platform::CPU_SIMD > &block) override
 
- Public Member Functions inherited from olb::BlockO< T, DESCRIPTOR, Platform::CPU_SIMD >
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::CPU_SIMD, OPERATOR, OperatorScope::PerCell >

Application of a cell-wise OPERATOR on a concrete vector CPU block.

Definition at line 476 of file operator.h.

Constructor & Destructor Documentation

◆ ConcreteBlockO()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
olb::ConcreteBlockO< T, DESCRIPTOR, Platform::CPU_SIMD, OPERATOR, OperatorScope::PerCell >::ConcreteBlockO ( )
default

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::CPU_SIMD, OPERATOR, OperatorScope::PerCell >::apply ( ConcreteBlockLattice< T, DESCRIPTOR, Platform::CPU_SIMD > & block)
inlineoverride

Definition at line 506 of file operator.h.

507 {
508 if (_modified) {
509 std::sort(_cells.begin(), _cells.end());
510 _cells.erase(std::unique(_cells.begin(), _cells.end()), _cells.end());
511 _modified = false;
512 }
513 if (_cells.size() > 0) {
514 cpu::Cell<T,DESCRIPTOR,Platform::CPU_SIMD> cell(block, 0);
515 #ifdef PARALLEL_MODE_OMP
516 #pragma omp parallel for schedule(static) firstprivate(cell)
517 #endif
518 for (CellID iCell : _cells) {
519 cell.setCellId(iCell);
520 OPERATOR().apply(cell);
521 }
522 }
523 }
#define OPERATOR(OP, rhs)
Definition aDiffTape.h:64
std::uint32_t CellID
Type for sequential block-local cell indices.

References OPERATOR, and olb::cpu::Cell< T, DESCRIPTOR, PLATFORM >::setCellId().

+ Here is the call graph for this function:

◆ id()

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

Implements olb::AbstractBlockO.

Definition at line 485 of file operator.h.

486 {
487 return typeid(OPERATOR);
488 }

References OPERATOR.

◆ set()

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

Set whether iCell is covered by the operator (optional)

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

Definition at line 495 of file operator.h.

496 {
497 if (state) {
498 _cells.emplace_back(iCell);
499 _modified = true;
500 }
501 }

◆ setup()

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

Definition at line 503 of file operator.h.

504 { }

◆ weight()

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

Get number of cells covered by operator (optional)

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

Definition at line 490 of file operator.h.

491 {
492 return _cells.size();
493 }

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