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

#include <operator.h>

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

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::PerCellWithParameters >

Definition at line 529 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::PerCellWithParameters >::ConcreteBlockO ( )
default

Member Function Documentation

◆ apply()

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

Definition at line 563 of file operator.h.

564 {
565 if (_modified) {
566 std::sort(_cells.begin(), _cells.end());
567 _cells.erase(std::unique(_cells.begin(), _cells.end()), _cells.end());
568 _modified = false;
569 }
570 if (_cells.size() > 0) {
571 cpu::Cell<T,DESCRIPTOR,Platform::CPU_SIMD> cell(block, 0);
572 #ifdef PARALLEL_MODE_OMP
573 #pragma omp parallel for schedule(static) firstprivate(cell)
574 #endif
575 for (CellID iCell : _cells) {
576 cell.setCellId(iCell);
577 OPERATOR().apply(cell, *_parameters);
578 }
579 }
580 }
#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::PerCellWithParameters >::id ( ) const
inlineoverridevirtual

Implements olb::AbstractBlockO.

Definition at line 540 of file operator.h.

541 {
542 return typeid(OPERATOR);
543 }

References OPERATOR.

◆ set()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::CPU_SIMD, OPERATOR, OperatorScope::PerCellWithParameters >::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 550 of file operator.h.

551 {
552 if (state) {
553 _cells.emplace_back(iCell);
554 _modified = true;
555 }
556 }

◆ setup()

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

Definition at line 558 of file operator.h.

559 {
560 _parameters = &block.template getData<OperatorParameters<OPERATOR>>().parameters;
561 }

◆ weight()

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

Get number of cells covered by operator (optional)

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

Definition at line 545 of file operator.h.

546 {
547 return _cells.size();
548 }

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