CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   space averaging in 1 dimension using MPI (

AbbasRahimi May 26, 2013 19:54

space averaging in 1 dimension using MPI
Hello MPI experts,

Actually, I'm trying to find horizontal average of a velocity field "u(i,j,:)". My code is paralleled using MPI and the domain is decomposed in y and z directions (ipocess in y and jprocess in z). I tried many diffrent ways to calculate this averge but I failed. If the domain wasn't decomposed, I could simply do it in the following:
do k=1:NZ
do j=1:NY
do i=1:NX
ave(k)= ave(k)+u(i,j,k)
end do
end do
end do
but do this averaging for a decomposed domain is troublesome for me. I'll be grateful if any one could give me some hints.

Thank you.

All times are GMT -4. The time now is 22:09.