[petsc-users] Output format of FFTW

l.buikstra at student.utwente.nl l.buikstra at student.utwente.nl
Thu Oct 25 09:12:31 CDT 2012


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.

Yours,

Leon Buikstra


More information about the petsc-users mailing list