OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE > Class Template Referencefinal

#include <fdBoundaryPostProcessors2D.h>

+ Inheritance diagram for olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >:
+ Collaboration diagram for olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >:

Public Types

using parameters = PARAMS
 

Public Member Functions

 FdBoundaryPostProcessor2D ()
 
int getPriority () const
 
template<typename CELL , typename PARAMETERS >
void apply (CELL &cell, PARAMETERS &vars) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCellWithParameters
 

Additional Inherited Members

- Protected Member Functions inherited from olb::FdBasePostProcessor2D< T, DESCRIPTOR, FIELD, SOURCE >
 FdBasePostProcessor2D ()
 
template<typename CELL >
void applySourceTerm (T *fNew, CELL &cell) any_platform
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename MODEL, typename SCHEME_BOUND, typename PARAMS, typename FIELD = descriptors::AD_FIELD, typename SOURCE = void>
class olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >

Definition at line 37 of file fdBoundaryPostProcessors2D.h.

Member Typedef Documentation

◆ parameters

template<typename T , typename DESCRIPTOR , typename MODEL , typename SCHEME_BOUND , typename PARAMS , typename FIELD = descriptors::AD_FIELD, typename SOURCE = void>
using olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >::parameters = PARAMS

Definition at line 39 of file fdBoundaryPostProcessors2D.h.

Constructor & Destructor Documentation

◆ FdBoundaryPostProcessor2D()

template<typename T , typename DESCRIPTOR , typename MODEL , typename SCHEME_BOUND , typename PARAMS , typename FIELD , typename SOURCE >
olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >::FdBoundaryPostProcessor2D ( )

Definition at line 33 of file fdBoundaryPostProcessors2D.hh.

34 : FdBasePostProcessor2D<T,DESCRIPTOR,FIELD,SOURCE>()
35{
36 OLB_PRECONDITION( DESCRIPTOR::template provides<descriptors::NORMAL_X>() );
37 OLB_PRECONDITION( DESCRIPTOR::template provides<descriptors::NORMAL_Y>() );
38}
#define OLB_PRECONDITION(COND)
Definition olbDebug.h:46

References OLB_PRECONDITION.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , typename MODEL , typename SCHEME_BOUND , typename PARAMS , typename FIELD , typename SOURCE >
template<typename CELL , typename PARAMETERS >
void olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >::apply ( CELL & cell,
PARAMETERS & vars )

Definition at line 48 of file fdBoundaryPostProcessors2D.hh.

49{
50 int normalX = (int)( cell.template getField<descriptors::NORMAL_X>() );
51 int normalY = (int)( cell.template getField<descriptors::NORMAL_Y>() );
52 if (normalX!=0 || normalY!=0) { // does absolutely nothing if the cell does not belong to a border
53 constexpr int extraExtent = MODEL::extent() + SCHEME_BOUND::getExtraExtent();
54 std::size_t iT = vars.template get<fd::fdParams::Timestep>();
55 T f[MODEL::extent()*DESCRIPTOR::d], F[MODEL::extent()*DESCRIPTOR::d];
56 T fGhost[MODEL::extent()*DESCRIPTOR::d], fNormal[extraExtent*DESCRIPTOR::d];
57 T u[DESCRIPTOR::d];
58 int normal[] {normalX, normalY};
59 std::fill(std::begin(fGhost), std::end(fGhost), 0);
60 T* fNew = fd::accessNew<T,FIELD>(cell, iT);
61 T* f0 = fd::accessOld<T,FIELD>(cell, iT);
62 for (int iN=1; iN<=extraExtent; ++iN) {
63 fNormal[fd::getArrayPos<extraExtent>(iN-1,0)] = *fd::accessOld<T,FIELD>( cell.neighbor({normalX*iN, 0}), iT );
64 fNormal[fd::getArrayPos<extraExtent>(iN-1,1)] = *fd::accessOld<T,FIELD>( cell.neighbor({ 0, normalY*iN}), iT );
65 }
66 cell.computeU(u);
67 SCHEME_BOUND::apply(fGhost, *f0, fNormal, normal, u, vars);
68 for (int iN=1; iN<=MODEL::extent(); ++iN) {
69 f[fd::getArrayPos<MODEL::extent()>(iN-1,0)] = normalX<=0 ? *fd::accessOld<T,FIELD>( cell.neighbor({-iN, 0}), iT )
70 : fGhost[fd::getArrayPos<MODEL::extent()+SCHEME_BOUND::getExtraExtent()>(iN-1,0)];
71 F[fd::getArrayPos<MODEL::extent()>(iN-1,0)] = normalX>=0 ? *fd::accessOld<T,FIELD>( cell.neighbor({+iN, 0}), iT )
72 : fGhost[fd::getArrayPos<MODEL::extent()+SCHEME_BOUND::getExtraExtent()>(iN-1,0)];
73 f[fd::getArrayPos<MODEL::extent()>(iN-1,1)] = normalY<=0 ? *fd::accessOld<T,FIELD>( cell.neighbor({ 0, -iN}), iT )
74 : fGhost[fd::getArrayPos<MODEL::extent()+SCHEME_BOUND::getExtraExtent()>(iN-1,1)];
75 F[fd::getArrayPos<MODEL::extent()>(iN-1,1)] = normalY>=0 ? *fd::accessOld<T,FIELD>( cell.neighbor({ 0, +iN}), iT )
76 : fGhost[fd::getArrayPos<MODEL::extent()+SCHEME_BOUND::getExtraExtent()>(iN-1,1)];
77 }
78 MODEL::apply(fNew, f0, f, F, u, vars);
79 this->applySourceTerm(fNew, cell);
80 }
81}
void applySourceTerm(T *fNew, CELL &cell) any_platform
constexpr unsigned getArrayPos(const unsigned iExt, const unsigned iD) any_platform

◆ getPriority()

template<typename T , typename DESCRIPTOR , typename MODEL , typename SCHEME_BOUND , typename PARAMS , typename FIELD , typename SOURCE >
int olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >::getPriority ( ) const

Definition at line 41 of file fdBoundaryPostProcessors2D.hh.

42{
43 return 1;
44}

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR , typename MODEL , typename SCHEME_BOUND , typename PARAMS , typename FIELD = descriptors::AD_FIELD, typename SOURCE = void>
constexpr OperatorScope olb::FdBoundaryPostProcessor2D< T, DESCRIPTOR, MODEL, SCHEME_BOUND, PARAMS, FIELD, SOURCE >::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 40 of file fdBoundaryPostProcessors2D.h.


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