Hi,<br><br>I have added an interpolation tool to the repo, int_tp, in nek5_svn/trunk/tools/int_tp<br><br>There is also a README in that directory with instructions on the details of using the tool.<br><br>(Note - int_tp should be compiled as any standard nek tool in the trunk/tools/ directory with "maketools int_tp" or "maketools all")<br>


<br>Let me know if you encounter complications.<br><br>Thanks,<br>Katie<br><br><div class="gmail_quote">On Fri, May 4, 2012 at 7:51 AM,  <span dir="ltr"><<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le 04/05/2012 13:55, <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.<u></u>gov</a> a écrit :<div>


<div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Neks,<br>
another point I'm (even more) interested in is: how do you do your FFT analysis?<br>
I guess in a first step the grid is mapped onto a regular grid<br>
(ifreguo = .true.) and in a second step the FFT is computed at that<br>
grid.<br>
Then the question arises: What is a good choice for "nrg" (with nrg as<br>
the dimension of regular grid (nrg**ndim)...)? nrg=lx1 or lx1-1?<br>
Regards<br>
Jan<br>
<br>
2012/4/13 Jan Frielinghausen<<a href="mailto:jan.frielinghausen@googlemail.com" target="_blank">jan.<u></u>frielinghausen@googlemail.com</a>><u></u>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Neks, Hi Can,<br>
I too would be very interested in getting more information about these routines.<br>
regards<br>
Jan<br>
<br>
Am 5. April 2012 18:10 schrieb<<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.<u></u>mcs.anl.gov</a>>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi neks !<br>
<br>
For a given velocity field<br>
(vx(1:lx1,1:ly1,1:lz1,1:lelv),<u></u>vy(1:lx1,1:ly1,1:lz1,1:lelv),<u></u>vz(1:lx1,1:ly1,1:lz1,1:lelv))<br>
i would like to calculate the energy spectrum, this implies FFT<br>
transformation on regular arrays<br>
vx(1:n,1:n,1:n),vy(1:n,1:n,1:<u></u>n),vz(1:n,1:n,1:n) (need<br>
deltax=deltay=deltaz=cst).<br>
On the emailing-list it has been said :<br>
"We do have off-line serial routines<br>
that can transfer data from an nelx x nely x nelz array of Nth-order<br>
elements to an nxnxn array - this allows for analysis by FFTs etc"<br>
<br>
<br>
Can you please tell me more about this ? What are these routines ??<br>
B.regards<br>
Can<br>
<br>
______________________________<u></u>_________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov" target="_blank">Nek5000-users@lists.mcs.anl.<u></u>gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" target="_blank">https://lists.mcs.anl.gov/<u></u>mailman/listinfo/nek5000-users</a><br>
</blockquote></blockquote>
______________________________<u></u>_________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov" target="_blank">Nek5000-users@lists.mcs.anl.<u></u>gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" target="_blank">https://lists.mcs.anl.gov/<u></u>mailman/listinfo/nek5000-users</a><br>
<br>
</blockquote></div></div>
The solution (i think its more an hack than a real solution) i found, was to create an <a href="http://hpts.in" target="_blank">hpts.in</a> file with the coordinates of every points of the regular mesh<br>
i wrote the fallowing routine for this :<br>
(My domain is a cube of length 2pi*2pi*2pi, you can surely adapt the fallowing routine for other simple geometries)<br>
<br>
subroutine generehptsin(ndummy,ldummy,<u></u>uprn)<br>
    implicit none<br>
c  ndummy = number of grid points per dimension<br>
c  ldummy = length in one dimension<br>
c  uprn = dummy variable for output<br>
c  you need nx=ny=nz and deltax=deltay=deltaz<br>
c  For fft analysis you have to ensure that ndummy**3 is equal to 2^n (ex : 128 points = 2^7)<br>
    integer ndummy,i,j,k,uprn<br>
    real*8    ldummy,deltax,<br>
&    x(0:ndummy-1),y(0:ndummy-1),z(<u></u>0:ndummy-1)<br>
    open(uprn,file='<a href="http://hpts.in" target="_blank">hpts.in</a>',<u></u>status='unknown')<br>
c    compute deltax<br>
    deltax=0<br>
    deltax=ldummy/(ndummy-1)<br>
c    fil vectors : x,y,z<br>
    x=0<br>
    y=0<br>
    z=0<br>
    do i=0, ndummy-1<br>
    x(i)=i*deltax<br>
    y(i)=i*deltax<br>
    z(i)=i*deltax<br>
    enddo<br>
    write(uprn,*)ndummy*ndummy*<u></u>ndummy    ! total number of grid points in the first line<br>
    do k=0, ndummy-1<br>
    do j=0, ndummy-1<br>
    do i=0, ndummy-1<br>
    write(uprn,'(1p20E15.7)')x(i),<u></u>y(j),z(k)<br>
    enddo<br>
    enddo<br>
    enddo<br>
    close(uprn)<br>
    return<br>
    end<br>
<br>
Then modify the hpts() subroutine slightly (just to be able to access to the "fieldout" matrix  when you call hpts() in userchk())<br>
Eg :  modify "subroutine hpts()" to "subroutine hpts(fieldout)" (it's the first line of hpts routine in postpro.f)<br>
You will also probably want to comment the fallowing lines to avoid hpts to write in the hpts.out.<br>
<br>
      ! write interpolation results to hpts.out<br>
c      if(nid.eq.0) then<br>
c        do ip = 1,npoints<br>
c           write(50,'(1p20E15.7)') time,<br>
c &      (fieldout(i,ip), i=1,nflds)<br>
c        enddo<br>
c      endif<br>
c      if(nid.eq.0) write(6,*) 'done :: dump history points'<br>
<br>
<br>
Then, to express the velocity field in a v(i,j,k) layout, i wrote the fallowing routine :<br>
<br>
    subroutine reformatfield(nfldm,fieldout,<br>
&    ndummy,vxrdummy,vyrdummy,<u></u>vzrdummy)<br>
<br>
c  You have to call this in userchk routine without changing the first two input arguments<br>
    implicit none<br>
c  fieldout is now the output matrix of the hpts routine, we need this matrix<br>
c  nfldm is the number of field you resolve<br>
c  ndummy is the number of grid points per dimension<br>
c  vxrdummx is the x component of the velocity field in a regular grid<br>
c  vxrdummy is the y component of the velocity field in a regular grid<br>
c  vxrdummz is the z component of the velocity field in a regular grid<br>
    integer ndummy,i,j,k,z,nfldm<br>
    real     field1(ndummy*ndummy*ndummy),<br>
&        field2(ndummy*ndummy*ndummy),<br>
&        field3(ndummy*ndummy*ndummy),<br>
&        fieldout(nfldm,ndummy*ndummy*<u></u>ndummy),<br>
&        vxrdummy(1:ndummy,1:ndummy,1:<u></u>ndummy),<br>
&        vyrdummy(1:ndummy,1:ndummy,1:<u></u>ndummy),<br>
&        vzrdummy(1:ndummy,1:ndummy,1:<u></u>ndummy)<br>
<br>
<br>
<br>
    do i=1,ndummy*ndummy*ndummy<br>
    field1(i)=fieldout(1,i)    ! vx<br>
    field2(i)=fieldout(2,i)    ! vy<br>
    field3(i)=fieldout(3,i)    ! vz<br>
    enddo<br>
<br>
    z=0<br>
    do k=1,ndummy<br>
        do j=1,ndummy<br>
            do i=1,ndummy<br>
            vxrdummy(i,j,k)=field1(i+z)<br>
            vyrdummy(i,j,k)=field2(i+z)<br>
            vzrdummy(i,j,k)=field3(i+z)<br>
            enddo<br>
        z=z+ndummy<br>
        enddo<br>
    enddo<br>
    return<br>
    end<br>
<br>
This routine will output a velocity field expressed in a regular grid with v=v(i,j,k) layout. You can, from there, use any FFT routine for fft analysis.<br>
I used the "four1" routine that you can find on the "numerical recipies" tome<br>
Sorry for my poor english and  hope that will help<br>
For your question i think nrg=nelx*lx1 (1D) because, the number of grid points on a 1D gll mesh is nelx * lx1 with lx1=N+1<br>
B.regards<div><div><br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov" target="_blank">Nek5000-users@lists.mcs.anl.<u></u>gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" target="_blank">https://lists.mcs.anl.gov/<u></u>mailman/listinfo/nek5000-users</a><br>
</div></div></blockquote></div><br>