OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::ConcreteBlockO< T, DESCRIPTOR, Platform::CPU_SISD, OPERATOR, OperatorScope::PerCell > Class Template Referencefinal

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

#include <operator.h>

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

Public Member Functions

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

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

Definition at line 300 of file operator.h.

Member Function Documentation

◆ apply()

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

Definition at line 323 of file operator.h.

324 {
325 if (_modified) {
326 std::sort(_cells.begin(), _cells.end());
327 _cells.erase(std::unique(_cells.begin(), _cells.end()), _cells.end());
328 _modified = false;
329 }
330 if (_cells.size() > 0) {
331 cpu::Cell<T,DESCRIPTOR,Platform::CPU_SISD> cell(block, 0);
332 #ifdef PARALLEL_MODE_OMP
333 #pragma omp parallel for schedule(static) firstprivate(cell)
334 #endif
335 for (CellID iCell : _cells) {
336 cell.setCellId(iCell);
337 OPERATOR().apply(cell);
338 }
339 }
340 }
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_SISD, OPERATOR, OperatorScope::PerCell >::id ( ) const
inlineoverridevirtual

Implements olb::AbstractBlockO.

Definition at line 307 of file operator.h.

308 {
309 return typeid(OPERATOR);
310 }

◆ set()

template<typename T , typename DESCRIPTOR , CONCEPT(CellOperator) OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::CPU_SISD, 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_SISD >.

Definition at line 312 of file operator.h.

313 {
314 if (state) {
315 _cells.emplace_back(iCell);
316 _modified = true;
317 }
318 }

◆ setup()

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

Definition at line 320 of file operator.h.

321 { }

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