how to use m_FFT module

Documentation, Web site and code modifications

Moderators: baguetl, routerov

Locked
ysyysysn
Posts: 1
Joined: Thu Nov 21, 2019 4:50 am

how to use m_FFT module

Post by ysyysysn » Thu Dec 05, 2019 10:02 pm

Hello,

I am trying to add a new XC module. In my own code, I want to use subroutine fourdp() from m_fft.F90 to transfer a real space function fof to momentum space function fofg. I have read the source code and found out fofr and fofg has the same dimension: nfft. I don't really understand. I thought real space mesh was confined in one unit cell which should be fine enough to represent the charge densities (or wavefunctions, etc). And in the reciprocal space,it should be all the G points due to the periodicity. They should have different dimensions. Can someone explain how to use this subroutine and what are the parameters like ngfftf(18), mpi_energy mrean, paral_kgb. Or should I write my own fft?

Best,
Shuyang

gonze
Posts: 412
Joined: Fri Aug 14, 2009 8:29 pm

Re: how to use m_FFT module

Post by gonze » Thu Dec 19, 2019 9:38 pm

Dear Shuyang,
ysyysysn wrote:
Thu Dec 05, 2019 10:02 pm
I am trying to add a new XC module. In my own code, I want to use subroutine fourdp() from m_fft.F90 to transfer a real space function fof to momentum space function fofg.
You are welcome to do so.
ysyysysn wrote:
Thu Dec 05, 2019 10:02 pm
I have read the source code and found out fofr and fofg has the same dimension: nfft. I don't really understand.
Well, this is completely standard with FFT. See https://en.wikipedia.org/wiki/Fast_Fourier_transform and many other references.
ysyysysn wrote:
Thu Dec 05, 2019 10:02 pm
Can someone explain how to use this subroutine and what are the parameters like ngfftf(18), mpi_energy mrean, paral_kgb.
As usual for any reuse of code that is not in the form of a library, you have to track the meaning of the arguments
of routines by "reverse software engineering", relying on the provided documentation, on published papers, as well as by reading the calling routines, the definitions of variables throughout the code, etc.

Good luck,
X.

Locked