Sie sind auf Seite 1von 12

International Journal of Mathematics and

Computer Applications Research (IJMCAR)


ISSN(P): 2249-6955; ISSN(E): 2249-8060
Vol. 4, Issue 6, Dec 2014, 75-86
TJPRC Pvt. Ltd.

TWO FULL MULTIGRID ALGORITHMS IN CARTESIAN AND POLAR


COORDINATE SYSTEMS TO SOLVE AN ELLIPTIC PARTIAL DIFFERENTIAL
EQUATION WITH A MIXED DERIVATIVE TERM IN A QUARTER OF A UNIT CIRCLE
OSAMA EL-GIAR
Department of Basic Science, Modern Academy for Engineering and Technology in Maadi, Cairo, Egypt

ABSTRACT
In this paper we introduce two full multigrid algorithms in a Cartesian and a Polar coordinate system that have
been modified to treat the elliptic partial differential equations with a mixed derivative term, in the two dimensional space
in a quarter of a unit circle, special modification for the points in the neighborhood of the curved boundary has been done.
An advantage of the two algorithms is that the extension from two to three space dimensions is straightforward. numerical
examples have been given.

KEYWORDS: Multigrid Method, Numerical Analysis, Elliptic PDE, Cartesian and Polar Co-Ordinate Systems
1 FULL MULTIGRID ALGORITHMS IN CARTESIAN COORDINATES
1.1 INTRODUCTION
Consider the general linear elliptic partial differential equation:
R2

LU = AUxx + 2BUxy + CUyy + F = 0

(1.1a)

with Dirichlet boundary conditions


U=F

R2

(1.1b)

Where is a quarter of a unit circle.

A difference approximation Lh

of L in equation 1.1a

is said to be of order p if Lh(U) = O(h ), where h is the mesh size. In our case p = 2, so we
shall

use

the

6-point

difference

equation

to

the

mixed

derivative

term

Uxy

to

avoid

the

absent

points in our grids because of the curved boundary see [3] and [4]
1.2 Finite Difference Discretizaton
For each grid we replace each term in equation 1.1a by a second order finite difference approximation for two kinds of points as follows:
1.Normal Points: These points are interior points are not laying near the curved boundary:
for a grid with mesh size is h, we have the following discretizaton:
Uxx = h2 (ui+1,j + ui1,j 2ui,j)
Uyy = h2 (ui,j+1 + ui,j1 2ui,j)

(1.2)

Uxy = h2 (ui,j ui1,j ui,j1 + ui1,j1)

www.tjprc.org

editor@tjprc.org

76

Osama El-Giar

Substitute these values in equation 1.1a we get the following system of linear equations for normal
points:

(1.3)

2.Curved

Boundary

Points:

see [4] and Figure 1

These

When the

points

are

boundary is

points

that

laying

near

the

curved and intersects the

curved
rectangular

boundary:
grid at

points that are not grid points, so we shall

Figure 1: Curved Mesh


Give the finite difference approximation to the derivatives at the points in the neighborhood of the
curved boundary thus:
U

xx

yy

2
= h 2
(

1
+

j +1, j

2
2
u i 1, j
u
i , j
(1 + )

2
2
2
= h 2
u i , j +1 +
u i , j 1
u i, j

(
1
+

)
(
1
+

(1.4)

Uxy = h2 (ui,j ui1,j ui,j1 + ui1,j1)


Substituting 1.4 into 1.1a we get a system of linear equations for the points in the neighborhood
of the curved boundary given by:
2 ai , j
a i, j

2 ci, j
(1 + ) u i + 1 , j + 2 1 + b i , j u i 1 , j + (1 + ) u i , j + 1

Impact Factor (JCC): 4.2949

Index Copernicus Value (ICV): 3. 0

77

Two Full Multigrid Algorithms in Cartesian and Polar Coordinate Systems to Solve an Elliptic
Partial Differential Equation with a Mixed Derivative Term in a Quarter of a unit Circle

ci, j
+ 2
bi, j
1+

a
u i , j 1 2 i , j + i , j b i , j

i,j N 1, h =

Where 1

u i , j + 2 b i , j u i 1 , j 1 = h 2 f i , j

(1.5)

1
, N is the number of interior points in each direction
N +1

h, h

are the distances from the point in the neighborhood of the boundary and the curve boundary in
direction of the x-coordinate and the y-coordinate respectively.
1.3 Multigrid Method
A sequence of 5 grids kh have been used with mesh sizes kh, k = 2n, n = 0, 1, 4,
where h = 64. The elliptic equation

have been

solved using full multigrid V (1, 2)-cycle

method with the coarse grid correction (CGC), see Figure 2 and has the following components:
1. Coarse to Fine Interpolation with Operator

h
2h

: Within the V-cycle, we will use correction

interpolation where corrections are to be interpolated from coarser grids and added to finer grids and the full
multigrid interpolation where current values of the approximate solution on the coarser grid are interpolated as the first
approximation to the solution (on the first visit to the grid) on the finer grids, see [2], we choose for both cases of
interpolations the bilinear interpolation. Now we have two kinds of points see figure 3:

Figure 2: FMG V (2, 1)


(a) Normal Points:

u
u

h
2i,2 j

h
2 i +1 , 2 j

2 i , 2 j +1

1
2

(u

i, j

1
2

(u

i, j

2 i + 1 , 2 j +1

2h
i, j

1
4

for common points in the two grids, (point 13)


2h

2h

(u

2h
i +1 , j

+ u i , j +1

2h
i, j

2h

) for odd points in the x direction, (point 12)

) for odd points in the y direction, (point 8)


)

2h
2h
2h
+ u i +1, j + u i , j +1 + u i +1, j +1 for remaining points in, (point 7)

(1.6)

(B) Curved Boundary Points


www.tjprc.org

editor@tjprc.org

78

Osama El-Giar

Since we have used red- black gauss-Seidel iteration, then we need interpolation only for odd points in
the x and y directions respectively defined by

for odd points in the x direction, (point 14)

h
2 i , 2 j +1

+h

2h
i, j

hu

2h
i , j +1

for odd points in the

direction, (point 19)

(1.7)

Figure 3: Numbering Two Grids


2. Fine to Coarse Restriction Operator: The restriction operator denoted by I

2h
h

I h2 h R h = R 2 h where the

computed on the fine-grid and transfer it to the coarse-grid according to the rule:
components of

takes the residual equation

Rij2 h of R 2 h are given by the following two schemes- see [2] and [3]:

(a) Half-Weight: If B = 0 in equation 1.1a, we use the red-black Gauss-Seidel relaxation it is better to use the
half-weight operator since the residual at the black (odd) points must vanish and the stencil of the half-weight operator
takes the form:

2h
h

0
1
= 1
8
0

0
1
0

1
4
1

2h

(1.8)
h

(b) Full-Weight: If B = 0 in equation 1.1a, we use the red-black Gauss-Seidel relaxation, so we may use either the
half-weight operator or the full-weight operator, or it is better to use the half-weight operator for normal points and
full-weight operator for curved boundary points. The stencil of the full-weight operator takes the form:

I
1.4

2h
h

1
1
=
2
16
1

1
2
1

2
4
2

2h

(1.9)
h

Test Problems, Results and Performance


In this section we report the results and performance of some test problems All our implemen-tations in

Fortran
The

were

executed

accuracy of the

on

method

a
is

pentium
measured

PC

by both L2

using

FORTRAN90

norm of both

workstation

defect

and

error

compiler.
and the

max norm of both defect and the error. The general formula for the test problem is given by:

Impact Factor (JCC): 4.2949

Index Copernicus Value (ICV): 3. 0

79

Two Full Multigrid Algorithms in Cartesian and Polar Coordinate Systems to Solve an Elliptic
Partial Differential Equation with a Mixed Derivative Term in a Quarter of a unit Circle

AUxx + 2BUxy + CUyy + F = 0

R2

Consider the following test problems:


1. Test Problem 1:

2. Test Problem 2:

Let A = C = 1, B = 0 using half-weight restriction:


2
2 2xy
Uexact = e2xy, F (x,y) = 4(x + y )e

(1.10a)

Uexact = sin(3x + y), F (x,y) = 10 sin(3x + y)

(1.10b)

Let A = C = B = 1, using half-weight restriction:

1
2

3. Test Problem 3:

2
2
2xy
Uexact = e2xy, F (x,y) = 4(x + y + xy + )e

(1.11a)

Uexact = sin(3x + y), F (x, y) = 13 sin(3x + y)

(1.11b)

Let A = C = B = 1, using full-weight restriction:

1
2

2
2
2xy
Uexact = e2xy, F(x,y)=4(x +y +xy+ )e

(1.12a)

Uexact = sin(3x + y),

(1.12b)

F (x, y) = 13 sin(3x + y)

Test Problem 1: Equation 1.10a and Equation 1.10b


Table 1: Fortran Implementation of Test Problem 1 Using F M V (2, 1) on PC

Test Problem 2: Equation 1.11a and Equation 1.11b


Table 2: Fortran Implementation of Test Problem 2 Using F M V (2, 1) on PC

www.tjprc.org

editor@tjprc.org

80

Osama El-Giar

Test Problem 3: Equation 1.12a and Equation 1.12b


Table 3: Fortran Implementation of Test Problem 3 Using F M V (2, 1) on PC

2 Full Multigrid Algorithms in Polar Coordinates


2.1 Introduction
A multigrid algorithm has been modified to treat the elliptic boundary value problem for partial differential
equations with a mixed derivative term in two dimensional space in polar coordinates. A full multigrid algorithm in which
W (1, 2) with a line relaxation scheme are used to deal with the finite difference approximation of the mixed derivative
term in polar coordinates. Full weight restriction of residuals and linear interpolation operators are used. Numerical
examples are given.
Consider the elliptic partial differential equation with a mixed derivative term Ur in polar coordinates which is

Impact Factor (JCC): 4.2949

Index Copernicus Value (ICV): 3. 0

81

Two Full Multigrid Algorithms in Cartesian and Polar Coordinate Systems to Solve an Elliptic
Partial Differential Equation with a Mixed Derivative Term in a Quarter of a unit Circle

equivalent to equation 1.1 with A = C = 1, B =

(1 + sin

cos

) Urr +

1
:
2

1
1
(1 sin cos ) Ur + 2 (1 sin cos ) U
r
r

1
1
sin 2 cos 2 U + cos 2 sin 2 U r = F ( r , ),
2
r
r

(2.1)

where =
(r , ),0 r 1,0 0 , subject to the dirchlit boundary conditions:
4

U = g

(2.2)

2.2 Finite Difference Discretizaton


For each grid we replace each term in equation 2.1 by a second order finite approximation as follows
see Figure 4
Urr = h2 (ui+1,j + ui1,j 2ui,j)
Ur = (2h)1 (ui+1,j ui1,j)
U = ()2 (ui,j+1 + ui,j1 2ui,j)

(2.3)

U = (2)1 (ui,j+1 ui,j1) and


Ur = (4h)1 (ui+1,j+1 + ui1,j1 ui+1,j1 ui1,j+1)

Figure 4 : Descritization of a Quarter of a Unit Circle


substitute these values in equation 2.1 we get the following system of linear equations:
D1
C
1
0

...
0

www.tjprc.org

B1
D1
C

0
B1
D

...
...
1

B1

...

...

...

...
...

C1
0

D
C1

0
B1

D 1
0
0

u1
u
2

M
u N 1

b1

b
2

= M

b N 1

(2.4)

editor@tjprc.org

82

Osama El-Giar

where 1

D1 = 2 1 + 1 sin 2 +

B1 =

C1 =

1
1
, =
, are the mesh size and
N +1
2( N + 1)

I, j N 1, h
1

(i )2

1 sin 2
2

cos 2
1 sin 2
2
2 i 2

(i )2
1

(i )

(2.5)

cos 2
1 sin 2 +
2
2 i 2

where N is the number of interior points in each direction


2.3 Multigrid Method
A sequence of 5 grids kh have been used with mesh sizes kh, k = 2n, n = 0, 1, 4,

1
. The elliptic equation have been solved using full multigrid W-cycle method with the coarse
64

Where h =

grid correction (CGC), see Figure 5 and has the following components:

Figure 5: FMG W-Cycle


Line Relaxation: Since the finite difference approximation of the mixed derivative term contains the four corner
points, then a scheme of line-relaxation should be used, (first we may first relax the solution at even (odd) lines, then relax
at the odd (even) lines, this gives the tridiagonal system of linear equation 2.4.
Interpolation Operator
defined on Gh using

h
2h

h
2h

: It takes coarse-grid vectors u2h defined on G2h and produces fine grid vectors uh

u 2 h = u h , the components of uh are divided into 4 groups as follows- see figure 4:

(a) Common points of the two grids

u2hi , 2 j = ui2, hj (point 5)

(2.6)

(b) Radial points

h
2 i +1, 2 j

1
2

(u

h
2 i 1 , 2 j

Impact Factor (JCC): 4.2949

2h
i +1 , j

(points 4, 6)

(2.7)

Index Copernicus Value (ICV): 3. 0

83

Two Full Multigrid Algorithms in Cartesian and Polar Coordinate Systems to Solve an Elliptic
Partial Differential Equation with a Mixed Derivative Term in a Quarter of a unit Circle

(c) Angle points

h
2 i , 2 j +1

(u

1
4

+ u 2 i +1, 2 j + u 2 i 1, 2 j + 2 + u 2 i +1, 2 j + 2
h

2 i 1, 2 j

(points 2, 8)

(2.8)

where the right hand side is obtained from 2.7.


(d) Intermediate points: They are two kinds:
i. Points are not in the neighborhood of the center of the circle

h
2 i +1 , 2 j +1

1
4

(u

2h

+ u i +1 , j + u i , j +1 + u i +1 , j +1
2h

i, j

2h

2h

(points 3, 9)

(2.9)

ii. Points are in the neighborhood of the center of the circle

h
2 i +1, 2 j +1

1
3

(u

2h
i, j

+ ui+1, j + ui+1, j +1
2h

Restriction Operator

2h

(points 1, 7)

(2.10)

I h2 h : It takes fine grid vectors Rh defined on Gh and produces coarse grid vectors R2h

I h2 h R h = R 2 h since we use the line relaxation for every grid it is better to use the full-weight

defined on G2h using

restriction operator whose stencil takes the form:

I h2 h =

1
8 i +
(i

21 1


2i

2
(i )

(i )2

1
2 1
(
i

2
(i )2

2h

(i )2
1

21 +

2
i

h
1

(2.11)

2. 4 Test Problems, Results and Performance


In this section we report the results and performance of some test problems All our implementations in Fortran
were executed on a pentium 4 PC using FORTRAN90 workstation compiler. The accuracy of the method is measured by
both L2 norm of both defect and error and the max norm of both defect and the error. Consider the following test
problems: Consider the following test problems:
1. Test Problem 1:
Uexact = 3e0.5r2 sincos + 2r2 sin cos

(2.12)

2. Test Problem 2:
Uexact =

r 4 (sin cos ) 2

(2.13)

3. Test Problem 3:
2
Uexact = sin (r sin cos + 1)

(2.14)

4. Test Problem 4:
Uexact = r6 (sin cos )3 + 3r4 (sin cos )2 +6r2 (sin cos ) + 2
www.tjprc.org

(2.15)
editor@tjprc.org

84

Osama El-Giar

5. Test Problem 5:
2

Uexact = e r (sincos)

(2.16)
Test Problem 1: Equation 2.12

Table 4: Fortran Implementation of Test Problem 1 Using F M W (2, 1) on PC

Test Problem 2: Equation 2.13


Table 5: Fortran Implementation of Test Problem 2 Using F M W (2, 1) on PC

Test Problem 3: Equation 2.14


Table 6: Fortran Implementation of Test Problem 3 Using F M W (2, 1) on PC

Test Problem 4: Equation 2.15


Table 7: Fortran Implementation of Test Problem 5 Using F M W (2, 1) on PC

Test Problem 5: Equation 2.16


Impact Factor (JCC): 4.2949

Index Copernicus Value (ICV): 3. 0

85

Two Full Multigrid Algorithms in Cartesian and Polar Coordinate Systems to Solve an Elliptic
Partial Differential Equation with a Mixed Derivative Term in a Quarter of a unit Circle

Table 8: Fortran Implementation of Test Problem 5 Using F M W (2, 1) on PC

3. CONCLUSIONS
The implementation of an elliptic partial differential equation in the 2-dimensional space in a quarter of a unit
circle have been shown to be an efficient method. The convergence rate of the method in Cartesian coordinates has been
improved as we increase the number of relaxation steps before coarse grid correction, in the polar coordinates we should
use the W-cycle instead of V-cycle to achieve almost the same or a little bit better convergence rate than that of the method
in Cartesian coordinates. The other advantage of the two algorithms in Cartesian and in Polar coordinates is that the
extension from two to three space dimensions is straightforward.

REFERENCES
1.

Brandt A., Multi-level adaptive technique (MLAT) for fast numerical solution to bound-ary value problem,
Springer, Berlin - 1973.

2.

Briggs L., A Multigrid Tutorial, Society for Industrial and applied mathematics - 2000.

3.

Hackbucsh W., Multigrid Methods and applications, Springer Berlin Heidelberg Berlin,- 2003.

4.

G. D. Smith, Numerical Solution of Partial Differential Equations: Finite Difference Methods., Oxford
Applied Mathematics & Computing Science Series, - January 16, 1986.

5.

McCormick S. F., Mulitigrid Methods, SIAM, Phildelphia-Pennsylvania - 1987

6.

Briggs W. L, Mulitigrid tutorial, SIAM, Phildelphia-Pennsylvania - 1987

7.

John D. Anderson, Jr. Computational Fluid Dynamics: The Basics with Applications, McGraw-Hill Inc, - 1995.

8.

J.E.

Dennis

and

R.B.

Schnabel,

Numerical

Methods

for

Unconstrained

Optimization

and Nonlinear Equations, SIAM Books, Philadelphia, - 1996.


9.

J.C.

Tannehill,

D.A.

Anderson,

Computational

Fluid

Mechanics

and

Heat

Transfer,

Second Edition , Series in Computational and Physical Processes in Mechanics and Thermal Sciences., - April 1,
1997.
10. W. L. Briggs, V. E. Henson, and S. F. McCormick, A Multigrid Tutorial, Second Edition SIAM Books,
Philadelphia - 2000
11. Bobby Philip, An Introduction to Multigrid Techniques The Institute for Mathematics and Its Applications,
Minnesota - January 11, 2008.
www.tjprc.org

editor@tjprc.org

Das könnte Ihnen auch gefallen