7#ifndef LBLATTICEDESCRIPTOR_H
8#define LBLATTICEDESCRIPTOR_H
27inline constexpr MInt dirFld2[3][3] = {{6, 0, 7}, {2, 8, 3}, {5, 1, 4}};
28inline constexpr MInt dirFld3[3][3][3] = {{{18, 6, 19}, {10, 0, 11}, {20, 7, 21}},
29 {{14, 2, 15}, {4, 26, 5}, {16, 3, 17}},
30 {{22, 8, 23}, {12, 1, 13}, {24, 9, 25}}};
48inline constexpr MInt mFld2[24] = {0, 2, 4, 0, 2, 5, 0, 3, 4, 0, 3, 5, 1, 2, 4, 1, 2, 5, 1, 3, 4, 1, 3, 5};
71template <MInt D, MInt Q>
75template <MInt D, MInt Q>
79template <MInt D, MInt Q>
83template <MInt D, MInt Q>
91inline constexpr MInt idFld<2>[9][2] = {{0, 1}, {2, 1}, {1, 0}, {1, 2}, {2, 2}, {2, 0}, {0, 0}, {0, 2}, {1, 1}};
99 {F3B16, F1B16, F9B16, F3B16},
100 {F3B16, F9B16, F1B16, F3B16},
101 {F9B16, F3B16, F3B16, F1B16}};
103inline constexpr MInt mFld1<2>[24] = {1, 3, 1, 2, 0, 2, 0, 3, -1, -1, -1, -1,
104 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
117inline constexpr MFloat ppdfDir<2>[9][2] = {{-1.0, 0.0}, {1.0, 0.0}, {0.0, -1.0}, {0.0, 1.0}, {1.0, 1.0},
118 {1.0, -1.0}, {-1.0, -1.0}, {-1.0, 1.0}, {0.0, 0.0}};
123 {1, 0, 1}, {1, 2, 1},
124 {1, 1, 0}, {1, 1, 2},
127 {0, 0, 1}, {0, 2, 1},
128 {2, 0, 1}, {2, 2, 1},
130 {0, 1, 0}, {0, 1, 2},
131 {2, 1, 0}, {2, 1, 2},
133 {1, 0, 0}, {1, 0, 2},
134 {1, 2, 0}, {1, 2, 2},
136 {0, 0, 0}, {0, 0, 2},
137 {0, 2, 0}, {0, 2, 2},
138 {2, 0, 0}, {2, 0, 2},
139 {2, 2, 0}, {2, 2, 2},
162 {F1B64, F3B64, F3B64, F9B64, F3B64, F9B64, F9B64, F27B64},
163 {F3B64, F1B64, F9B64, F3B64, F9B64, F3B64, F27B64, F9B64},
164 {F3B64, F9B64, F1B64, F3B64, F9B64, F27B64, F3B64, F9B64},
165 {F9B64, F3B64, F3B64, F1B64, F27B64, F9B64, F9B64, F3B64},
166 {F3B64, F9B64, F9B64, F27B64, F1B64, F3B64, F3B64, F9B64},
167 {F9B64, F3B64, F27B64, F9B64, F3B64, F1B64, F9B64, F3B64},
168 {F9B64, F27B64, F3B64, F9B64, F3B64, F9B64, F1B64, F3B64},
169 {F27B64, F9B64, F9B64, F3B64, F9B64, F3B64, F3B64, F1B64}};
171inline constexpr MInt mFld1<3>[24] = {0, 2, 0, 3, 1, 2, 1, 3, 0, 4, 0, 5, 1, 4, 1, 5, 2, 4, 2, 5, 3, 4, 3, 5};
174 {0, 6, 7, 10, 11, 18, 19, 20, 21}, {2, 6, 8, 14, 15, 18, 19, 22, 23}, {4, 10, 12, 14, 16, 18, 20, 22, 24}};
177 {1, 8, 9, 12, 13, 22, 23, 24, 25}, {3, 7, 9, 16, 17, 20, 21, 24, 25}, {5, 11, 13, 15, 17, 19, 21, 23, 25}};
193inline constexpr MInt oppositeDist<3>[27] = {1, 0, 3, 2, 5, 4, 9, 8, 7, 6, 13, 12, 11, 10,
194 17, 16, 15, 14, 25, 24, 23, 22, 21, 20, 19, 18, 26};
197 {-1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, {0.0, 0.0, 1.0},
198 {-1.0, -1.0, 0.0}, {-1.0, 1.0, 0.0}, {1.0, -1.0, 0.0}, {1.0, 1.0, 0.0}, {-1.0, 0.0, -1.0}, {-1.0, 0.0, 1.0},
199 {1.0, 0.0, -1.0}, {1.0, 0.0, 1.0}, {0.0, -1.0, -1.0}, {0.0, -1.0, 1.0}, {0.0, 1.0, -1.0}, {0.0, 1.0, 1.0},
200 {-1.0, -1.0, -1.0}, {-1.0, -1.0, 1.0}, {-1.0, 1.0, -1.0}, {-1.0, 1.0, 1.0}, {1.0, -1.0, -1.0}, {1.0, -1.0, 1.0},
201 {1.0, 1.0, -1.0}, {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}};
259 for(
MInt k = 0; k < D; k++) {
260 sum += std::abs(
idFld(i, k) - 1);
267 return lbDescriptor::linearInterpolationCoefficients<D>[i][j];
276 return nFld(i / 2, j);
278 return pFld(i / 2, j);
283 return lbDescriptor::nodalConnectivityVector<D>[i][j];
296template <MInt D, MInt Q>
301 static constexpr MInt d() {
return D; }
302 static constexpr MInt q() {
return Q; }
305 static constexpr MInt dxQyFld() {
return lbDescriptor::dxQyFld<D, Q>; }
306 static constexpr MFloat tp(
MInt i) {
return lbDescriptor::tp<D, Q>[i]; }
T constexpr POWX(T base, MUint exponent)
Compile time power calculation.
constexpr MInt nodalConnectivityVector< 3 >[12][2]
constexpr MInt idFld[POWX(3, D)][D]
Basic movements for the distributions , 0=backwards, 1=stop, 2=forwards.
constexpr MInt dxQyFld
Number of distributions which have one space direction in common.
constexpr MInt intNghbrArray< 2 >[4][4]
constexpr MFloat tp[4]
taylor-polynom coefficients for equilibrium calculation (0:rest, 1:face, 2:edge, 3:corner)
constexpr MInt dirFld2[3][3]
Convert directions into distribution id.
constexpr MFloat linearInterpolationCoefficients[POWX(2, D)][POWX(2, D)]
Linear interpolation coefficients.
constexpr MInt mFld1< 2 >[24]
constexpr MFloat linearInterpolationCoefficients< 2 >[4][4]
constexpr MInt mFld1< 3 >[24]
constexpr MInt idFld< 2 >[9][2]
constexpr MFloat ppdfDir< 2 >[9][2]
constexpr MFloat ppdfDir< 3 >[27][3]
constexpr MInt mFld2[24]
Ids for the calculation of the second term of the maxwellian.
constexpr MFloat tp< 3, 15 >[4]
constexpr MInt distFld< 2, 9 >[3]
constexpr MInt nFld< 3 >[3][9]
constexpr MInt nFld< 2 >[2][3]
constexpr MInt dxQyFld< 3, 27 >
constexpr MInt distFld< 3, 19 >[3]
constexpr MInt nodalConnectivityVector[D *POWX(2, D - 1)][2]
Distribution ids required to form a vector for nodal connectivity.
constexpr MInt intNghbrArray[POWX(2, D)][POWX(2, D)]
Directions of the interpolation neighbors [positionChild][positionIntepolationParent].
constexpr MInt oppositeDist[POWX(3, D)]
Opposite distribution.
constexpr MInt distFld< 3, 27 >[3]
constexpr MInt dxQyFld< 3, 19 >
constexpr MFloat tp< 3, 27 >[4]
constexpr MInt nodalConnectivityVector< 2 >[4][2]
constexpr MInt oppositeDist< 2 >[9]
constexpr MFloat ppdfDir[POWX(3, D)][D]
Direction of motion of each PPDF, needed for bounce-back schemes.
constexpr MFloat linearInterpolationCoefficients< 3 >[8][8]
constexpr MInt pFld< 3 >[3][9]
constexpr MInt distFld[3]
Number of distributions - (1d,2d,3d)
constexpr MInt dirFld3[3][3][3]
constexpr MInt distFld< 3, 15 >[3]
constexpr MInt pFld[D][POWX(3, D - 1)]
Distributions with components in positive axis direction [axis][distribution].
constexpr MInt mFld1[24]
Ids for the calculation of the first term of the maxwellian.
constexpr MInt distType[Q]
constexpr MInt intNghbrArray< 3 >[8][8]
constexpr MInt pFld< 2 >[2][3]
constexpr MInt nFld[D][POWX(3, D - 1)]
Distributions with components in negative axis direction [axis][distribution].
constexpr MInt dxQyFld< 2, 9 >
constexpr MInt dxQyFld< 3, 15 >
constexpr MInt idFld< 3 >[27][3]
constexpr MFloat tp< 2, 9 >[4]
constexpr MInt oppositeDist< 3 >[27]
constexpr MFloat tp< 3, 19 >[4]
LB lattice descriptor for arrays depending on D.
static constexpr MInt idFld(MInt i, MInt j)
static constexpr MInt componentFld(MInt i, MInt j)
static constexpr MInt nodalConnectivityVector(MInt i, MInt j)
static constexpr MFloat ppdfDir(MInt i, MInt j)
static constexpr MInt mFld1(MInt i)
static constexpr MInt oppositeDist(MInt i)
static constexpr MInt pFld(MInt i, MInt j)
static constexpr MInt mFld2(MInt i)
static constexpr const MFloat * ppdfDir(MInt i)
static constexpr MInt distType(MInt i)
Type of the distribution (0:rest, 1:face, 2:edge, 3:corner)
static constexpr MInt nFld(MInt i, MInt j)
static constexpr MInt intNghbrArray(MInt i, MInt j)
static constexpr MFloat linearInterpolationCoefficients(MInt i, MInt j)
static constexpr MInt dirFld(MInt i, MInt j, MInt k)
LbLatticeDescriptorBase()=delete
LB lattice descriptor for arrays depending on D and Q.
static constexpr MFloat tp(MInt i)
static constexpr MInt distFld(MInt i)
static constexpr MInt lastId()
LbLatticeDescriptor()=delete
static constexpr MInt dxQyFld()
static constexpr MInt q()
static constexpr MInt d()