229 {
231
232
233
234
238 T rho_avg = 0.;
239 T u_avg[DESCRIPTOR::d] = {0., 0.};
240
241 std::size_t ctr = 0;
242
243 for(int iPop=1; iPop<DESCRIPTOR::q; iPop++) {
244 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
245 descriptors::c<DESCRIPTOR>(iPop,1),
246 descriptors::c<DESCRIPTOR>(iPop,2)});
247
249 T rho_tmp = 0.;
250 T u_tmp[DESCRIPTOR::d] = {0., 0.};
251 ++ctr;
252 cellC.computeRhoU(rho_tmp, u_tmp);
253 rho_avg += rho_tmp;
254 for(size_t i = 0; i < DESCRIPTOR::d; ++i){
255 u_avg[i] += u_tmp[i];
256 }
257 }
258 }
259
260 if(ctr > 0){
261 rho_avg /= static_cast<T>(ctr);
262 for(size_t i = 0; i < DESCRIPTOR::d; ++i){
263 u_avg[i] /= static_cast<T>(ctr);
264 }
265 }
266
267 cell.iniEquilibrium(rho_avg, u_avg);
268 }
270
271
272
275 }
276 }
277}
void setCellFlags(CELL &cell, const FreeSurface::Flags &flags)
bool hasNeighbourFlags(CELL &cell, const FreeSurface::Flags &flags)
bool isCellType(CELL &cell, const FreeSurface::Type &type)
bool hasCellFlags(CELL &cell, const FreeSurface::Flags &flags)