269 {
271 MomentaF().computeAllMomenta(cell, rho, u, pi);
272 auto force = cell.template getFieldPointer<descriptors::FORCE>();
273 int nDim = DESCRIPTOR::d;
274 V forceSave[nDim];
275
276
277
278 auto v = cell.template getFieldPointer<descriptors::V12>();
279 for (int iDim=0; iDim<nDim; ++iDim) {
280 forceSave[iDim] = force[iDim];
281 force[iDim] += v[iDim];
282 for (int jDim=0; jDim<nDim; ++jDim) {
283 force[iDim] += v[jDim + iDim*nDim + nDim]*u[jDim];
284 }
285 }
286 for (int iVel=0; iVel<nDim; ++iVel) {
287 u[iVel] += force[iVel] / V{2.};
288 }
289
290 auto statistics =
CollisionO().apply(cell, parameters);
291 V newOmega = parameters.template get<descriptors::OMEGA>();
293
294 for (int iVel=0; iVel<nDim; ++iVel) {
295 force[iVel] = forceSave[iVel];
296 }
297 return statistics;
298 };
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static void addExternalForce(CELL &cell, const RHO &rho, const U &u, const OMEGA &omega, const FORCE &force) any_platform
Add a force term after BGK collision.
static constexpr int n
result stored in n