Calculate FFT of 1/r green's function

142 Views Asked by At

I am trying to write the Poisson equation solver in C, using FFTW library. For given density of charge I need to calculate potential assuming periodic boundaries. My idea is to use convolution, simply calculate complex DFT of green's function $G(r)=\frac{1}{4\pi r}$ multiply by DFT of density and inverse transform the product. Problem is that there is singularity at r=0 and FFTW does not accept -inf values. I am not really mathematician. I wonder if there is some way of overcoming this problem. My only guess was to assume some big value at r=0, or some smoothing, but it is probably not the best idea. Another way would be probably to change the method of calculation. I look forward for any suggestions.