274 {
276
277
279
280
282 T rho_average = T(0);
283 T u_average[DESCRIPTOR::d] = {T(0), T(0), T(0)};
284 std::uint8_t count = std::uint8_t(0);
285
286 for (int iPop = 1; iPop < DESCRIPTOR::q; ++iPop) {
288
289
290
292 T rho_tmp = T(0);
293 T u_tmp[DESCRIPTOR::d] = {T(0), T(0), T(0)};
294 ++count;
295 nbrCell.computeRhoU(rho_tmp, u_tmp);
296 rho_average += rho_tmp;
297 for (std::size_t i = 0; i < DESCRIPTOR::d; ++i) { u_average[i] += u_tmp[i]; }
298 }
299 }
300
301 if (count > std::uint8_t(0)) {
302 rho_average /= static_cast<T>(count);
303 for (std::size_t i = 0; i < DESCRIPTOR::d; ++i) { u_average[i] /= static_cast<T>(count); }
304 }
305 else {
306
307 rho_average = T(1);
308 for (std::size_t i = 0; i < DESCRIPTOR::d; ++i) { u_average[i] = T(0); }
309 }
310
311 cell.iniEquilibrium(rho_average, u_average);
312 }
313
314
318 }
319 }
320}
bool hasNeighbourFlags(CELL &cell, const FreeSurface::Flags &flags)
bool isCellType(CELL &cell, const FreeSurface::Type &type)
bool hasCellFlags(CELL &cell, const FreeSurface::Flags &flags)
void setCellFlags(CELL &cell, const FreeSurface::Flags &flags)
constexpr int c(unsigned iPop, unsigned iDim) any_platform