Places the coefficients of a wavefunction onto an fft mesh.

        Once the mesh has been obtained, a discrete fourier transform can be
        used to obtain real-space evaluation of the wavefunction. The output
        of this function can be passed directly to numpy's fft function. For
        example:

            mesh = Wavecar('WAVECAR').fft_mesh(kpoint, band)
            evals = np.fft.ifftn(mesh)

        Args:
            kpoint (int): the index of the kpoint where the wavefunction
                            will be evaluated
            band (int): the index of the band where the wavefunction will be
                            evaluated
            spin (int):  the spin of the wavefunction for the desired
                            wavefunction (only for ISPIN = 2, default = 0)
            shift (bool): determines if the zero frequency coefficient is
                            placed at index (0, 0, 0) or centered
        Returns:
            a numpy ndarray representing the 3D mesh of coefficients

def fft_mesh(self, kpoint, band, spin=0, shift=True):
        """
        Places the coefficients of a wavefunction onto an fft mesh.

        Once the mesh has been obtained, a discrete fourier transform can be
        used to obtain real-space evaluation of the wavefunction. The output
        of this function can be passed directly to numpy's fft function. For
        example:

            mesh = Wavecar('WAVECAR').fft_mesh(kpoint, band)
            evals = np.fft.ifftn(mesh)

        Args:
            kpoint (int): the index of the kpoint where the wavefunction
                            will be evaluated
            band (int): the index of the band where the wavefunction will be
                            evaluated
            spin (int):  the spin of the wavefunction for the desired
                            wavefunction (only for ISPIN = 2, default = 0)
            shift (bool): determines if the zero frequency coefficient is
                            placed at index (0, 0, 0) or centered
        Returns:
            a numpy ndarray representing the 3D mesh of coefficients
        """
        mesh = np.zeros(tuple(self.ng), dtype=np.complex)
        tcoeffs = self.coeffs[spin][kpoint][band] if self.spin == 2 else \
            self.coeffs[kpoint][band]
        for gp, coeff in zip(self.Gpoints[kpoint], tcoeffs):
            t = tuple(gp.astype(np.int) + (self.ng / 2).astype(np.int))
            mesh[t] = coeff
        if shift:
            return np.fft.ifftshift(mesh)
        else:
            return mesh