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 . For example, to do a
forward Fourier Transform of a single field you would write
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]), NULL, FFTW_NORMAL_ORDER);
In 2D you would simply write f[fld] instead of f[fld].