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

#include <finiteDifference3D.h>

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

Static Public Member Functions

static bool canInterpolateVector (BlockLattice< T, DESCRIPTOR > const &blockLattice, int iX, int iY, int iZ)
 
static void interpolateVector (T velDeriv[DESCRIPTOR::d], BlockLattice< T, DESCRIPTOR > const &blockLattice, int iX, int iY, int iZ)
 
static void interpolateScalar (T &rhoDeriv, BlockLattice< T, DESCRIPTOR > const &blockLattice, int iX, int iY, int iZ)
 
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, int deriveDirection>
struct olb::fd::DirectedGradients3D< T, DESCRIPTOR, direction, orientation, deriveDirection, true >

Definition at line 75 of file finiteDifference3D.h.

Member Function Documentation

◆ canInterpolateVector()

template<typename T , typename DESCRIPTOR , int direction, int orientation, int deriveDirection>
static bool olb::fd::DirectedGradients3D< T, DESCRIPTOR, direction, orientation, deriveDirection, true >::canInterpolateVector ( BlockLattice< T, DESCRIPTOR > const & blockLattice,
int iX,
int iY,
int iZ )
inlinestatic

Definition at line 77 of file finiteDifference3D.h.

79 {
80 return blockLattice.isInside(iX,iY,iZ)
81 && blockLattice.isInside(iX+(direction==0 ? (-orientation):0),
82 iY+(direction==1 ? (-orientation):0),
83 iZ+(direction==2 ? (-orientation):0))
84 && blockLattice.isInside(iX+(direction==0 ? (-2*orientation):0),
85 iY+(direction==1 ? (-2*orientation):0),
86 iZ+(direction==2 ? (-2*orientation):0));
87 }

References olb::BlockStructureD< D >::isInside().

+ Here is the call graph for this function:

◆ interpolateScalar()

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

Definition at line 112 of file finiteDifference3D.h.

115 {
116 using namespace fd;
117
118 // note that the derivative runs along direction.
119 T rho0 = blockLattice.get(iX,iY,iZ).computeRho();
120 T rho1 = blockLattice.get (
121 iX+(direction==0 ? (-orientation):0),
122 iY+(direction==1 ? (-orientation):0),
123 iZ+(direction==2 ? (-orientation):0) ).computeRho();
124 T rho2 = blockLattice.get (
125 iX+(direction==0 ? (-2*orientation):0),
126 iY+(direction==1 ? (-2*orientation):0),
127 iZ+(direction==2 ? (-2*orientation):0) ).computeRho();
128
129 rhoDeriv = -orientation * boundaryGradient(rho0, rho1, rho2);
130 }
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, int deriveDirection>
static void olb::fd::DirectedGradients3D< T, DESCRIPTOR, direction, orientation, deriveDirection, true >::interpolateVector ( T velDeriv[DESCRIPTOR::d],
BlockLattice< T, DESCRIPTOR > const & blockLattice,
int iX,
int iY,
int iZ )
inlinestatic

Definition at line 89 of file finiteDifference3D.h.

92 {
93 using namespace fd;
94
95 T u0[DESCRIPTOR::d], u1[DESCRIPTOR::d], u2[DESCRIPTOR::d];
96
97 blockLattice.get(iX,iY,iZ).computeU(u0);
98 blockLattice.get (
99 iX+(direction==0 ? (-orientation):0),
100 iY+(direction==1 ? (-orientation):0),
101 iZ+(direction==2 ? (-orientation):0) ).computeU(u1);
102 blockLattice.get (
103 iX+(direction==0 ? (-2*orientation):0),
104 iY+(direction==1 ? (-2*orientation):0),
105 iZ+(direction==2 ? (-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, int deriveDirection>
template<typename CELL >
static void olb::fd::DirectedGradients3D< T, DESCRIPTOR, direction, orientation, deriveDirection, true >::interpolateVector ( T velDeriv[DESCRIPTOR::d],
CELL & cell )
inlinestatic

Definition at line 133 of file finiteDifference3D.h.

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

References olb::fd::boundaryGradient().

+ Here is the call graph for this function:

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