20 #pragma omp parallel if (Gpu::notInLaunchRegion())
22 for ( MFIter mfi(*(vel_t_avg),TilingIfNotGPU()); mfi.isValid(); ++mfi)
25 Box tbx = mfi.tilebox();
28 const Array4<Real>& velx =
xvel.array(mfi);
29 const Array4<Real>& vely =
yvel.array(mfi);
30 const Array4<Real>& velz =
zvel.array(mfi);
33 Array4<Real> vel_t_avg_arr = vel_t_avg->array(mfi);
35 ParallelFor(tbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
37 Real u_cc = 0.5 * ( velx(i,j,k) + velx(i+1,j ,k ) );
38 Real v_cc = 0.5 * ( vely(i,j,k) + vely(i ,j+1,k ) );
39 Real w_cc = 0.5 * ( velz(i,j,k) + velz(i ,j ,k+1) );
40 Real umag_cc = std::sqrt(u_cc*u_cc + v_cc*v_cc + w_cc*w_cc);
41 vel_t_avg_arr(i,j,k,0) += u_cc;
42 vel_t_avg_arr(i,j,k,1) += v_cc;
43 vel_t_avg_arr(i,j,k,2) += w_cc;
44 vel_t_avg_arr(i,j,k,3) += umag_cc;
@ xvel
Definition: ERF_IndexDefines.H:130
@ zvel
Definition: ERF_IndexDefines.H:132
@ yvel
Definition: ERF_IndexDefines.H:131