Solving the Poisson Integral for the gravitational potential using the convolution theorem Eduard Vorobyov Institute for Computational Astrophysics
Two avenues for finding the gravitational potential. Solution techniques for the Poisson equation. The problem of boundary conditions. The Poisson integral for the gravitational potential. The convolution theorem. Applications of the convolution theorem for solving the Poisson integral. FFT libraries.
How to calculate the gravitational potential? Although gravity is omnipresent in the Universe, its effect is often simplified or even neglected. However, there are situations when an accurate calculation of gravity is a necessity (galaxy formation and evolution, star and planet formation, circumstellar disk dynamics, etc.) Gravitational potential Gravity force per unit mass Solving for the Poisson equation (grid-based hydrocodes) Solving for the Poisson integral (SPH and N-body codes)
Discretization (equidistant or non-equidistant grid) Equidistant grid and periodic BC FFT Non-equidistant grid or non-periodic BC ADI method (3D with axial symmetry) SOR (slow in full 3D) Multigrid methods (fast only on Cartesian geometry?) Solution procedure for the Poisson equation Boundary conditions (periodic or non-periodic)
The Poisson equation, when discretized, needs a knowledge of the boundary values! For a simple case of 2D Cartesian equidistant mesh we obtain a five-zone molecule i=0 i=1 i=2 i=3 j=3 j=2 j=1 boundary layer x y (and other boundary values) need to be known from boundary conditions After discretizing, we obtain a set of 3 x 3 linear algebraic equations for unknown potentials
i=0 i=1 i=2 i=3 j=3 j=2 j=1 boundary layer x y Periodic boundary conditions
i=0 i=1 i=2 i=3 j=3 j=2 j=1 boundary layer r z Axis-of-symmetry or equator boundary conditions Axis of symmetry equator
Multipole expansion for axisymmetric mass distributions i=1 i=2 i=3 i=4 j=3 j=2 j=1 boundary layer z Axis of symmetry Laplace equation in spherical coordinates (r, r
The method of separation of variables (Jackson 1975) -- Legendre polynomials So far, we have not specified the location of our boundary with respect to the computational domain In the case of the outer boundary, when ALL mass is confined within radius r B, A l must go to zero for the potential to have a finite value at r B inf In the opposite case of the inner boundary, B l = 0. (can be pre-computed and stored)
B l and A l are the so-called interior and exterior multipole moments In the case of B l, the integration (summation) is performed over ALL grid zones with r r B There is no telling how many terms in the above series will be needed!
i=1 i=2 i=3 i=4 j=3 j=2 j=1 boundary layer z Axis of symmetry rBrB If we do not take into account the input from grid zones with r > r B, the series may diverge! r
Multipole expansion for non-axisymmetric mass distributions Y lm are the spherical harmonic functions (array of 4 variables!) and B lm are multipole moments The integration (summation) is performed over grid zones with r < r B and more formulas for r B < r ….. The fully 3D case is a lot more complicated than 2.5D case and it takes substantial computational resources …. See Cohl & Tohline (ApJ 1999); Binney & Tremaine, Galactic Dynamics
Finding the gravitational potential using the Poisson integral For a simple 2D Cartesian grid M(x l,y m ) is the mass contained in grid zone (l,m) x y l=0 l=1 l=2 l=N-1 m=N-1 m=2 m=1 m=0 No boundary values involved in the summation!
Now let’s assume that our computational grid is equidistant. Gravitational potential in zone (l,m) created by unit mass located in zone A much faster way for evaluating the double sum is to use the convolution theorem Direct summation takes N 2 operations, where N is the total number of grid zones
The convolution theorem product of Fourier transforms direct Fourier transform inverse Fourier Transform This sum can be calculated using the following three steps B and C are periodic with a period of 2N
Doubling the computational domain Convolution sum Our gravitational potential N N M and G are in general non-periodic and we have to make them periodic We may require M be periodic with a period of 2N because M = 0 in zones 2,3,4. With G it is not that simple because G ≠ 0
N N Re-arranging the computational domain to make G periodic N-1
Let’s assign to some arbitrary values along m=0 l=-N l=-3 l=-2 l=1 l=0 l=1 l=2 l=N-1 m=N-1 m=2 m=1 m=0 m=-1 m=-2 m=-3 m=-N
Singularity of the Green function However, it is possible to calculate the contribution of the material in the (l,m) th cell to the potential in the same cell by assuming constant surface density within the cell and integrating over the cell area within an individual cell (l,m)
after a few pages of algebra … defining and noticing that
3D Cartesian coordinates The extension to 3D Cartesian coordinates is straightforward … has to be taken numerically …. Problem: the convolution method takes a lot of memory in 3D due to doubling of the computational grid. Some remedy: see Hockney and Eastwood, Computer simulations using particles. The Fourier transform of the Green function has to be taken only once if the grid is not arbitrarily varying during simulations. This leaves us with 2 FFTs each taking 2 N log 2 N operations where N is the total number of grid zones. The direct summation takes N 2 operations and we have a speedup for N > 16.
3D cylindrical coordinates If and z coordinates are discretized evenly, the sums over and are a convolution, but the sum over is not, irrespective of the discretization! The procedure is to rearrange the triple sum and take the inner two sums for each and every cylindrical layer using the convolution theorem (thus finding the gravitational potential of the layer) and then perform a direct summation over all cylindrical layers. constants Slower, but takes less memory since doubling is needed in z-direction only. See more details in Pfenniger & Friedly, A&A, 1993
2D polar coordinates Logarithmically spaced grid in r-direction Simulations of galactic and stellar disk dynamics require high resolution in the inner regions, while a lower resolution may be sufficient in the outer regions
reduced potential We introduce a new radial coordinate reduced surface density See more in Binney & Tremaine, Galactic Dynamics, pp
FFT libraries ACML (AMD architecture, OpenMP parallelized, free) ICML (Intel architecture, commercial) MKL (Intel architecture, commercial) FFTW (MPI parallelized, OpenMP parallelized?, free)
Thank you!