Dear community,
I see the derivatives calculated in Nek5000 with subroutines comp_gije and gradm1 use the following data structure:
parameter (lxyz=lx1*ly1*lz1)
common /myTest/ dudx(lxyz,lelv), dudy(lxyz,lelv), dudz(lxyz,lelv)
real dudx, dudy, dudz
call gradm1(dudx,dudy,dudz,u)
do e=1,nelv
do l=1,lxyz
dudx(l,e) = ....
enddo
enddo
However, i see the y location for velocity mesh can be accessed from ym1(lx1,ly1,lz1,lelv). Hence we usually write:
do e=1,nelv
do i=1,lx1
do j=1,ly1
do k=1,lz1
.... = ym1(i,j,k,e)
enddo
enddo
enddo
enddo
Now i would like to get the derivatives in loop of i j k. Can i write the code like:
do e=1,nelv
do i=1,lx1
do j=1,ly1
do k=1,lz1
dudx( i + lx1*(j-1) + lx1*ly1*(k-1), e ) = .... ! instead of dudx(l,e) in loop lxyz?
enddo
enddo
enddo
enddo
I need to get the derivates and y coordinates in the same loop, any suggestions are helpful. Thanks for advance.
Yours,
Zhou