This Tutorial demonstrates how to call the SWFFT wrapper to the FFTW3 solver.

In this test case we call the forward transform on an array of data.

To build the code, type 'make' in this directory.

To run the code, type 'main3d.gnu.MPI.ex inputs' in this directory

To visualize the output, use amrvis3d (source available at 
https://github.com/AMReX-Codes/Amrvis):

amrvis3d plt_fft

The DFT of the data as well as the original array can be viewed as separate 
variables in the plotfile "plt_fft"

Notes: this tutorial is very similar to amrex/Tutorials/SWFFT, 
with these primary exceptions:
 - This tutorial is simply performing an FFT on a multifab, unlike the SWFFT tutorial, 
   which solves a Poisson equation with periodic boundary conditions using 
   spectral methods
 - Only a forward FFT is called. No reverse FFT is called, which is why the data 
   is redistributed from z-pencils back to blocks in k-space. In addition, 
   this means that grid ordering (rank_mapping) is not transposed when constructing the
   hacc::Dfft class, to account for the difference between C++ and Fortran array indexing
 - This tutorial works in 2D, by "hacking" hacc::Dfft, which is meant for data
   arranged on a 3D domain
 - The FFT of the data, as well as the original multifab, are printed to a single
   plotfile

More notes: 
 - The DFT is ordered in k-space from {0 to 2pi} (actualy {0 to 2pi*(N-1)/N}). In other words,
   the kx, ky, and kz wave-numbers range from {0 to N-1}, as opposed to 
   {-(N/2-1) to N/2} or {-pi to pi}
 - The FFT is not scaled - e.g. DFT of a discrete "delta" function (phi(0,0,0)=1, phi=0 
   everywhere else) results in a constant value of phi_dft=1 throughout the domain