comm.Barrier(); t2=MPI.Wtime() if(my_id==0): sys.stdout.write('3 R-C FFTs cost: {0:.2f} seconds\n'.format(t2-t1)) ############################# unfiltered ############################# ## Get energy spectrum in Fourier space comm.Barrier(); t1=MPI.Wtime() ek_all=myEnergySpc.GetSpectrumFromComplexField(cvx,cvy,cvz,k2,lx,ly,lz,nek,nproc,my_id) comm.Barrier(); t2=MPI.Wtime() ############################# kappa_cutoff=100 ############################# kappa_c=100.0 ## Filter the velocity field using the GAUSSIAN filter myFilter=Filters() cvx1=myFilter.FilterTheComplexField(cvx,k2,kappa_c,'gaussian') cvy1=myFilter.FilterTheComplexField(cvy,k2,kappa_c,'gaussian') cvz1=myFilter.FilterTheComplexField(cvz,k2,kappa_c,'gaussian') ## Get energy spectrum in Fourier space comm.Barrier(); t1=MPI.Wtime() ek_gaussian=myEnergySpc.GetSpectrumFromComplexField(cvx1,cvy1,cvz1,k2,lx,ly,lz,nek,nproc,my_id) comm.Barrier(); t2=MPI.Wtime() del cvx1 del cvy1 del cvz1 ## Filter the velocity field using the SHARP filter myFilter=Filters() cvx1=myFilter.FilterTheComplexField(cvx,k2,kappa_c,'sharp') cvy1=myFilter.FilterTheComplexField(cvy,k2,kappa_c,'sharp')