template<typename STRESS>
struct olb::momenta::ForcedStress< STRESS >
Definition at line 1816 of file elements.h.
template<typename STRESS >
template<typename TYPE , typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
Definition at line 1818 of file elements.h.
1819 {
1820 V uNew[DESCRIPTOR::d] { };
1821 const auto force = cell.template getFieldPointer<descriptors::FORCE>();
1822 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
1823 uNew[iD] = u[iD] - V{0.5} * force[iD];
1824 }
1827
1828 int iPi = 0;
1829 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1830 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1831 forceTensor[iPi] = V{0.5} * rho * (force[iAlpha]*uNew[iBeta] + uNew[iAlpha]*force[iBeta]);
1832 ++iPi;
1833 }
1834 }
1835
1836 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1837 pi[iPi] += forceTensor[iPi];
1838 }
1839 }
void compute(CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
static constexpr int n
result stored in n
References olb::momenta::ForcedStress< STRESS >::compute().