OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::ConcreteBlockRefinementO< T, DESCRIPTOR, PLATFORM, OPERATOR > Struct Template Reference

#include <operator.h>

+ Collaboration diagram for olb::ConcreteBlockRefinementO< T, DESCRIPTOR, PLATFORM, OPERATOR >:

Public Member Functions

void apply (ConcreteBlockRefinementContextD< T, DESCRIPTOR, PLATFORM > &data)
 

Detailed Description

template<typename T, typename DESCRIPTOR, Platform PLATFORM, typename OPERATOR>
requires (isPlatformCPU(PLATFORM))
struct olb::ConcreteBlockRefinementO< T, DESCRIPTOR, PLATFORM, OPERATOR >

Definition at line 35 of file operator.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename OPERATOR >
void olb::ConcreteBlockRefinementO< T, DESCRIPTOR, PLATFORM, OPERATOR >::apply ( ConcreteBlockRefinementContextD< T, DESCRIPTOR, PLATFORM > & data)
inline

Definition at line 36 of file operator.h.

36 {
37 const auto& cellIdCoarse = data.getConcreteData().template getField<fields::refinement::CELL_ID_COARSE>();
38 const auto& cellIdFine = data.getConcreteData().template getField<fields::refinement::CELL_ID_FINE>();
39 auto parameters = data.getConcreteData().template getData<OperatorParameters<OPERATOR>>().parameters;
40
41 if constexpr (OPERATOR::scope == refinement::OperatorScope::PerCoarseCell) {
42 #ifdef PARALLEL_MODE_OMP
43 #pragma omp parallel for schedule(static)
44 #endif
45 for (CellID i=0; i < cellIdFine.getSize(); ++i) {
46 if (cellIdCoarse[0][i] != 0) {
47 cpu::Cell cCell{data.getCoarseLattice(), cellIdCoarse[0][i]};
48 cpu::Cell fCell{data.getFineLattice(), cellIdFine[0][i]};
49 cpu::Row cData{data.getConcreteData(), i};
50 OPERATOR().apply(cCell, fCell, cData, parameters);
51 }
52 }
53 } else if constexpr (OPERATOR::scope == refinement::OperatorScope::PerFineCell) {
54 if constexpr (OPERATOR::data::template contains<fields::refinement::CONTEXT_NEIGHBORS>()) {
55 #ifdef PARALLEL_MODE_OMP
56 #pragma omp parallel for schedule(static)
57 #endif
58 for (CellID i=0; i < cellIdFine.getSize(); ++i) {
59 cpu::Cell fCell{data.getFineLattice(), cellIdFine[0][i]};
60 refinement::CoarseCell cCell{cpu::Cell{data.getCoarseLattice(), cellIdCoarse[0][i]},
61 data.getFineLattice().getLatticeR(cellIdFine[0][i])};
62 refinement::ContextDataWithNeighbors cData{cpu::Row{data.getConcreteData(), i}};
63 OPERATOR().apply(cCell, fCell, cData, parameters);
64 }
65 } else {
66 #ifdef PARALLEL_MODE_OMP
67 #pragma omp parallel for schedule(static)
68 #endif
69 for (CellID i=0; i < cellIdFine.getSize(); ++i) {
70 cpu::Cell fCell{data.getFineLattice(), cellIdFine[0][i]};
71 refinement::CoarseCell cCell{cpu::Cell{data.getCoarseLattice(), cellIdCoarse[0][i]},
72 data.getFineLattice().getLatticeR(cellIdFine[0][i])};
73 refinement::ContextData cData{cpu::Row{data.getConcreteData(), i}};
74 OPERATOR().apply(cCell, fCell, cData, parameters);
75 }
76 }
77 }
78 }
#define OPERATOR(OP, rhs)
Definition aDiffTape.h:64
@ PerFineCell
OPERATOR is provided a fine cell and a coarse cell proxy.
@ PerCoarseCell
OPERATOR is provided a coarse cell and its co-incident fine cell.
std::uint32_t CellID
Type for sequential block-local cell indices.

References olb::ConcreteBlockRefinementContextD< T, DESCRIPTOR, PLATFORM >::getCoarseLattice(), olb::ConcreteBlockRefinementContextD< T, DESCRIPTOR, PLATFORM >::getConcreteData(), olb::ConcreteBlockRefinementContextD< T, DESCRIPTOR, PLATFORM >::getFineLattice(), OPERATOR, olb::refinement::PerCoarseCell, and olb::refinement::PerFineCell.

+ Here is the call graph for this function:

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