09.05.2013 Views

Poisson FFT Solver under the Dirichlet Boundary Condition

Poisson FFT Solver under the Dirichlet Boundary Condition

Poisson FFT Solver under the Dirichlet Boundary Condition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Poisson</strong> <strong>FFT</strong> <strong>Solver</strong> <strong>under</strong> <strong>the</strong> <strong>Dirichlet</strong> <strong>Boundary</strong> <strong>Condition</strong><br />

Masayoshi Kiguchi<br />

RIST, Kinki University<br />

3-4-1 Kowakae, Higasi-Osaka<br />

(Received January 9, 2007)<br />

Abstract<br />

In order to clear <strong>the</strong> misconception that <strong>FFT</strong> is not applicable to solve <strong>the</strong> <strong>Poisson</strong> equation with<br />

<strong>Dirichlet</strong> boundary condition, we have study <strong>the</strong> <strong>FFT</strong> algorithm and find it useful in <strong>the</strong> simulation of star<br />

formation.<br />

1 Introduction<br />

The time consuming part of <strong>the</strong> simulation for <strong>the</strong> star formation is in <strong>the</strong> calculation of gravity. Although<br />

<strong>the</strong> most severe neck is in <strong>the</strong> calculation of radiative transfer in <strong>the</strong> region with optical depth of about one, if<br />

we compromise to use <strong>the</strong> adequate diffusion approximation, we can get not so wrong solutions and we can<br />

be free from <strong>the</strong> restriction of computation time. In contrast, as <strong>the</strong> calculation of gravity is too fundamental,<br />

if we solve it sloppy, we get improper solutions and we are led to a wrong result. We need to find gravity<br />

carefully.<br />

The gravity in <strong>the</strong> simulation of star formation is described by <strong>the</strong> <strong>Poisson</strong> equation with <strong>Dirichlet</strong> boundary<br />

condition. this condition is essential especially for <strong>the</strong> case of local refinement calculation. It is not<br />

allowed to apply <strong>the</strong> cyclic boundary condition to this problem.<br />

In this case, <strong>the</strong> conjugate gradient method (van der Vorst, 1981) or multi-grid method (Brandt, 1977) or<br />

esoteric craftsmanship SOR method has been used in many codes. If we can use Fast Fourier Transformation,<br />

<strong>FFT</strong>, (Cooley and Tukey, 1965) in this problem, we can get a sure solution with computational complexity<br />

of N log N free from <strong>the</strong> problem of convergence. Regardless of this merits, this method has not been used.<br />

When I asked to an expert of simulation, his answer was that it is difficult to fit this method to <strong>the</strong> problems.<br />

In order to clear this misconception, I will confirm <strong>the</strong> effectiveness of <strong>the</strong> <strong>FFT</strong> methods to solve <strong>the</strong> <strong>Poisson</strong><br />

equation with <strong>Dirichlet</strong> boundary conditions.<br />

2 Algorithm<br />

Solvability of <strong>Poisson</strong> equation by <strong>FFT</strong> is based on <strong>the</strong> following fact: <strong>the</strong> solution φ of <strong>Poisson</strong> equation<br />

△φ =4πGρ (1)<br />

<strong>under</strong> <strong>the</strong> <strong>Dirichlet</strong> boundary condition is given by <strong>the</strong> superposition of two terms, φ = φ poisson + φlaplace,<br />

where φpoisson is <strong>the</strong> solution of Laplace equation<br />

△φ =0 (2)<br />

<strong>under</strong> <strong>the</strong> given <strong>Dirichlet</strong> boundary condition, and φlaplace is <strong>the</strong> solution of <strong>Poisson</strong> equation (1) <strong>under</strong> <strong>the</strong><br />

boundary condition φ =0.


To solve <strong>the</strong> <strong>Poisson</strong> equation numerically, we make a cubic lattice system from N 3 =(2 n ) 3 grid points<br />

in <strong>the</strong> regin −1 ≤ x, y, z ≤ 1 and find <strong>the</strong> value of φix,iy,iz at <strong>the</strong> grids point ,0 ≤ ix,iy,ix


ano<strong>the</strong>r surfaces. We can solve (2) to obtain φi by separation of variables. The potential φi, for which <strong>the</strong><br />

boundary value in jz =0plane is ψjxjy, is given by<br />

3 Result<br />

φjxjyjz =<br />

N−1 <br />

kx,ky,kz=1<br />

sinh(π<br />

˜ψkxky<br />

k2 x + k2 y(N − kz)/N)<br />

sin( πjxkx<br />

N )sin(πjyky<br />

), (9)<br />

N<br />

˜ψkxky =( 2<br />

N )2<br />

N−1 <br />

jx,jy=1<br />

π k 2 x + k2 y<br />

ψjxjy sin( πjxkx<br />

N )sin(πjyky<br />

). (10)<br />

N<br />

We have compared <strong>the</strong> calculated solution with <strong>the</strong> analytic solution for <strong>the</strong> potential of <strong>the</strong> uniform density<br />

ellipsoid. The external potential of uniform ellipsoid (Chandrasekhar, 1969) with <strong>the</strong> axis length of a 1 ≥<br />

a2 ≥ a3 and <strong>the</strong> density ρ is given by<br />

1<br />

− φ(x1,x2,x3)<br />

πGρa1a2a4<br />

1<br />

=<br />

2<br />

<br />

2 a1 − a2 (F (φ, k) −<br />

3<br />

1<br />

(a 2 1 − a2 3 )<br />

(x 2 1<br />

k2 (F (φ, k) − E(φ, k)) + x22 k2 (Π(φ, k2 ,k) − F (φ, k)) + x 2 3<br />

where F is <strong>the</strong> elliptic integral of Legendre first kinds<br />

E is of second kinds<br />

and Π is of third kinds<br />

The internal potential is given by<br />

×( (a2 1 − x2 1 )<br />

k 2<br />

Π(φ, n, k) =<br />

F (φ, k) =<br />

E(φ, k) =<br />

φ<br />

0<br />

− φ(x1,x2,x3)<br />

πGρa1a2a3<br />

φ<br />

0<br />

φ<br />

0<br />

(Π(φ, 1,k) − F (φ, k)), (11)<br />

dθ<br />

1 − k 2 sin 2 θ , (12)<br />

<br />

1+k 2 sin 2 θdθ, (13)<br />

1<br />

(1 − n sin 2 1<br />

dθ. (14)<br />

θ) 1 − k2 2<br />

sin θ<br />

=<br />

2<br />

(a 2 1 − a 2 3) a 2 1 − a 3 3<br />

(F (φ, k) − E(φ, k)) + (a22 − x22 )<br />

k2 (Π(φ, k 2 ,k) − F (φ, k)) + (a 2 3 − x23 )(Π(φ, 1,k) − F (φ, k))).<br />

(16)<br />

We have used Intel 3.2GHz Xeon processor and icc compiler. In <strong>the</strong> following, we show <strong>the</strong> result of a<br />

computation. In this computation, <strong>Poisson</strong> equation is solved in <strong>the</strong> regin −1 ≤ x, y ≤ 1, −0.1 ≤ z ≤ 0.1.<br />

The axis lengths of ellipsoid is a1 = a2 =0.5, a3 =0.05. Grid number is 64 3 and <strong>the</strong> computation time was<br />

0.6795 s The numerical error of <strong>the</strong> potential is <strong>the</strong> same order to <strong>the</strong> numerical error of <strong>the</strong> integration of <strong>the</strong><br />

mass density.<br />

(15)


References<br />

-0.02<br />

-0.04<br />

-0.06<br />

-0.08<br />

-0.1<br />

-0.12<br />

-0.14<br />

-0.16<br />

-0.18<br />

-0.2<br />

-0.22<br />

-0.24<br />

phi<br />

0<br />

0.2<br />

0.4<br />

0.6<br />

0.8<br />

1<br />

1.2<br />

1.4 -0.1<br />

-0.08<br />

0.08<br />

0.06<br />

0.04<br />

0.02<br />

0<br />

-0.02<br />

-0.04<br />

-0.06<br />

0.1<br />

z<br />

r<br />

Numerical<br />

-0.05<br />

-0.1<br />

-0.15<br />

-0.2<br />

Analytic<br />

-0.05<br />

-0.1<br />

-0.15<br />

-0.2<br />

Figure 1: Comparison of potential φ between numerical calculation and analytic solution<br />

[1] Brandt, A., 1977, Math. Comput. 31, 333.<br />

[2] Chandrasekhar, S., 1969, “Ellipsoidal Figures of Equilibrium”.<br />

[3] Cooley, J. and Tukey, J., 1965, Ma<strong>the</strong>matics of Computation 19, 297.<br />

[4] van der Vorst, H. A., 1981, Journal of Computational Physics, 44, 1.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!