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

#include <operator.h>

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

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

Definition at line 346 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::PerCellWithParameters >::apply ( ConcreteBlockLattice< T, DESCRIPTOR, Platform::CPU_SISD > & block)
inlineoverride

Definition at line 373 of file operator.h.

374 {
375 if (_modified) {
376 std::sort(_cells.begin(), _cells.end());
377 _cells.erase(std::unique(_cells.begin(), _cells.end()), _cells.end());
378 _modified = false;
379 }
380 if (_cells.size() > 0) {
381 cpu::Cell<T,DESCRIPTOR,Platform::CPU_SISD> cell(block, 0);
382 #ifdef PARALLEL_MODE_OMP
383 #pragma omp parallel for schedule(static) firstprivate(cell)
384 #endif
385 for (CellID iCell : _cells) {
386 cell.setCellId(iCell);
387 OPERATOR().apply(cell, *_parameters);
388 }
389 }
390 }
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::PerCellWithParameters >::id ( ) const
inlineoverridevirtual

Implements olb::AbstractBlockO.

Definition at line 355 of file operator.h.

356 {
357 return typeid(OPERATOR);
358 }

◆ set()

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

Definition at line 360 of file operator.h.

361 {
362 if (state) {
363 _cells.emplace_back(iCell);
364 _modified = true;
365 }
366 }

◆ setup()

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

Definition at line 368 of file operator.h.

369 {
370 _parameters = &block.template getData<OperatorParameters<OPERATOR>>().parameters;
371 }

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