Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

MKL FFT 2D

Jonas_D_
Beginner
810 Views

Hello,

I am trying to compute the solution to the Laplace differential equation using a 2D FFT and MKL. 

Are there sample codes to compute the solution to 2nd order differential equations using forward and inverse FFT?

The issue appears to be when I multiply the transformed values by the wavenumbers.

Thanks

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
810 Views

there are no such examples available. there are only fft ( 1,2,3 D) examples - mklroot/examples/dftc/source.  

0 Kudos
McCalpinJohn
Honored Contributor III
810 Views

I have implemented such solvers many times in the past, with many different FFT libraries, and it is quite easy to make mistakes....

I recommend starting with a very small 2D grid and right-hand-side composed of a single wave of unit amplitude in one direction.   After the first set of transforms you should print out the transformed values and verify that you have a single non-negligible amplitude in Fourier space.  The magnitude of this value will tell you whether the MKL routine scales the output on the forward transform.  (Some libraries scale by 1/N on the inverse transform, but not on the forward transform.  Many other variants exist.)   The location of the value will tell you whether or not you understand how MKL is packing the transform of a real array into a half-sized complex array -- and there are many ways to do this, so read the documentation carefully and don't be shy about trying out lots of simple cases. 

Repeat with the right-hand-side composed of a single wave of unit amplitude in the other direction.

0 Kudos
Reply