ABINIT/m_fft_mesh [ Modules ]

This module contains routines and helper functions to perform the setup of the FFT mesh
It also provides a set of tools to test the grid, rotate the mesh according to the symmetry
operations of the space group etc.

COPYRIGHT

Copyright (C) 2008-2018 ABINIT group (MG, XG, GMR, VO, LR, RWG, YMN, RS, TR, DC)
This file is distributed under the terms of the
GNU General Public License, see ~abinit/COPYING
or http://www.gnu.org/copyleft/gpl.txt .

PARENTS

CHILDREN

SOURCE

23 #if defined HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26 27 #include "abi_common.h"
28 29 MODULE m_fft_mesh30 31 use defs_basis32 use m_errors33 use m_abicore34 use m_hide_blas35 36 use defs_fftdata, only : size_goed_fft37 use m_numeric_tools, only : denominator, mincm, iseven, pfactorize38 use m_symtk, only : mati3inv39 use m_geometry, only : xred2xcart40 use m_crystal, only : crystal_t41 42 implicit none
43 44 private
45 46 public :: setmesh ! Perform the setup of the FFT mesh for the GW oscillator strengths.
47 public :: check_rot_fft ! Test whether the mesh is compatible with the rotational part of the space group.
48 public :: fft_check_rotrans ! Test whether the mesh is compatible with the symmetries of the space group.
49 public :: rotate_fft_mesh ! Calculate the FFT index of the rotated mesh.
50 public :: cigfft ! Calculate the FFT index of G-G0.
51 public :: ig2gfft ! Returns the component of a G in the FFT Box from its sequential index.
52 public :: g2ifft ! Returns the index of the G in the FFT box from its reduced coordinates.
53 public :: get_gftt ! Calculate the G"s in the FFT box from ngfft
54 public :: calc_ceigr ! e^{iG.r} on the FFT mesh (complex valued).
55 public :: calc_eigr ! e^{iG.r} on the FFT mesh (version for real array with RE,IM).
56 public :: calc_ceikr ! e^{ik.r} on the FFT mesh (complex valued).
57 public :: times_eigr ! Multiply an array on the real-space mesh by e^{iG0.r}
58 public :: times_eikr ! Multiply an array on the real-space mesh by e^{ik.r}
59 public :: phase ! Compute ph(ig)=$\exp(\pi\ i \ n/ngfft)$ for n=0,...,ngfft/2,-ngfft/2+1,...,-1
60 public :: mkgrid_fft ! It sets the grid of fft (or real space) points to be treated.
61 62 interface calc_ceigr
63 module procedure calc_ceigr_spc64 module procedure calc_ceigr_dpc65 end interface calc_ceigr

irottb(ngfftot,nsym)=Indeces of $R^{-1}(r-\tau)$ in the FFT box.
preserve=.FALSE. if the FFT mesh does not fulfil all symmetry properties of the crystal.

NOTES

The evaluation of the rotated point $R^{-1}(r-\tau)$ is done using real arithmetic.
As a consequence, if the FFT mesh does not fulfil the symmetry properties
of the crystal, the array irottb will contain the index of the FFT point which
is the closest one to $R^{-1}(r-\tau)$. This might lead to inaccuracies in the
final results, in particular in the description of degenerate states.

m_fft_mesh/setmesh [ Functions ]

gmet(3,3)=Reciprocal spacemetric.
gvec(3,npwvec)=G-vectors in reduced coordinates.
npwvec=Number of G vectors in the array gvec max(npwwfn,npwsigx)
npwsigx=Size of the dielectric or self-energy matrix.
npwwfn=Number of G-vectors in the wavefunctions.
method=Integer flag for FFT grid (see below)
mG0=Number of shells that must be added to take into account umklapp processes.
Cryst<crystal_t>=Data type gathering information on unit cell and symmetries
%nsym=Number of symmetry operations in the SG.
%symrel(3,3,nsym)=Symmetry operations in real space.
%tnons(3,nsym)=Fractional translations.
enforce_sym=Flag to enforce a FFT which fulfils all symmetry operations, both the
rotational part and fractional translations.
[unit]=Output unit, defaults to std_out

OUTPUT

ngfft(18)=contain all needed information about 3D FFT,
see also ~abinit/doc/variables/vargs.htm#ngfft
nfftot= ngfft(1)*ngfft(2)*ngfft(3)=Total number of points in the FFT grid.

NOTES

Four methods are implemented for the calculation of the mesh:
method=0 --> FFT mesh defined by the user, useful for debugging.
method=1 Roughly takes the FFT box which encloses the larger of the two spheres of radius
aliasing_factor*rwfn and rsigx, where rwfn and rsigx are the radius of the spheres
with npwwfn and npwsigx planewaves respectively. The default aliasing_factor is 1.
method=2 --> Calculates the optimal FFT grid which allows aliasing only outside the sphere of the
npwsigx planewaves (finer than method=1 with aliasing_factor=1).
method=3 --> Calculates the FFT grid needed to expand the density.
(even finer than method=2, roughly corresponds to method=1 with aliasing_factor=2).
See defs_fftdata for a list of allowed sizes of FFT.