OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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
 
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, CONCEPT(CellOperator) OPERATOR>
class olb::ConcreteBlockO< T, DESCRIPTOR, Platform::CPU_SIMD, OPERATOR, OperatorScope::PerCellWithParameters >

Definition at line 508 of file operator.h.

Constructor & Destructor Documentation

◆ ConcreteBlockO()

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

Member Function Documentation

◆ apply()

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

538 {
539 if (_modified) {
540 std::sort(_cells.begin(), _cells.end());
541 _cells.erase(std::unique(_cells.begin(), _cells.end()), _cells.end());
542 _modified = false;
543 }
544 if (_cells.size() > 0) {
545 cpu::Cell<T,DESCRIPTOR,Platform::CPU_SIMD> cell(block, 0);
546 #ifdef PARALLEL_MODE_OMP
547 #pragma omp parallel for schedule(static) firstprivate(cell)
548 #endif
549 for (CellID iCell : _cells) {
550 cell.setCellId(iCell);
551 OPERATOR().apply(cell, *_parameters);
552 }
553 }
554 }
std::uint32_t CellID
Type for sequential block-local cell indices.

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

+ Here is the call graph for this function:

◆ id()

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

Implements olb::AbstractBlockO.

Definition at line 519 of file operator.h.

520 {
521 return typeid(OPERATOR);
522 }

◆ set()

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

525 {
526 if (state) {
527 _cells.emplace_back(iCell);
528 _modified = true;
529 }
530 }

◆ setup()

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

533 {
534 _parameters = &block.template getData<OperatorParameters<OPERATOR>>().parameters;
535 }

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