OpenLB 1.7
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
olb::fd::DirectedGradients2D< T, DESCRIPTOR, direction, orientation, true > Struct Template Reference

#include <finiteDifference2D.h>

+ Collaboration diagram for olb::fd::DirectedGradients2D< T, DESCRIPTOR, direction, orientation, true >:

Static Public Member Functions

static void interpolateVector (T velDeriv[DESCRIPTOR::d], BlockLattice< T, DESCRIPTOR > const &blockLattice, int iX, int iY)
 
static void interpolateScalar (T &rhoDeriv, BlockLattice< T, DESCRIPTOR > const &blockLattice, int iX, int iY)
 
template<typename CELL >
static void interpolateVector (T velDeriv[DESCRIPTOR::d], CELL &cell) any_platform
 

Detailed Description

template<typename T, typename DESCRIPTOR, int direction, int orientation>
struct olb::fd::DirectedGradients2D< T, DESCRIPTOR, direction, orientation, true >

Definition at line 90 of file finiteDifference2D.h.

Member Function Documentation

◆ interpolateScalar()

template<typename T , typename DESCRIPTOR , int direction, int orientation>
static void olb::fd::DirectedGradients2D< T, DESCRIPTOR, direction, orientation, true >::interpolateScalar ( T & rhoDeriv,
BlockLattice< T, DESCRIPTOR > const & blockLattice,
int iX,
int iY )
inlinestatic

Definition at line 112 of file finiteDifference2D.h.

115 {
116 using namespace fd;
117
118 T rho0 = blockLattice.get(iX,iY).computeRho();
119 T rho1 = blockLattice.get (
120 iX+(direction==0 ? (-orientation):0),
121 iY+(direction==1 ? (-orientation):0) ).computeRho();
122 T rho2 = blockLattice.get (
123 iX+(direction==0 ? (-2*orientation):0),
124 iY+(direction==1 ? (-2*orientation):0) ).computeRho();
125
126 rhoDeriv = -orientation * boundaryGradient(rho0, rho1, rho2);
127
128 }
constexpr T boundaryGradient(T u_0, T u_1, T u_2) any_platform
Second-order asymmetric gradient (u_1 = u(x+1))

References olb::fd::boundaryGradient(), and olb::BlockLattice< T, DESCRIPTOR >::get().

+ Here is the call graph for this function:

◆ interpolateVector() [1/2]

template<typename T , typename DESCRIPTOR , int direction, int orientation>
static void olb::fd::DirectedGradients2D< T, DESCRIPTOR, direction, orientation, true >::interpolateVector ( T velDeriv[DESCRIPTOR::d],
BlockLattice< T, DESCRIPTOR > const & blockLattice,
int iX,
int iY )
inlinestatic

Definition at line 91 of file finiteDifference2D.h.

94 {
95 using namespace fd;
96
97 T u0[DESCRIPTOR::d], u1[DESCRIPTOR::d], u2[DESCRIPTOR::d];
98
99 blockLattice.get(iX,iY).computeU(u0);
100 blockLattice.get (
101 iX+(direction==0 ? (-orientation):0),
102 iY+(direction==1 ? (-orientation):0) ).computeU(u1);
103 blockLattice.get (
104 iX+(direction==0 ? (-2*orientation):0),
105 iY+(direction==1 ? (-2*orientation):0) ).computeU(u2);
106
107 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
108 velDeriv[iD] = -orientation * boundaryGradient(u0[iD], u1[iD], u2[iD]);
109 }
110 }

References olb::fd::boundaryGradient(), and olb::BlockLattice< T, DESCRIPTOR >::get().

+ Here is the call graph for this function:

◆ interpolateVector() [2/2]

template<typename T , typename DESCRIPTOR , int direction, int orientation>
template<typename CELL >
static void olb::fd::DirectedGradients2D< T, DESCRIPTOR, direction, orientation, true >::interpolateVector ( T velDeriv[DESCRIPTOR::d],
CELL & cell )
inlinestatic

Definition at line 131 of file finiteDifference2D.h.

133 {
134 using namespace fd;
135
136 T u0[DESCRIPTOR::d], u1[DESCRIPTOR::d], u2[DESCRIPTOR::d];
137
138 cell.computeU(u0);
139 cell.neighbor({(direction==0 ? (-orientation):0),
140 (direction==1 ? (-orientation):0)}).computeU(u1);
141 cell.neighbor({(direction==0 ? (-2*orientation):0),
142 (direction==1 ? (-2*orientation):0)}).computeU(u2);
143
144 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
145 velDeriv[iD] = -orientation * boundaryGradient(u0[iD], u1[iD], u2[iD]);
146 }
147 }

References olb::fd::boundaryGradient().

+ Here is the call graph for this function:

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