Upload
anne-jenkins
View
223
Download
0
Embed Size (px)
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.
Citation preview
Marching Solver for Poisson Equation
大氣四 簡睦樺
Outline
• A brief review for Poisson equation and marching method
• Parallel algorithm and consideration for efficiency
• Results • Future works
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
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
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
• 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
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.
Parallel Algorithm
• Use MPI to compute the decomposed domain.
• Separate the computation into preprocessor and marching.
Preprocessor
• To compute inverse matrix of the systempreprocessor
Compute error vector
Compute error vector
Parallel LU Parallel LU
Out put Out put
Marching
marching
Read data Read data
marching marching
Collect errorvector
Matrix product Matrix product
ConnectBoundary data
Marching again to get exact sol.
Marching again to get exact sol.
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)
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)
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
results
• Converge error• Efficiency improvement• Annulus testing case
Converge error
2 2
2 2 1.25exp 2
u u x yx yDirichlet BC
• Testing case
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
Log-log plot
Efficiency• For 128*128 case NP Time
1 0.0412
2 0.0345
4 0.0181
8 0.0134
16 0.0123
Annulus
Future work
• Parallel LU• 3D marching method