Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
6588 Discussions

## MKL FFT 2D

Beginner
333 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

2 Replies
Moderator
333 Views

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

Black Belt
333 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.