#include <elements.h>
|
template<typename TYPE , typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t> |
void | compute (CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform |
|
template<typename STRESS>
struct olb::momenta::ForcedStress< STRESS >
Definition at line 1370 of file elements.h.
◆ compute()
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 1372 of file elements.h.
1373 {
1374 V uNew[DESCRIPTOR::d] { };
1375 const auto force = cell.template getFieldPointer<descriptors::FORCE>();
1376 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
1377 uNew[iD] = u[iD] - V{0.5} * force[iD];
1378 }
1379 STRESS().template compute<TYPE>(cell, rho, uNew, pi);
1381
1382 int iPi = 0;
1383 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1384 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1385 forceTensor[iPi] = V{0.5} * rho * (force[iAlpha]*uNew[iBeta] + uNew[iAlpha]*force[iBeta]);
1386 ++iPi;
1387 }
1388 }
1389
1390 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1391 pi[iPi] += forceTensor[iPi];
1392 }
1393 }
static constexpr int n
result stored in n
◆ getName()
template<typename STRESS >
Definition at line 1395 of file elements.h.
1395 {
1396 return "ForcedStress<" + STRESS().getName() + ">";
1397 }
The documentation for this struct was generated from the following file: