International Mathematical Forum, Vol. 6, 2011, no. 55, 2729 - 2736

Multigrid Method for Solving 2D-Poisson Equation

with Sixth Order

Bouthina S. Ahmed1 and S. J. Monaquel2

1) Mathematics Department, Rabigh Faculty of Science & Arts King Abdul Aziz University,P.O. Box, 344, Rabigh 21911, Saudi Arabia [email protected]

2) Mathematics Department, Faculty of Science King Abdul Aziz University, Jeddah, Saudi Arabia [email protected]

Abstract

In this paper we develop a sixth order finite difference discretization strategy to solve the two dimensional Poisson equation. We use multigrid V-cycle procedure to built multiscale multigrid method which is similar to the full multigrid method. Numerical results are given to illustrate this method.

Mathematics subject classification: 65Mxx

Keywords: Poisson equation, six order finite difference method, multigrid method.

1-Introduction

Poisson equation is a partial (PDF) with broad application s in mechanical engineering, theoretical physics and other fields. The two dimensional (2D) Poisson equation can be written in the form: uxx (x, y) + u yy (x, y) = f (x, y), (x, y) ∈ Ω (1)

Where Ω is a rectangular domain, or union of rectangular domains, with suitable boundary conditions defined on ∂Ω . The solution u(x,y) and forcing function f(x,y) are

2730 B. S. Ahmed and S. J. Monaquel

assumed to be sufficiently smooth and have the necessary derivatives up to certain orders. A second order accurate solution can be computed by applying standard second order centeral difference operators uxx (x, y) and u yy (x, y) in Eq (1). Higher order (more than two) accurate discertization methods need more complex procedure than the second order accurate discretization method to compute the coefficient matrix, but they usually generate linear systems of much smaller size, compared with that from the lower order accurate discetization method [1,4] . There has been growing interest in developing higher order accurate discretization methods, especially the high order compact difference scheme to solve partial differential equations (PDEs) [6, 8, 9, 10].

2-Sixth order compact approximation

This method is similar to a sixth-order accurate approximation to the derivatives calculated from Helmholtz equation [5]. We the scheme for the two dimensional uniform Cartesian grids with grid spacing Δx = Δy = h . The mesh points are (xi , y j ) with xi = ih a y j = jh, 0 ≤ i ≤ N, 0 ≤ j ≤ N where N is the number of uniform intervals in the x and y directions. We write the second order central difference operators as

u − 2u + u u − 2u + u 2 i+1, j i, j i−1, j 2 i, j+1 i, j i, j−1 δ u = , δ u = , x i, j 2 y i, j 2 h h (2)

Using Taylor series expansions at the grid point (xi , y j ) , we have

2 2 4 6 6 2 ∂ u h ∂ u h ∂ u 6 δ u = + + + O(h ) x i, j 2 4 6 ∂x 12 ∂x 360 ∂x (3)

2 2 4 6 6 2 ∂ u h ∂ u h ∂ u 6 δ u = + + + O(h ) y i, j 2 4 6 ∂y 12 ∂y 360 ∂y (4)

The central difference difference for Eq. (1) can be written as 2 2 δ x ui, j + δ y ui, j + Ti, j = fi, j (5) where ui, j = u (xi , y j ) , fi, j = f (xi , y j ) and

Multigrid method for solving 2D-Poisson equation 2731

2 4 4 4 6 6 h ⎛ ∂ u ∂ u ⎞ h ⎛ ∂ u ∂ u ⎞ 6 T = − ⎜ + ⎟ − ⎜ + ⎟ + O(h ) i, j ⎜ 4 4 ⎟ ⎜ 6 6 ⎟ 12 ⎝ ∂x ∂y ⎠ 360 ⎝ ∂x ∂y ⎠ (6)

Using the following appropriate derivatives of Eq. (1)

4 2 2 4 4 2 2 4 ∂ u ∂ f 2 ∂ u ∂ u ∂ u ∂ f 2 ∂ u ∂ u = − k − , = − k − , 4 2 2 2 2 4 2 2 2 2 ∂x ∂x ∂x ∂x ∂ y ∂y ∂y ∂y ∂y ∂x (7)

In Eq. (6) we get 2 ⎛ ⎡ 4 ⎤ ⎞ 4 ⎛ 6 6 ⎞ h ⎜ 2 ∂ u ⎟ h ⎜ ∂ u ∂ u ⎟ 6 Ti, j = − ∇ fi, j − 2⎢ ⎥ − + + O(h ) 12 ⎜ 2 2 ⎟ 360 ⎜ 6 6 ⎟ ⎝ ⎣⎢∂x ∂y ⎦⎥i, j ⎠ ⎝ ∂x ∂y ⎠i, j (8)

∂4u The fourth order approximation of in Eq. (8) can be written as ∂x2∂2 y

4 2 6 6 ⎡ ∂ u ⎤ 2 2 h ⎡ ∂ u ∂ u ⎤ 4 ⎢ ⎥ = δ x δ yui, j − ⎢ + ⎥ + O(h ) 2 2 12 4 2 2 4 ⎣⎢∂x ∂ y ⎦⎥i, j ⎣⎢∂x ∂ y ∂x ∂ y ⎦⎥i, j (9)

Substituting Eq. (9) into Eq. (8), we get

2 4 6 6 6 6 h 2 2 2 h ∂ u ∂ u ∂ u ∂ u 6 Ti, j = (∇ fi, j + 2δ x δ yui, j ) 6 + 5 4 2 + 5 2 4 + 6 + O(h ) 12 360 x x y x y y ∂ ∂ ∂ ∂ ∂ ∂ i, j (10)

Clearly, getting a compact sixth-order approximation requires compact expressions of the four derivatives of order six in Eq. (1) which can be done by further differentiating Eq. (10) that is 4 6 6 ∂ f ∂ u ∂ u = + 2 2 4 2 2 4 ∂x ∂y ∂x ∂y ∂x ∂y (11)

2732 B. S. Ahmed and S. J. Monaquel

6 6 6 6 ∂ u ∂ u 4 ⎛ ∂ u ∂ u ⎞ + = ∇ f − ⎜ + ⎟ 6 6 ⎜ 4 2 2 4 ⎟ ∂x ∂y ⎝ ∂x ∂y ∂x ∂y ⎠ (12)

Substituting Eq. (7), (11) into Eq. (13) gives

6 6 4 ∂ u ∂ u 4 ∂ f + = ∇ f − 6 6 2 2 ∂x ∂y ∂x ∂y (13)

Using Eq. (11), (13) we can eliminate all derivatives of u in Eq. (10) that is

2 4 ⎛ 4 ⎞ h 2 2 2 h ⎜ 4 ⎡ ∂ u ⎤ ⎟ 6 T = − ∇ f + 2δ δ u − ∇ f + 4 + O(h ) i, j ()i, j x y i, j ⎜ i, j ⎢ 2 2 ⎥ ⎟ 12 360 ⎜ ⎢∂x ∂ y ⎥ ⎟ ⎝ ⎣ ⎦i, j ⎠i, j (14)

The compact sixth-order approximation of two dimensional can be written as

2 2 4 4 ⎡ 4 ⎤ h 2 2 h 2 h 4 h ⎢ ∂ f ⎥ δ δ u + ⎜⎛δ 2 + δ 2 ⎟⎞u = f + ∇ f + ∇ f + x y i, j x y i, j i, j i, j i, j ⎢ ⎥ 6 ⎝ ⎠ 12 360 90 ∂2∂ 2 ⎣⎢ x y ⎦⎥

(15) We can express Eq. (16) in the form

10 2 − u + ⎜⎛u + u + u + u ⎟⎞ 3 i, j 3 ⎝ i + 1, j i − 1, j i, j + 1 i, j − 1⎠ 1 + ⎜⎛u + u + u + u ⎟⎞ 6 ⎝ i + 1, j + 1 i + 1, j − 1 i − 1, j + 1 i − 1, j − 1⎠

4 6 6 ⎡ 4 ⎤ 2 h 2 h 4 h ∂ f = h f + ∇ f + ∇ f + ⎢ ⎥ (16) i, j i, j i, j 12 360 90 ⎢∂2∂2 ⎥ ⎣⎢ x y ⎦⎥

3- Multigrid method

Algorithm 1

u 1- Let 2h be the solution on the coarse gridΩ 2h

Multigrid method for solving 2D-Poisson equation 2733

2- Use some high order interpolation schemes here we use Newton difference h interpolation, to interpolate Ω2h , uh = I2h to the coarse grid (we interpolate even, even, odd, even and even, odd grids points Fig. 1). 3- Update every (odd-odd) grid point on From Eq. (16) for each point the updated solution is

⎡ 2 ⎤ F + ⎜⎛u + u + u + u ⎟⎞ ⎢ i, j i + 1, j i − 1, j i, j + 1 i, j − 1 ⎥ k + 1 3 ⎝ ⎠ ⎛10 ⎞ u = ⎢ ⎥ /⎜ ⎟ i, j 1 ⎛ ⎞ ⎝ 3 ⎠ ⎢+ ⎜u k + u k + u k + u k ⎟⎥ ⎣⎢ 6 ⎝ i + 1, j + 1 i − 1, j + 1 i + 1, j − 1 i − 1, j − 1 ⎠⎦⎥

Here, Fi, j represents the right-hand side of Eq. (16)

4- Update every (odd, even) grid point on Ωh from Eq. (16)

5- Update every (even, odd) grid point on Ωh from Eq. (16) h,k+1 h,k 6- Compute the l norm Ω R = u − u if not converged go back to 2 2h 2 step3.

7- Compute residual on the fine grid Ωh from Lh − fh = dh and use full weighting scheme to project residual from fine grid to the coarse grid. 8- Use interpolation to transfer corrections from the coarse grid to the fine grid.

L u = f 9- Relax υ1 times on h h h . 10- Use from the previous step as the initial guess to run the multigrid until it Converges.

2734 B. S. Ahmed and S. J. Monaquel

Fig. 1. Illustration of the operator based interpolation scheme for a 5x5 fine grid

4- Modified multiscale multigrid method

The convergence rate of multigrid method is independent of the grid size [2, 3, 7]. Here we use a geometric multiscale multigrid method [3] which is similar to full multigrid method.

Algorithm 2- Multiscale multigrid method

h 1- Use the Newton interpolation difference method to interpolateuh = I 2hu2h .

2- Relax υ1 times on Lhuh = f h . 2h R r 3- Restrict the residual r to the coarse grid Ω2h by h h (we use full weighting scheme to restrict the residual from the fine grid to the coarse grid) L u = f 4- Relax υ 2 times on h h h .

5- Use uh from the previous step as the initial guess to run the multigrid V-cycle algorithm MG(uh , fh ) on the fine grid until it converges.

Multigrid method for solving 2D-Poisson equation 2735

5- Numerical Results

Problem A Consider Poisson equation

∂2u ∂2u + = −2π 2 sin(πx)sin(πy) 0 ≤ x ≤ 1 and 0 ≤ y ≤ 1 ∂x2 ∂y2 with Dirichlet boundary conditions on all sides f unit square, that is

u(0, y) = u(1, y) = u(x,0) = u(x,1) = 0

The exact solution is u(x, y) = sin πx sin πy

Problem B Consider Poisson equation

∂2u ∂2u + = −sin π y, 0 ≤ x ≤ 1 and 0 ≤ y ≤ 1 ∂x2 ∂y2 with the Dirichlet boundary conditions

u(x,0) = u(x,1) = 0 1 u((0, y) = 0, u(1, y) = − sin(πy)(eπ −1) π 2 1 The exact solution is u(x, y) = − sin(π y)(eπx −1) π

In Table 1, 2 we compute the l2 - norm, maximum norm of the error and the order of accuracy, for different values of N for problem A and B respectively. It is clear the highest accuracy of the method.

N e e Order ∞ 2 2 0.21850903e-1 0.72836343e-2 4 0.27610356e-3 0.11044145e-3 6.04 8 0.40788436e-5 0.18128598e-5 5.9289 16 0.6299437e-7 0.29689777e-7 5.9322 32 0.11497659e-8 0.61250031e-8 5.5991 64 0.39523036e-9 0.18549957e-9 5.0452 128 0.40222975e-10 0.13368717e-10 3.7945 Table 1

2736 B. S. Ahmed and S. J. Monaquel

N e e Order ∞ 2 2 0.5450876e-2 0.18169587e-2 4 0.97804779e-4 0.38482641e-4 6.04 8 0.15265328e-5 0.67417782e-6 5.9289 16 0.24414719e-7 0.11333841e-7 5.9322 32 0.16249981e-8 0.39346991e-9 5.5991 64 0.39523036e-9 0.28879362e-9 5.0452 128 0.40222975e-10 0.13368717e-10 3.7945 Table 2

6- Conclusion

A 9-point sixth-order accurate compact finite difference scheme with multigrid method for solving Poisson was developed. Numerical results show that efficiency of this method.

References

[1] Adam, Highly accurate compact implicit methods and boundary conditions J. Compute. Phys., 24 (1) (1977), 10-22. [2] A. Brandt, Multi-level adaptive solution to boundary-value problems, Math. Compute., 31 (138), 333-390. [3] W.L.Briggs, V. E. Henson, S.F. McCormick, A multigrid Tutorial, Second ed. SIAM, Philadelphia, PA, (2000). [4]M.M. Gupta, Kouatchou, J. Zhang, comparison of second and fourth order discretization for multigrid Poisson solver, J. Compute. Phys., 132 (1977), 226-232. [5] M.Nabavi, M.H. K.Siddique, J.Dargahi A new 9-points sixth –order accurate compact finite-difference method for the Helmholtz equation J. Sound and Vibration, 307(2007), 972-982. [6] W.F.Spotz, G.F. Carey, High-order compact scheme for the steady stream-function vorticity equations, Int, J. Numer. Methods Eng., 38(1995), 3497-3512. [7] P. Weaseling, An Introduction to multigrid Methods, Wily, Chichester, England. (1992) [8] J. Zhang, An explicit fourth-order compact finite difference scheme for the three dimensional convection-diffusion equation, Commun. Numer. Methods Eng., 14 (1998), 209-218. [9] J. Zhang Multigrid method and fourth order compact difference scheme for 2D Poisson equation with unequal mesh size discretization, J. Compact. phys., 179 (2002), 170-179. [10] Y. Wang, J. Zhang sixth order compact scheme combined with multigrid method and extrapolation technique for 2D Poisson equation J. Comput. Phys., 228 (2009), 137-146.

Received: April, 2011