1、二维泊松方程很基础详细的求解过程Topic 2: Elliptic Partial Dierential EquationsLecture 2-4: Poissons Equation: Multigrid MethodsWednesday, February 3, 2010Contents1 Multigrid Methods2 Multigrid method for Poissons equation in 2-D3 Simple V cycle algorithm4 Restricting the Residual to a Coarser Lattice123571 MULTIGRI
2、D METHODS5 Prolongation of the Correction to the Finer Lattice6 Cell-centered and Vertex-centered Grids and Coarsenings7 Boundary points8 Restriction and Prolongation Operators9 Improvements and More Complicated Multigrid Algorithms881111151Multigrid MethodsThe multigrid method provides algorithms w
3、hich can be used to accelerate the rate of convergence ofiterative methods, such as Jacobi or Gauss-Seidel, for solving elliptic partial dierential equations.Iterative methods start with an approximate guess for the solution to the dierential equation. In eachiteration, the dierence between the appr
4、oximate solution and the exact solution is made smaller.One can analyze this dierence or error into components of dierent wavelengths, for example by usingFourier analysis. In general the error will have components of many dierent wavelengths: there will be22 MULTIGRID METHOD FOR POISSONS EQUATION I
5、N 2-Dshort wavelength error components and long wavelength error components.Algorithms like Jacobi or Gauss-Seidel are local because the new value for the solution at any lattice sitedepends only on the value of the previous iterate at neighboring points. Such local algorithms are generallymore ecie
6、nt in reducing short wavelength error components.The basic idea behind multigrid methods is to reduce long wavelength error components by updating blocksof grid points. This strategy is similar to that employed by cluster algorithms in Monte Carlo simulationsof the Ising model close to the phase tra
7、nstion temperature where long range correlations are important. Infact, multigrid algorithms can also be combined with Monte Carlo simulations.2Multigrid method for Poissons equation in 2-DWith a small change in notation, Poissons equation in 2-D can be written: 2ux2+ 2uy2= f (x, y) ,where the unkno
8、wn solution u(x, y) is determined by the given source term f (x, y) in a closed region. Letsconsider a square domain 0 x, y 1 with homogeneous Dirichlet boundary conditions u = 0 on theperimeter of the square. The equation is discretized on a grid with L + 2 lattice points, i.e., L interiorpoints an
9、d 2 boundary points, in the x and y directions. At any interior point, the exact solution obeysui,j =14ui+1,j + ui1,j + ui,j+1 + ui,j1 + h2fi,j .32 MULTIGRID METHOD FOR POISSONS EQUATION IN 2-DThe algorithm uses a succession of lattices or grids. The number of dierent grids is called the number ofmu
10、ltigrid levels . The number of interior lattice points in the x and y directions is then taken to be 2 , sothat L = 2 + 2, and the lattice spacing h = 1/(L 1). L is chosen in this manner so that the downwardmultigrid iteration can construct a sequence of coarser lattices with2 1 2 2 . . . 20 = 1inte
11、rior points in the x and y directions.Suppose that u(x, y) is the approximate solution at any stage in the calculation, and uexact(x, y) is theexact solution which we are trying to nd. The multigrid algorithm uses the following denitions: The correctionv = uexact uis the function which must be added
12、 to the approximate solution to give the exact solution. The residual or defect is dened asr =2u + f .Notice that the correction and the residual are related by the equation2v =2uexact + f 2u + f = r .This equation has exactly the same form as Poissons equation with v playing the role of unknown fun
13、ctionand r playing the role of known source function!43 SIMPLE V CYCLE ALGORITHM3Simple V cycle algorithmThe simplest multigrid algorithm is based on a two-grid improvement scheme. Consider two grids: a ne grid with L = 2 + 2 points in each direction, and a coarse grid with L = 2 1 + 2 points.We nee
14、d to be able to move from one grid to another, i.e., given any function on the lattice, we need toable to restrict the function from ne coarse, and prolongate or interpolate the function from coarse ne.Given these denitions, the multigrid V cycle can be dened recursively as follows: If= 0 there is o
15、nly one interior point, so solve exactly foru1,1 = (u0,1 + u2,1 + u1,0 + u1,2 + h2f1,1)/4 . Otherwise, calculate the current L = 2 + 2.53 SIMPLE V CYCLE ALGORITHM Perform a few pre-smoothing iterations using a local algorithm such as Gauss-Seidel. The idea is todamp or reduce the short wavelength er
16、rors in the solution. Estimate the correction v = uexact u as follows: Compute the residualri,j =1h2ui+1,j + ui1,j + ui,j+1 + ui,j1 4ui,j + fi,j . Restrict the residual r R to the coarser grid. Set the coarser grid correction V = 0 and improve it recursively. Prolongate the correction V v onto the n
17、er grid. Correct u u + v. Perform a few post-smoothing Gauss-Seidel interations and return this improved u.How does this recursive algorithm scale with L? The pre-smoothing and post-smoothing Jacobi or Gauss-Seidel iterations are the most time consuming parts of the calculation. Recall that a single
18、 Jacobi orGauss-Seidel iteration scales like O(L2). The operations must be carried out on the sequence of grids with2 2 1 2 2 . . . 20 = 1interior lattice points in each direction. The total number of operations is of orderL2n=0122n L211 .64 RESTRICTING THE RESIDUAL TO A COARSER LATTICEThus the mult
19、igrid V cycle scales like O(L2), i.e., linearly with the number of lattice points N!4Restricting the Residual to a Coarser LatticeThe coarser lattice with spacing H = 2h is constructed as shown. A simple algorithm for restricting theresidual to the coarser lattice is to set its value to the average
20、of the values on the four surrounding latticepoints (cell-centered coarsening):76 CELL-CENTERED AND VERTEX-CENTERED GRIDS AND COARSENINGSRI,J =14ri,j + ri+1,j + ri,j+1 + ri+1,j+1 , i = 2I 1 , j = 2J 1 .5Prolongation of the Correction to the Finer LatticeHaving restricted the residual to the coarser
21、lattice with spacing H = 2h, we need to solve the equation2V = R(x, y) ,with the initial guess V (x, y) = 0. This is done by two-grid iterationV = twoGrid(H, V, R) .The output must now be interpolated or prolongated to the ner lattice. The simplest procedure is to copythe value of VI,J on the coarse
22、 lattice to the 4 neighboring cell points on the ner lattice:vi,j = vi+1,j = vi,j+1 = vi+1,j+1 = VI,J ,i = 2I 1 , j = 2J 1 .6Cell-centered and Vertex-centered Grids and CoarseningsIn the cell-centered prescription, the spatial domain is partitioned into discrete cells. Lattice points aredened at the
23、 center of each cell as shown in the gure:86 CELL-CENTERED AND VERTEX-CENTERED GRIDS AND COARSENINGSThe coarsening operation is dened by doubling the size of a cell in each spatial dimension and placing acoarse lattice point at the center of the doubled cell.Note that the number of lattice points or
24、 cells in each dimension must be a power of 2 if the coarseningoperation is to terminate with a single cell. In the gure, the nest lattice has 23 = 8 cells in each dimension,and 3 coarsening operations reduce the number of cells in each dimension23 = 8 22 = 4 21 = 2 20 = 1 .Note also that with the c
25、ell-centered prescription, the spatial location of lattice sites changes with eachcoarsening: coarse lattice sites are spatially displaced from ne lattice sites.A vertex-centered prescription is dened by partitioning the spatial domain into discrete cells and locatingthe discrete lattice points at t
26、he vertices of the cells as shown in the gure:96 CELL-CENTERED AND VERTEX-CENTERED GRIDS AND COARSENINGSThe coarsening operation is implemented simply by dropping every other lattice site in each spatial dimension.Note that the number of lattice points in each dimension must be one greater than a po
27、wer of 2 if thecoarsening operation is to reduce the number of cells to a single coarsest cell. In the example in the gurethe nest lattice has 23 + 1 = 9 lattice sites in each dimension, and 2 coarsening operations reduce thenumber of vertices in each dimension23 + 1 = 9 22 + 1 = 5 21 + 1 = 3 .The v
28、ertex-centered prescription has the property that the spatial locations of the discretization points arenot changed by the coarsening operation.108 RESTRICTION AND PROLONGATION OPERATORS7Boundary pointsLets assume that the outermost perimeter points are taken to be the boundary points. The behavior
29、ofthese boundary points is dierent in the two prescriptions: Cell-centered Prescription: The boundary points move in space towards the center of the regionat each coarsening. This implies that one has to be careful in dening the “boundary values” of thesolution. Vertex-centered Prescription: The bou
30、ndary points do not move when the lattice is coarsened.This make it easier in principle to dene the boundary values.These two dierent behaviors of the boundary points make the vertex-centered prescription a little moreconvenient to use in multigrid applications. However, there is no reason why the cell-centered prescriptionshould not work as well.8Restriction and Prolongation OperatorsIn the multigrid method it is necessary t
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1