544 {
546 MomentaF().computeAllMomenta(cell, rho, u, pi);
547 auto force = cell.template getFieldPointer<descriptors::FORCE>();
548 constexpr int nDim = DESCRIPTOR::d;
549 V forceSave[nDim];
550
551
552
553 auto v = cell.template getFieldPointer<descriptors::V12>();
554 for (int iDim=0; iDim<nDim; ++iDim) {
555 forceSave[iDim] = force[iDim];
556 force[iDim] += v[iDim];
557 for (int jDim=0; jDim<nDim; ++jDim) {
558 force[iDim] += v[jDim + iDim*nDim + nDim]*u[jDim];
559 }
560 }
561 for (int iVel=0; iVel<nDim; ++iVel) {
562 u[iVel] += force[iVel] / V{2.};
563 }
564
565 auto statistics =
CollisionO().apply(cell, parameters);
566 V newOmega = parameters.template get<descriptors::OMEGA>();
568
569 for (int iVel=0; iVel<nDim; ++iVel) {
570 force[iVel] = forceSave[iVel];
571 }
572 return statistics;
573 };
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