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

#include <finiteDifference2D.h>

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

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, false >

Definition at line 155 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, false >::interpolateScalar ( T & rhoDeriv,
BlockLattice< T, DESCRIPTOR > const & blockLattice,
int iX,
int iY )
inlinestatic

Definition at line 177 of file finiteDifference2D.h.

180 {
181 using namespace fd;
182
183 int deriveDirection = 1-direction;
184 T rho_p1 = blockLattice.get (
185 iX+(deriveDirection==0 ? 1:0),
186 iY+(deriveDirection==1 ? 1:0) ).computeRho();
187 T rho_m1 = blockLattice.get (
188 iX+(deriveDirection==0 ? (-1):0),
189 iY+(deriveDirection==1 ? (-1):0) ).computeRho();
190
191 rhoDeriv = centralGradient(rho_p1, rho_m1);
192
193 }
constexpr T centralGradient(T u_p1, T u_m1) any_platform
Second-order central gradient (u_p1 = u(x+1))

References olb::fd::centralGradient(), 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, false >::interpolateVector ( T velDeriv[DESCRIPTOR::d],
BlockLattice< T, DESCRIPTOR > const & blockLattice,
int iX,
int iY )
inlinestatic

Definition at line 156 of file finiteDifference2D.h.

159 {
160 using namespace fd;
161
162 T u_p1[DESCRIPTOR::d], u_m1[DESCRIPTOR::d];
163
164 int deriveDirection = 1-direction;
165 blockLattice.get (
166 iX+(deriveDirection==0 ? 1:0),
167 iY+(deriveDirection==1 ? 1:0) ).computeU(u_p1);
168 blockLattice.get (
169 iX+(deriveDirection==0 ? (-1):0),
170 iY+(deriveDirection==1 ? (-1):0) ).computeU(u_m1);
171
172 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
173 velDeriv[iD] = fd::centralGradient(u_p1[iD],u_m1[iD]);
174 }
175 }

References olb::fd::centralGradient(), 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, false >::interpolateVector ( T velDeriv[DESCRIPTOR::d],
CELL & cell )
inlinestatic

Definition at line 196 of file finiteDifference2D.h.

198 {
199 using namespace fd;
200
201 T u_p1[DESCRIPTOR::d], u_m1[DESCRIPTOR::d];
202
203 int deriveDirection = 1-direction;
204 cell.neighbor({(deriveDirection==0 ? 1:0),
205 (deriveDirection==1 ? 1:0)}).computeU(u_p1);
206 cell.neighbor({(deriveDirection==0 ? (-1):0),
207 (deriveDirection==1 ? (-1):0)}).computeU(u_m1);
208
209 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
210 velDeriv[iD] = centralGradient(u_p1[iD],u_m1[iD]);
211 }
212 }

References olb::fd::centralGradient().

+ Here is the call graph for this function:

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