OpenLB 1.7
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
olb::fd Namespace Reference

Namespaces

namespace  fdParams
 
namespace  tag
 

Classes

struct  AdNeumannZeroBoundaryScheme
 
struct  AdNeumannZeroBoundaryScheme< D, T, tag::CENTRAL >
 
struct  AdNeumannZeroBoundaryScheme< D, T, tag::UPWIND >
 
struct  AdvectionScheme
 
struct  AdvectionScheme< D, T, tag::CENTRAL >
 
struct  AdvectionScheme< D, T, tag::UPWIND >
 
struct  AdvectionScheme< D, T, tag::UPWIND_2_ORDER >
 
struct  DiffusionScheme
 
struct  DiffusionScheme< D, T, tag::CENTRAL >
 
struct  DiffusionScheme< D, T, tag::CENTRAL_WITH_ANTIDIFFUSIVITY >
 
struct  DirectedGradients2D
 
struct  DirectedGradients2D< T, DESCRIPTOR, direction, orientation, false >
 
struct  DirectedGradients2D< T, DESCRIPTOR, direction, orientation, true >
 
struct  DirectedGradients3D
 
struct  DirectedGradients3D< T, DESCRIPTOR, direction, orientation, deriveDirection, false >
 
struct  DirectedGradients3D< T, DESCRIPTOR, direction, orientation, deriveDirection, true >
 
struct  FdScheme
 

Functions

template<typename T , typename FIELD , typename CELL >
T * accessOld (CELL cell, std::size_t iT) any_platform
 
template<typename T , typename FIELD , typename CELL >
T * accessNew (CELL cell, std::size_t iT) any_platform
 
template<unsigned EXTENT>
constexpr unsigned getArrayPos (const unsigned iExt, const unsigned iD) any_platform
 
template<typename T >
constexpr T centralGradient (T u_p1, T u_m1) any_platform
 Second-order central gradient (u_p1 = u(x+1))
 
template<typename T >
constexpr T boundaryGradient (T u_0, T u_1, T u_2) any_platform
 Second-order asymmetric gradient (u_1 = u(x+1))
 
template<typename T >
constexpr T FSGradient (T u_0, T u_1, T u_2)
 Forward second-order first derivative.
 
template<typename T >
constexpr T BSGradient (T u_0, T u_1, T u_2)
 Backward second-order first derivative.
 
template<typename T >
constexpr T boundaryZeroGradient (T u_1, T u_2)
 Value at u_0 for which asymmetric gradient is zero (u_1 = u(x+1))
 
template<typename T >
constexpr T centralSecondDeriv (T u_m1, T u_0, T u_p1) any_platform
 Second order central second derivative (u_p1 = u(x+1))
 
template<typename T >
constexpr T centralSecondDeriv (T u_m2, T u_m1, T u_0, T u_p1, T u_p2) any_platform
 Forth order central second derivative (u_p1 = u(x+1))
 
template<typename T >
constexpr T linearInterpolate (T u_0, T u_1, T pos)
 Linear interpolation (yields u0 at pos=0 and u1 at pos=1)
 
template<typename T >
constexpr T d2u_dxdy (T u_xm1_ym1, T u_xm1_yp1, T u_xp1_ym1, T u_xp1_yp1) any_platform
 Second order mixed derivative (u_xp1_ym1 = u(x+1,y-1))
 
template<typename T >
constexpr T d2u_dxdy (T u_xm1_ym1, T u_xm1, T u_ym1, T u_0, T u_xp1, T u_yp1, T u_xp1_yp1) any_platform
 Second order mixed derivative (u_xp1_ym1 = u(x+1,y-1))
 
template<typename T >
constexpr T laplacian2D (T u_xm1, T u_ym1, T u_0, T u_xp1, T u_yp1) any_platform
 Second order Laplacian (u_xp1 = u(x+1,y))
 
template<typename T >
constexpr T laplacian2D (T u_xm2, T u_ym2, T u_xm1, T u_ym1, T u_0, T u_xp1, T u_yp1, T u_xp2, T u_yp2) any_platform
 Forth order Laplacian (u_xp1 = u(x+1,y))
 
template<typename T >
constexpr T laplacian3D (T u_xm1, T u_ym1, T u_zm1, T u_0, T u_xp1, T u_yp1, T u_zp1) any_platform
 Second order Laplacian (symmetric, u_xp1 = u(x+1,y,z))
 
template<typename T >
constexpr T laplacian3D (T u_xm2, T u_ym2, T u_zm2, T u_xm1, T u_ym1, T u_zm1, T u_0, T u_xp1, T u_yp1, T u_zp1, T u_xp2, T u_yp2, T u_zp2) any_platform
 Forth order Laplacian (symmetric, u_xp1 = u(x+1,y,z))
 

Function Documentation

◆ accessNew()

template<typename T , typename FIELD , typename CELL >
T * olb::fd::accessNew ( CELL cell,
std::size_t iT )

Definition at line 56 of file fdAccessFunctions.h.

57{
58 return &cell.template getFieldPointer<FIELD>()[(iT+1) % 2];
59}

◆ accessOld()

template<typename T , typename FIELD , typename CELL >
T * olb::fd::accessOld ( CELL cell,
std::size_t iT )

Definition at line 50 of file fdAccessFunctions.h.

51{
52 return &cell.template getFieldPointer<FIELD>()[iT % 2];
53}

◆ boundaryGradient()

template<typename T >
constexpr T olb::fd::boundaryGradient ( T u_0,
T u_1,
T u_2 )
constexpr

Second-order asymmetric gradient (u_1 = u(x+1))

Definition at line 42 of file finiteDifference.h.

43{
44 return (-T{3}*u_0 + T{4}*u_1 - T{1}*u_2) / T{2};
45}
+ Here is the caller graph for this function:

◆ boundaryZeroGradient()

template<typename T >
constexpr T olb::fd::boundaryZeroGradient ( T u_1,
T u_2 )
constexpr

Value at u_0 for which asymmetric gradient is zero (u_1 = u(x+1))

Definition at line 63 of file finiteDifference.h.

64{
65 return T{4}/T{3}*u_1 - T{1}/T{3}*u_2;
66}

◆ BSGradient()

template<typename T >
constexpr T olb::fd::BSGradient ( T u_0,
T u_1,
T u_2 )
constexpr

Backward second-order first derivative.

Definition at line 56 of file finiteDifference.h.

57{
58 return T{-1} * boundaryGradient(u_0, u_1, u_2);
59}

References boundaryGradient().

+ Here is the call graph for this function:

◆ centralGradient()

template<typename T >
constexpr T olb::fd::centralGradient ( T u_p1,
T u_m1 )
constexpr

Second-order central gradient (u_p1 = u(x+1))

Definition at line 35 of file finiteDifference.h.

36{
37 return (u_p1 - u_m1) / T{2};
38}
+ Here is the caller graph for this function:

◆ centralSecondDeriv() [1/2]

template<typename T >
constexpr T olb::fd::centralSecondDeriv ( T u_m1,
T u_0,
T u_p1 )
constexpr

Second order central second derivative (u_p1 = u(x+1))

Definition at line 74 of file finiteDifference.h.

75{
76 return u_m1 - T{2}*u_0 + u_p1;
77}
+ Here is the caller graph for this function:

◆ centralSecondDeriv() [2/2]

template<typename T >
constexpr T olb::fd::centralSecondDeriv ( T u_m2,
T u_m1,
T u_0,
T u_p1,
T u_p2 )
constexpr

Forth order central second derivative (u_p1 = u(x+1))

Definition at line 81 of file finiteDifference.h.

82{
83 return (- u_m2 + T{16}*u_m1 - T{30}*u_0 + T{16}*u_p1 - u_p2) / T{12};
84}

◆ d2u_dxdy() [1/2]

template<typename T >
constexpr T olb::fd::d2u_dxdy ( T u_xm1_ym1,
T u_xm1,
T u_ym1,
T u_0,
T u_xp1,
T u_yp1,
T u_xp1_yp1 )
constexpr

Second order mixed derivative (u_xp1_ym1 = u(x+1,y-1))

Definition at line 45 of file finiteDifference2D.h.

47{
48 return - (u_xp1 + u_yp1 + u_xm1 + u_ym1 - T{2}*u_0 - u_xp1_yp1 - u_xm1_ym1) / T{2};
49}

◆ d2u_dxdy() [2/2]

template<typename T >
constexpr T olb::fd::d2u_dxdy ( T u_xm1_ym1,
T u_xm1_yp1,
T u_xp1_ym1,
T u_xp1_yp1 )
constexpr

Second order mixed derivative (u_xp1_ym1 = u(x+1,y-1))

Definition at line 38 of file finiteDifference2D.h.

39{
40 return (u_xp1_yp1 - u_xp1_ym1 - u_xm1_yp1 + u_xm1_ym1) / T{4};
41}

◆ FSGradient()

template<typename T >
constexpr T olb::fd::FSGradient ( T u_0,
T u_1,
T u_2 )
constexpr

Forward second-order first derivative.

Definition at line 49 of file finiteDifference.h.

50{
51 return boundaryGradient(u_0, u_1, u_2);
52}
constexpr T boundaryGradient(T u_0, T u_1, T u_2) any_platform
Second-order asymmetric gradient (u_1 = u(x+1))

References boundaryGradient().

+ Here is the call graph for this function:

◆ getArrayPos()

template<unsigned EXTENT>
constexpr unsigned olb::fd::getArrayPos ( const unsigned iExt,
const unsigned iD )
constexpr

Definition at line 63 of file fdAccessFunctions.h.

64{
65 return iExt*EXTENT + iD;
66}

◆ laplacian2D() [1/2]

template<typename T >
constexpr T olb::fd::laplacian2D ( T u_xm1,
T u_ym1,
T u_0,
T u_xp1,
T u_yp1 )
constexpr

Second order Laplacian (u_xp1 = u(x+1,y))

Definition at line 53 of file finiteDifference2D.h.

54{
55 return u_xm1 + u_ym1 + u_xp1 + u_yp1 - T{4}*u_0;
56}

◆ laplacian2D() [2/2]

template<typename T >
constexpr T olb::fd::laplacian2D ( T u_xm2,
T u_ym2,
T u_xm1,
T u_ym1,
T u_0,
T u_xp1,
T u_yp1,
T u_xp2,
T u_yp2 )
constexpr

Forth order Laplacian (u_xp1 = u(x+1,y))

Definition at line 60 of file finiteDifference2D.h.

62{
63 return (-T{60}*u_0 + T{16}*(u_xm1 + u_ym1 + u_xp1 + u_yp1)
64 - (u_xm2 + u_ym2 + u_xp2 + u_yp2)) / T{12};
65}

◆ laplacian3D() [1/2]

template<typename T >
constexpr T olb::fd::laplacian3D ( T u_xm1,
T u_ym1,
T u_zm1,
T u_0,
T u_xp1,
T u_yp1,
T u_zp1 )
constexpr

Second order Laplacian (symmetric, u_xp1 = u(x+1,y,z))

Definition at line 39 of file finiteDifference3D.h.

40{
41 return u_xm1 + u_ym1 + u_zm1 + u_xp1 + u_yp1 + u_zp1 - T{6}*u_0;
42}

◆ laplacian3D() [2/2]

template<typename T >
constexpr T olb::fd::laplacian3D ( T u_xm2,
T u_ym2,
T u_zm2,
T u_xm1,
T u_ym1,
T u_zm1,
T u_0,
T u_xp1,
T u_yp1,
T u_zp1,
T u_xp2,
T u_yp2,
T u_zp2 )
constexpr

Forth order Laplacian (symmetric, u_xp1 = u(x+1,y,z))

Definition at line 46 of file finiteDifference3D.h.

48{
49 return (-T{90}*u_0 + T{16}*(u_xm1 + u_ym1 + u_zm1 + u_xp1 + u_yp1 + u_zp1)
50 - (u_xm2 + u_ym2 + u_zm2 + u_xp2 + u_yp2 + u_zp2)) / T{12};
51}

◆ linearInterpolate()

template<typename T >
constexpr T olb::fd::linearInterpolate ( T u_0,
T u_1,
T pos )
constexpr

Linear interpolation (yields u0 at pos=0 and u1 at pos=1)

Definition at line 92 of file finiteDifference.h.

93{
94 return (T{1}-pos)*u_0 + pos*u_1;
95}