108{
109 using V = typename CELL::value_t;
111
112 auto prevCell = cell.template getField<PREV_CELL>();
113
114 for (unsigned i=0; i < missing.size(); ++i) {
115 cell[missing[i]] = prevCell[i];
116 }
117
118 V rho0, u0[3];
119 V rho1, u1[3];
120 V rho2, u2[3];
121
122 cell.computeRhoU(rho0, u0);
123
124 static_assert(direction == 0 || direction == 1 || direction ==2,
125 "Direction must be one of 0, 1 or 2");
126 if constexpr (direction == 0) {
127 cell.neighbor({-orientation ,0,0}).computeRhoU(rho1, u1);
128 cell.neighbor({-orientation*2,0,0}).computeRhoU(rho2, u2);
129 }
130 else if constexpr (direction == 1) {
131 cell.neighbor({0,-orientation ,0}).computeRhoU(rho1, u1);
132 cell.neighbor({0,-orientation*2,0}).computeRhoU(rho2, u2);
133 }
134 else if constexpr (direction == 2) {
135 cell.neighbor({0,0,-orientation }).computeRhoU(rho1, u1);
136 cell.neighbor({0,0,-orientation*2}).computeRhoU(rho2, u2);
137 }
138
139 V uDelta[3];
140 V uAverage = rho0*u0[direction];
141
142
143
144
145
146
147
148 uDelta[0] = -uAverage*0.5*(3*rho0*u0[0]-4*rho1*u1[0]+rho2*u2[0]);
149 uDelta[1] = -uAverage*0.5*(3*rho0*u0[1]-4*rho1*u1[1]+rho2*u2[1]);
150 uDelta[2] = -uAverage*0.5*(3*rho0*u0[2]-4*rho1*u1[2]+rho2*u2[2]);
151
152 for (unsigned i=0; i < missing.size(); ++i) {
153 auto iPop = missing[i];
154 prevCell[i] = cell[iPop]
159 }
160
161 cell.template setField<PREV_CELL>(prevCell);
162}
constexpr T invCs2() any_platform
constexpr T t(unsigned iPop, tag::CUM) any_platform
constexpr int c(unsigned iPop, unsigned iDim) any_platform
constexpr auto populationsContributingToVelocity() any_platform
Return array of population indices where c[iVel] == value.