OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::boundary::FullSlipO2D< NX, NY > Struct Template Reference

#include <slip2D.hh>

+ Collaboration diagram for olb::boundary::FullSlipO2D< NX, NY >:

Public Member Functions

int getPriority () const
 
template<typename CELL , typename V = typename CELL::value_t>
void apply (CELL &x_b) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCell
 

Detailed Description

template<int NX, int NY>
struct olb::boundary::FullSlipO2D< NX, NY >

Definition at line 38 of file slip2D.hh.

Member Function Documentation

◆ apply()

template<int NX, int NY>
template<typename CELL , typename V = typename CELL::value_t>
void olb::boundary::FullSlipO2D< NX, NY >::apply ( CELL & x_b)
inline

Definition at line 47 of file slip2D.hh.

47 {
48 using DESCRIPTOR = typename CELL::descriptor_t;
49 int reflectionPop[DESCRIPTOR::q];
50 int mirrorDirection0;
51 int mirrorDirection1;
52 int mult = 2 / (NX*NX + NY*NY);
53 reflectionPop[0] =0;
54 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
55 reflectionPop[iPop] = 0;
56 // iPop are the directions which pointing into the fluid, discreteNormal is pointing outwarts
58 if ( scalarProduct < 0) {
59 // bounce back for the case discreteNormalX = discreteNormalY = 1, that is mult=1
60 if (mult == 1) {
61 mirrorDirection0 = -descriptors::c<DESCRIPTOR>(iPop,0);
62 mirrorDirection1 = -descriptors::c<DESCRIPTOR>(iPop,1);
63 }
64 else {
65 mirrorDirection0 = descriptors::c<DESCRIPTOR>(iPop,0) - mult*scalarProduct*NX;
66 mirrorDirection1 = descriptors::c<DESCRIPTOR>(iPop,1) - mult*scalarProduct*NY;
67 }
68
69 // run through all lattice directions and look for match of direction
70 for (int i = 1; i < DESCRIPTOR::q; i++) {
71 if (descriptors::c<DESCRIPTOR>(i,0)==mirrorDirection0
72 && descriptors::c<DESCRIPTOR>(i,1)==mirrorDirection1) {
73 reflectionPop[iPop] = i;
74 break;
75 }
76 }
77 }
78 }
79 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
80 if (reflectionPop[iPop]!=0) {
81 //do reflection
82 x_b[iPop] = x_b[reflectionPop[iPop]];
83 }
84 }
85 }
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
T scalarProduct(const Vector< T, d > &u1, const Vector< T, d > &u2) any_platform
Definition util.h:191

References olb::descriptors::c().

+ Here is the call graph for this function:

◆ getPriority()

template<int NX, int NY>
int olb::boundary::FullSlipO2D< NX, NY >::getPriority ( ) const
inline

Definition at line 41 of file slip2D.hh.

41 {
42 return -1;
43 }

Member Data Documentation

◆ scope

template<int NX, int NY>
OperatorScope olb::boundary::FullSlipO2D< NX, NY >::scope = OperatorScope::PerCell
staticconstexpr

Definition at line 39 of file slip2D.hh.


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