57 const unsigned int nPlanes,
58 const unsigned int velocityComponent0,
59 const unsigned int velocityComponent1,
60 const unsigned int velocityComponent2,
61 const TData scale,
const TData *velocity,
62 TData *products,
const unsigned int streamID)
64 static_assert(NDIM == 2 || NDIM == 3,
65 "ReynoldsStress supports only dimensions 2 and 3.");
68 const size_t compSize = nPlanes * planeSize;
69 const size_t uOffset = velocityComponent0 * compSize;
70 const size_t vOffset = velocityComponent1 * compSize;
71 const size_t wOffset = velocityComponent2 * compSize;
74 Nektar::parallel_for<ExecSpace>(
76 const TData u[3] = {velocity[uOffset + idx],
77 velocity[vOffset + idx],
78 NDIM == 3 ? velocity[wOffset + idx] : TData{0}};
80 unsigned int product = 0;
81 for (
unsigned int a = 0; a < NDIM; ++a)
83 for (
unsigned int b = a; b < NDIM; ++b, ++product)
85 products[product * compSize + idx] += scale * u[a] * u[b];
void ReynoldsStressKernelLauncher(const size_t planeSize, const unsigned int nPlanes, const unsigned int velocityComponent0, const unsigned int velocityComponent1, const unsigned int velocityComponent2, const TData scale, const TData *velocity, TData *products, const unsigned int streamID)
Add scale * u_a * u_b to product component (a,b), a <= b, at every entry of one block.