[petsc-users] Output format of FFTW

Matthew Knepley knepley at gmail.com
Thu Oct 25 09:18:37 CDT 2012


On Thu, Oct 25, 2012 at 10:12 AM, <l.buikstra at student.utwente.nl> wrote:

> Dear all,
>
> I'm trying to get a feel for fourier transforms in Petsc, but I can find
> very little information about doing FTs through Petsc's interface. The
> examples all seem to just do a transform, then transform back to confirm
> the same function comes out again; that works fine over here, but I can't
> seem to figure out how the actual fourier transform itself is stored so it
> can be manipulated or used before transforming back. I wrote a short test
> program:
> http://pastebin.com/4saWgqLu
> It fills a vector with a sine, then transforms it and displays the result,
> which looks like this:
> http://imageshack.us/a/img37/1135/whatph.png
> (the original vector is 2000 points; I expect this is 4000 because it
> somehow represents a complex vector?)
> I would expect a smooth function with two peaks on the far left and right,
> but instead all it shows is a repetitively garbled mess in the first half
> of the output and mostly zeroes in the second. Am I just doing something
> wrong? If so, what, and if not, what exactly does this output represent?
> How does it relate to the output I'm expecting? Any help would be greatly
> appreciated.
>

You want something this is a nice multiple of the fundamental of the box,
so k pi i/N. Then you will get a spike.
You can find out which frequencies are where in the FFTW docs.

    Matt


> Yours,
>
> Leon Buikstra




-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121025/dd652b41/attachment.html>


More information about the petsc-users mailing list