39 {
40 const T uSqr = util::normSqr<T,DESCRIPTOR::d>(u);
41
42 constexpr auto onWallIndices = util::populationsContributingToVelocity<DESCRIPTOR,direction,0>();
43 constexpr auto normalIndices = util::populationsContributingToVelocity<DESCRIPTOR,direction,orientation>();
44
45 T fNeq[DESCRIPTOR::q];
46 for (unsigned fIndex=0; fIndex<onWallIndices.size(); ++fIndex) {
47 int iPop = onWallIndices[fIndex];
48 if (iPop == 0) {
49 fNeq[0] = T();
50 }
51 else {
52 fNeq[iPop] =
53 cell[iPop] -
55 }
56 }
57 for (unsigned fIndex=0; fIndex<normalIndices.size(); ++fIndex) {
58 int iPop = normalIndices[fIndex];
59 fNeq[iPop] =
60 cell[iPop] -
62 }
63
64 int iPi = 0;
65 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
66 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
67 pi[iPi] = T();
68 for (unsigned fIndex=0; fIndex < onWallIndices.size(); ++fIndex) {
69 const int iPop = onWallIndices[fIndex];
70 pi[iPi] += descriptors::c<DESCRIPTOR>(iPop,iAlpha)
71 * descriptors::c<DESCRIPTOR>(iPop,iBeta)
72 * fNeq[iPop];
73 }
74 for (unsigned fIndex=0; fIndex < normalIndices.size(); ++fIndex) {
75 const int iPop = normalIndices[fIndex];
76 pi[iPi] += T{2}
77 * descriptors::c<DESCRIPTOR>(iPop,iAlpha)
78 * descriptors::c<DESCRIPTOR>(iPop,iBeta)
79 * fNeq[iPop];
80 }
81 ++iPi;
82 }
83 }
84 }
static V secondOrder(int iPop, const RHO &rho, const U &u, const USQR &uSqr) any_platform
Computation of equilibrium distribution, second order in u.