marching solver for poisson equation 大氣四 簡睦樺. outline a brief review for poisson...

23
Marching Solver for Poisson Equation 大大大 大大大

Upload: anne-jenkins

Post on 19-Jan-2018

223 views

Category:

Documents


0 download

DESCRIPTION

Poisson Equation A second order partial differential equation with inhomogeneous forcing term is called Poisson equation. i.e. Ω is the domain, L is some operator for boundary condition.

TRANSCRIPT

Page 1: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Marching Solver for Poisson Equation

大氣四 簡睦樺

Page 2: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Outline

• A brief review for Poisson equation and marching method

• Parallel algorithm and consideration for efficiency

• Results • Future works

Page 3: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Poisson Equation

• A second order partial differential equation with inhomogeneous forcing term is called Poisson equation. i.e.

• Ω is the domain, L is some operator for boundary condition.

2

2 for , 1,2

0 for

i

i

u f u ix

L u u

Page 4: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Numerical approximation

• Let Uij=u(x,y), approximate the equation with finite difference method.

• For marching method

1, , 1, , 1 , , 1,2 2

2 2i j i j i j i j i j i ji j

U U U U U Uf

x y

2

2, 1 , , 1, , 1, , 122 2i j i j i j i j i j i j i j

yU y f U U U U Ux

Page 5: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Marching method

• Let , where Ui,j is the exact solution, U’i,j is guess solution, ei,j is the difference between Ui,j and U’i,j.

• ij=0…n+1(Ui,0 , U0,j ,Ui,n+1 and Un+1,j are boundary)

• We have a initial guess for U’i,1 and compute U’i,2 via marching equation.

, , ,i j i j i jU U e

Page 6: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

• Let a vector of equation of e, i.e. E1,1 =[1 0 ...0]T and E2,1 =[0 1 0 ...0]T and compute the equation of e.

• Thus, we can construct and system of ein+1

and U’in+1 –Uin+1. i.e.

• We solve the system and get ei,1 , so we can get Ui,1

2

, 1 , 1, , 1, , 122 2i j i j i j i j i j i jyE E E E E Ex

, 1 , 1 , 1 ,1 1, 1 1, 1 ,1...i n i n i n i n n n iU U e Ce E E e

Page 7: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Domain decomposition idea

• However, the above method may fail easily because the condition number of the system may be to huge.

• To construct error vector from Ei,1 , En+1,1 and other interior point.

• we can have the local equation for some marching points for which different initial condition march and should have same value.

Page 8: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for
Page 9: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Parallel Algorithm

• Use MPI to compute the decomposed domain.

• Separate the computation into preprocessor and marching.

Page 10: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Preprocessor

• To compute inverse matrix of the systempreprocessor

Compute error vector

Compute error vector

Parallel LU Parallel LU

Out put Out put

Page 11: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Marching

marching

Read data Read data

marching marching

Page 12: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Collect errorvector

Matrix product Matrix product

Page 13: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

ConnectBoundary data

Marching again to get exact sol.

Marching again to get exact sol.

Page 14: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Operation count

• For general case, define nx for grid points at x-direction, ny for grid points at y direction, nb is number of sub-domain ~ nx/5.

• For serial case, preprocessor:Error vector: O(ny*ny*nx) LU: O((ny*nb)3)

marching:marching: O(ny*nx)

matrix product: O((ny*nb)2)

Page 15: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Parallel case

• ng is number of MPI world. nb>=ng• preprocessor:

Error vector: O(ny*ny*nx/ng) LU: O((ny*nb)3)

marching:marching: O(ny*nx/ng)

matrix product: O((ny*nb/ng)2)

Page 16: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Compare with other method

Serial March LU Iteration+prep

Iteration

Prep (ny*nb)3 (ny*nx)3 (ny*nx)3 0

march (ny*nb)2 (ny*nx)2 (ny*nx)2 (ny*nx)3

1 time problem

(ny*nb)3 (ny*nx)3 (ny*nx)3 (ny*nx)3

Page 17: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

results

• Converge error• Efficiency improvement• Annulus testing case

Page 18: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Converge error

2 2

2 2 1.25exp 2

u u x yx yDirichlet BC

• Testing case

Page 19: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Error table

H Error Ratio order

0.0625 4.987e-5 NaN NaN

0.03125 1.328e-5 3.75527 1.90892

0.1563 3.425e-6 3.87737 1.95508

0.00781 8.697e-7 3.93814 1.97751

Page 20: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Log-log plot

Page 21: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Efficiency• For 128*128 case NP Time

1 0.0412

2 0.0345

4 0.0181

8 0.0134

16 0.0123

Page 22: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Annulus

Page 23: Marching Solver for Poisson Equation 大氣四 簡睦樺. Outline A brief review for Poisson equation and marching method Parallel algorithm and consideration for

Future work

• Parallel LU• 3D marching method