next up previous
Next: Accuracy Tests of CLUSTEREASY Up: Customizing CLUSTEREASY Previous: Updating Buffers

Fourier Transforms

In 1D the syntax for a Fourier Transform is essentially the same as it is in LATTICEEASY, except that you must include the parameters my_rank amd numprocs. You should also remember that the field values start at $i=1$. For example, to do a forward Fourier Transform of a single field you would write
fftr1(&(f[fld][1]),N,1,my_rank,numprocs);

In 2D and 3D CLUSTEREASY uses the Fourier Transform package FFTW, so the syntax for a Fourier Transform is different. First, you must declare a variable of type rfftwnd_mpi_plan to store the ``plan'' that FFTW uses to calculate the Fourier Transform. Next you must create this plan with the command
<my_plan_name> = rfftw3d_mpi_create_plan(MPI_COMM_WORLD, N, N, N, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE);
(In 2D you would write ``2d'' instead of ``3d'' and only include the argument N twice.) If you are planning to do a forward transform and an inverse transform you will need a separate plan for each, and for the inverse plan you should write ``COMPLEX_TO_REAL'' instead of ``REAL_TO_COMPLEX.'' You do not need a separate plan for each field, or for the fields and derivatives. Finally, to take the Fourier Transform you execute the command
rfftwnd_mpi(<my_plan_name>, 1, &(f[fld][1][0][0]), NULL, FFTW_NORMAL_ORDER);
In 2D you would simply write f[fld][1][0] instead of f[fld][1][0][0].


next up previous
Next: Accuracy Tests of CLUSTEREASY Up: Customizing CLUSTEREASY Previous: Updating Buffers

Go to The LATTICEEASY Home Page
Go to Gary Felder's Home Page
Send email to Gary Felder at gfelder@email.smith.edu
Send email to Igor Tkachev at Igor.Tkachev@cern.ch

This documentation was generated on 2008-01-21