校园网页 · 学校官网
Efficient spectral-Galerkin method I. Direct solvers for second- and fourth-order equations using Legendre polynomials.pdf
SIAM J. SCI. COMPUT. c° 1994 Society for Industrial and Applied Mathematics Vol. 15, No. 6, pp. 1489{1505, November 1994 013 E±cient Spectral-Galerkin Method I. Direct Solvers for the Second and Fourth Order Equations Using Legendre Polynomials¤ Jie Sheny Abstract. We present some e±cient algorithms based on the Legendre-Galerkin approxima- tions for the direct solution of the second and fourth order elliptic equations. The key to the e±ciency of our algorithms is to construct appropriate base functions, which lead to systems with sparse matri- ces for the discrete variational formulations. The complexities of the algorithms are a small multiple of N d+1 operations for a d dimensional domain with (N ¡ 1)d unknowns, while the convergence rates of the algorithms are exponential for problems with smooth solutions. In addition, the algorithms can be e®ectively parallelized since the bottlenecks of the algorithms are matrix-matrix multiplications. Key words. spectral-Galerkin method, Legendre polynomial, Helmholtz equation, biharmonic equation, direct solver AMS subject classi¯cations. 65N35, 65N22, 65F05, 35J05 1. Introduction. This article is the ¯rst in a series for developing e±cient spectral Galerkin algorithms for elliptic problems. The spectral method employs global polynomials as the trial functions for the discretization of partial di®erential equations. It provides very accurate approximations with a relatively small number of unknowns. Consequently it has gained increasing popularity in the last two decades, especially in the ¯eld of computational °uid dynamics (see [11], [8] and the references therein). The use of di®erent test functions in a variational formulation leads to three most commonly used spectral schemes, namely, the Galerkin, tau and collocation versions. In the collocation method, we work in the physical space { a set of collocation points; while in the Galerkin and tau methods, we work in the spectral space { the coe±cients of the polynomial series. The Galerkin and collocation methods usually lead to optimal error estimates; while the tau method, being a modi¯cation of the Galerkin method, leads to non symmetric variational formulations and only sub-optimal error estimates are available (see for instance [19] and [20]). Gottlieb and Orszag in their pioneer book [11] presented an e±cient Chebyshev-tau method; on the other hand, they presented a basis for the Galerkin method which leads to full matrices and its application in practice is prohibited. It is surprising that virtually no e®ort has been made on constructing appropriate bases (other than the Lagrangian interpolant basis) for the spectral-Galerkin method. Consequently the tau method along with the collocation method (the later being more natural for problems with variable coe±cients) have been the focus of a great number of research papers (see [8] and the reference therein), while the Galerkin method, being more authentic and more accurate than the tau method, has draw less attention. We should point out that the spectral element method, developed by Patera and his group, is in fact a spectral-Galerkin method (see the survey paper [13]). However, the spectral element method, in the case of a single domain, di®ers from the spectral-Galerkin method to be presented in this work in two aspects: (i) a Gaussian quadrature formula is used instead of exact integration; ¤ Received by the editors Junuary 20, 1993; accepted for publication (in revised form) September 29, 1993. This work was supported in part by NSF grant DMS-9205300. y Department of Mathematics, Penn State University, University Park, Pennsylvania 16802 (shen j@math.psu.edu). 1489 1490 jie shen (ii) a Lagrangian interpolant basis is used instead of the basis by simple combinations of Legendre polynomials. We shall present in this article appropriate bases for the Legendre Galerkin method applied to second order and fourth order elliptic equations with various bound- ary conditions. The resulting discrete systems have sparse matrices similar to the ones by ¯nite di®erence discretizations. We shall develop e±cient direct solution techniques for solving these discrete systems. For the second order equations, the complexity of our algorithm is a small mul- tiple of N d+1 operations for a d dimensional domain with (N ¡ 1)d unknowns. Since its pre-processing time is negligible, it is de¯nitely the method of choice among the existing spectral algorithms for solving one particular equations. For solving equa- tions with multiple right-hand sides, it is as e±cient as and more accurate than the Legendre-tau method; and it is also very competitive to the Chebyshev-tau and Chebyshev-collocation methods. Furthermore, the roundo® errors in the Legendre- Galerkin approximation are considerably less appreciable than that in other spectral approximations. Although the solution techniques for fourth order equations by ¯nite di®erence methods are well developed (see [5] for a direct solver and [3] for a more e±cient iterative solver), there are not many results available for the fourth order equations by spectral methods, which are more di±cult to analyze and to solve numerically. We mention here the theoretical work in [10] and [2] for one dimensional fourth order equations, and in [1] for two dimensional fourth order equations. However how to e±ciently solve the resulting discrete systems is not clear, and only sub-optimal error estimates are available for the collocation methods presented in [1]. We shall develop an e±cient direct solver for the fourth order equations based on the Legendre-Galerkin method. In the two dimensional case, it has a complexity of a small multiple of O(N 3) operations. In other words, we can solve fourth order equations with an amount of work comparable to that of solving second order equa- tions. Hence, our algorithm should be clearly more e±cient than the existing spectral methods for fourth order equations (see for instance [24], [1]). Furthermore, it is clear that the Legendre-Galerkin approximation to the fourth order equations leads to optimal error estimates. One of the application of this algorithm is for solving the two dimensional Stokes equations, since the stream function formulation of the 2-D Stokes equations is the 2-D biharmonic equation with Dirichlet boundary conditions. Let us mention that the bases we developed here are also suitable for decomposing the solution into a high frequency part and a low frequency part as is required in the implementation of the Nonlinear Galerkin Method [22]. A drawback of using Legendre polynomials is of course the lack of a fast transform between the physical space and the spectral space. Hence, in the second part of the series [21], we shall study the spectral-Galerkin method by using the Chebyshev polynomials, for which the Fast Fourier Transform (FFT) is applicable. Let us mention that it is hopeful that an e±cient transform method for the Legendre polynomials can be eventually developed, at least for N su±ciently large, by using the ideas presented in [17] and [4]. We note that the algorithms presented here are mostly appropriate for simple geometries and for constant coe±cient problems. We shall brie°y address how to treat the variable coe±cient case and leave the extension to more complex geometries to a future investigation. We should mention that the complexities of our algorithms are not optimal with respect to the number of unknowns. However thanks to the spectral efficient spectral-galerkin method 1491 accuracy and the very small constants in front of the O(N d+1) operation counts, our algorithms should be very competitive, at least for smooth functions or N not too large, to the high-precision algorithms with optimal or near-optimal complexity (cf. [18], [15], [16]). The remainder of the article is organized as follows: In the next section, we consider the second order equations. In Section 3, we study the fourth order equations. In Section 4, we point out some immediate extensions. Finally in Section 5, we present and compare some numerical results. 2. Second order equations. In this section, we are interested in solving the Helmholtz equation (2.1) ®u ¡ ¢u = f in = I d; uj@ = 0; where I = (¡1; 1) and d = 1, 2 or 3, by using the Legendre Galerkin method. The extension to more general problems will be discussed in Section 4. Let us ¯rst introduce some basic notations which will be used in the sequel. We denote by Ln(x) the nth degree Legendre polynomial, and we set SN = spanfL0(x); L1(x); : : : ; LN (x)g; VN = fv 2 SN : v(§1) = 0g: Then the standard Legendre-Galerkin approximation to (2.1) is: Find uN 2 V d N such that (2.2) ®(uN ; v) + (ruN ; rv) = (f; v); 8 v 2 V d N ; where (u; v) = R uvdx is the scalar product in L2(), and its norm will be denoted by k ¢ k. The approximation property of (2.2) is best described by using the Sobolev spaces. Let us denote H s() to be the usual Sobolev spaces with the norm kvks. It is well known (cf. [8]) that for ® ¸ 0, s ¸ 1 and u 2 H s(), the following optimal error estimates holds: (2.3) ku ¡ uN k + N ku ¡ uN k1 · C(s)N ¡skuks: Although the approximation (2.2) is highly accurate, its practical value depends on the choice of a basis for V d N . 2.1. One dimensional case. The crucial task is to choose an appropriate basis for VN such that the linear system resulting from (2.2) is as simple as possible. Let us mention that the Lagrangian interpolant (or nodal) basis used in the collocation and spectral element formulations, and the basis VN = spanfÁ2(x); Á3(x); ¢ ¢ ¢ ; ÁN (x)g with Ák(x) = ½ Lk(x) ¡ L0(x); k even Lk(x) ¡ L1(x); k odd ; or Ák(x) = (1 ¡ x2)Lk¡2(x) all lead to linear systems with full matrices even in the simplest case ® = 0. However a clever choice of the basis would lead to a linear system with a sparse matrix. We recall that the fLn(x)g satisfy the orthogonality relation (2.4) (Lk(x); Lj(x)) = 2 2k + 1 ±ij; 8 k; j ¸ 0; and the recurrence relation (2.5) (2k + 1)Lk(x) = L0 k+1(x) ¡ L0 k¡1(x): 1492 jie shen We recall also that Ln(x) is a polynomial of degree n and therefore L00 n(x) 2 Sn¡2, more precisely (2.6) L00 n(x) = n¡2X k=0 k+n even (k + 1 2 )[n(n + 1) ¡ k(k + 1)]Lk(x): The following lemma is the key to the e±ciency of our algorithms. Lemma 2.1. Let us denote (2.7) ck = 1p 4k + 6 ; Ák(x) = ck(Lk(x) ¡ Lk+2(x)); ajk = (Á0 k(x); Á0 j(x)); bjk = (Ák(x); Áj(x)); then (2.8) ajk = ½ 1; k = j 0; k 6= j ; bjk = bkj = 8 >< >: ckcj( 2 2j+1 + 2 2j+5 ); k = j ¡ckcj 2 2k+1 ; k = j + 2 0; Otherwise ; and VN = spanfÁ0(x); Á1(x); ¢ ¢ ¢ ; ÁN ¡2(x)g: Proof. Since Lk(§1) = (§1)k, it follows that Ák(x) 2 VN for k = 0; 1; ¢ ¢ ¢ ; N ¡ 2: On the other hand, it is clear that fÁk(x)g are linear independent and that dim(VN ) = N ¡ 1. Hence, VN = spanfÁ0(x); Á1(x); ¢ ¢ ¢ ; ÁN ¡2(x)g: Notice that ajk = (Á0 k(x); Á0 j(x)) = ¡(Á00 k(x); Áj(x)) = ¡(Ák(x); Á00 j (x)); by using (2.4)- (2.5), one can easily derive (2.8). Remark 2.1. It is transparent that base functions similar to that in(2.7) can be constructed by using Chebyshev or other Jacoby polynomials. However, whether they would also lead to e±cient algorithms needs more investigations due to the non- uniform weight in their orthogonal relations(see [21] ). In the following, we shall use capital letters to denote matrices or two dimensional arrays, and bold face letters to denote column vectors. It is now clear that (2.2) (with d = 1) is equivalent to (2.9) ®(uN ; Ák(x)) + (u0 N ; Á0 k(x)) = (f; Ák(x)); k = 0; 1; ¢ ¢ ¢ ; N ¡ 2: Let us denote fk = (f; Ák(x)); f = (f0; f1; ¢ ¢ ¢ ; fN ¡2)T ; (2.10) uN = N ¡2X n=0 vnÁn(x); v = (v0; v1; ¢ ¢ ¢ ; vN ¡2)T ; and B = (bkj)0·k;j·N ¡2 : Then (2.9) is equivalent to the following matrix equation: (2.11) (®B + I)v = f : Since bkj = 0 for k 6= j and k 6= j § 2, we observe that B (resp. The system (2.11) with ® 6= 0) can be decoupled into two tridiagonal submatrices (resp. two tridiagonal efficient spectral-galerkin method 1493 subsystems for the odd and even components of v). Notice also that the system (2.11) reduces to a diagonal system for ® = 0. Remark 2.2. The equation (2.12) ®u + ¯ux ¡ uxx = f; u(§1) = 0 can be easily handled as well. In fact let cjk = (DxÁk(x); Áj(x)) and C = (ckj). A simple computation leads to (2.13) cjk = ¡ckj = ½ 2ckcj; k = j + 1 0; Otherwise : Hence, the discrete system corresponding to(2.12) is: (®B + ¯C + I)v = f ; which is simply a pentadiagonal system. 2.2. Two dimensional case. It is clear that V 2 N = spanfÁi(x)Áj(y) : i; j = 0; 1; ¢ ¢ ¢ ; N ¡ 2g: Let us denote uN = N ¡2X k;j=0 ukjÁk(x)Áj(y); fkj = (f; Ák(x)Áj(y)); and U = (ukj)k;j=0;1;¢¢¢ ;N ¡2; F = (fkj)k;j=0;1;¢¢¢ ;N ¡2: Taking v = Ál(x)Ám(y) in (2.2) for l; m = 0; 1 ¢ ¢ ¢ ; N ¡2, we ¯nd that (2.2) is equivalent to the following matrix equation: (2.14) ®BU B + U B + BU = F; where B are the matrices de¯ned in (2.10). This equation can be solved in particular by the matrix decomposition method described in [7], which is better known in the ¯eld of spectral methods as the matrix diagonalization method [12]. To this end, let ¤ be the diagonal matrix whose diagonal entries f¸pg are the eigenvalues of B, and let E be the orthonormal matrix formed by the eigenvectors of B (since B is symmetric), i.e. E T BE = ¤. Now setting U = EV , the equation (2.14) becomes ®E¤V B + EV B + E¤V = F: Multiply ET to the above equation, we arrive to ®¤V B + V B + ¤V = ET F ´ G: The transpose of the above equation reads (2.15) ®BV T ¤ + BV T + V T ¤ = GT : Let vp = (vp0; vp1; ¢ ¢ ¢ ; vpN ¡2)T and gp = (gp0; gp1; ¢ ¢ ¢ ; gpN ¡2)T for p = 0; 1; ¢ ¢ ¢ ; N ¡ 2. Then the pth column of the equation (2.15) can be written as: (2.16) ((®¸p + 1)B + ¸pI) vp = gp; p = 0; 1; ¢ ¢ ¢ ; N ¡ 2; which is equivalent to N ¡ 1 one dimensional equations of the form (2.11). In summary, the solution of (2.14) consists of the following steps: 1494 jie shen (0) Pre-processing: compute the eigenvalues and eigenvectors of B; (1) Compute G = ET F ; (2) Obtain V by solving (2.16); (3) Set U = EV . since B can be split into two symmetric tridiagonal submatrices, the eigenvalues and eigenvectors of B can be easily computed in O(N 2) operations. The step 2 consists of solving N ¡ 1 tridiagonal systems of order N ¡ 1. From the structure of B, we realize that ekj = 0 for k + j odd. Hence the amount of work for the matrix multiplications can be reduced by a factor of 2. Consequently the steps 1 and 3 take a total of 2(N ¡ 1)3 arithmetic operations. Therefore, for each right-hand side, the system (2.14) can be solved in about 2N 3 operations. We remark that for each particular solution of (2.1), the Legendre Galerkin method described above takes at most the same amount of operations as the Legendre- tau method. However thanks to the symmetry of the Galerkin procedure, the com- plexity of the pre-processing stage in the Galerkin case is an order of magnitude less (in terms of N ) than in the tau (and the collocation) case. Furthermore the error estimates of the Galerkin approximation is optimal (see (2.3)) while that of the tau approximation is not (see for instance [20] and [19]). Remark 2.3. As in Remark 2.2, the equation(2.1) with a ¯rst order term ¯uy can be e±ciently treated. In this case, the discrete equation(2.14) should be replaced by ®BU B + ¯BU C + U B + BU = F; which can still be solved by the matrix diagonalization method. By the same token, we can treat the equation(2.1) with a ¯rst order term ¯ux. Remark 2.4. We note that the bottleneck of the algorithm is the two matrix- matrix multiplications in steps 1 and 3, which can be e®ectively parallelized and its complexity can be improved to O(N d+1=p) with p parallel processors. The same remark holds for other algorithms to be presented later in this paper. 2.3. Three dimensional case. The three dimensional Helmholtz equation can also be e±ciently solved by the above matrix diagonalization method. However, the formulation of the algorithm requires a little extra care. Let us denote uN = N ¡2X n;m;l=0 unmlÁn(x)Ám(y)Ál(z); fijk = (f; Ái(x)Áj(y)Ák(z)): since V 3 N = spanfÁi(x)Áj(y)Ák(z) : i; j; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2g; taking v = Ái(x)Áj(y)Ák(z) in (2.2) for i; j; k = 0; 1 ¢ ¢ ¢ ; N ¡ 2, we ¯nd that (2.2) with d = 3 is equivalent to the following equation: (2.17) ®binunmlbjmbkl +uimlbjmbkl +binunjlbkl +binunmkbjm = fijk; i; j; k = 0; 1; ¢ ¢ ¢ ; N ¡2; where we have used the conventional notation such that a pair of repeated index imply a summation of the index from 0 to N ¡ 2. Hence, by the de¯nition of E and ¤ in Section 2.2, we have binenq = ¸qeiq; eiqeip = ±qp: efficient spectral-galerkin method 1495 Set unml = enqvqml and use the above relation, we can rewrite the equation (2.17) as ®¸qeiqvqmlbjmbkl + eiqvqmlbjmbkl + ¸qeiqvqjlbkl + ¸qeiqvnmkbjm = fijk; i; j; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2: Multiply eip to the above equation, we obtain (®¸p + 1)vpmlbjmbkl + ¸p(vpjlbkl + vpmkbjm) = eipfijk ´ gpjk; p; j; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2: Now set V p = (vpml)0·m;l·N ¡2 and Gp = (gpml)0·m;l·N ¡2, we can rewrite the above equation as (2.18) (®¸p + 1)BV pB + ¸p(V pB + BV p) = Gp; p = 0; 1; ¢ ¢ ¢ ; N ¡ 2: For each p, the above equation corresponds to a two dimensional equation of the form (2.14). In summary, the solution of (2.17) consists of the following steps: (0) Pre-processing: compute the eigenvalues and eigenvectors of B; (1) Compute gpjk = eipfijk for p; j; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2; (2) Obtain V p by solving (2.18) for p = 0; 1; ¢ ¢ ¢ ; N ¡ 2; (3) Set unml = enqvqml for n; m; l = 0; 1; ¢ ¢ ¢ ; N ¡ 2. The step 2 consists of solving N ¡ 1 two-dimensional equations of the form (2.14). Hence, it takes about 2N 4 operations. The steps 1 and 3 take 2N 4 operations. There- fore, The system (2.17) can be solved in about 4N 4 operations. 3. Fourth order equations. In this section, we consider the fourth order equation (3.1) ®u ¡ ¯¢u + ¢2u = f in = I d; uj@ = @u @n j@ = 0; where n is the normal vector to @. Let WN = fv 2 SN : v(§1) = vx(§1) = 0g: Then the Legendre-Galerkin approximation of (3.1) consists of ¯nding uN 2 W d N such that (3.2) ®(uN ; v) + ¯(ruN ; rv) + (¢uN ; ¢v) = (f; v); 8 v 2 W d N : It can be shown that for ®; ¯ > 0 and u 2 H s() \ H 2 0 () for s ¸ 2, then the following optimal error estimate holds: (3.3) ku ¡ uN k + N ku ¡ uN k1 + N 2ku ¡ uN k2 · C(s)N ¡skuks: 3.1. One dimensional case. The equation (3.1) in the one dimensional case can serve as a model for the clamped rod problem. It can also serve as a model for the 2-D Stokes equations in the primitive variable formulation or in the stream function formulation, subject to the periodic boundary condition in the y direction and Dirichlet boundary condition in the x direction. A semi-implicit time discretization of the important Kuramoto-Sivashinsky equation modeling a °ame propagation ([23]) is also of the form (3.1) with d = 1. Lemma 3.1. Let dk = 1p 2(2k + 3)2(2k + 5) and (3.4) Ãk(x) = dk(Lk(x) ¡ 2(2k + 5) 2k + 7 Lk+2(x) + 2k + 3 2k + 7 Lk+4(x)); k = 0; 1; ¢ ¢ ¢ ; N ¡ 4: 1496 jie shen Then WN = spanfÃ0(x); Ã1(x); ¢ ¢ ¢ ; ÃN ¡4(x)g: Furthermore, we have (3.5) akj = (Ã00 j (x); Ã00 k (x)) = ½ 1; k = j 0; k 6= j ; and the only non zero elements of bkj = (Ãj(x); Ãk(x)); ckj = (Ã0 j(x); Ã0 k(x)) are: (3.6) bkk =d2 k(ek + h2 kek+2 + g2 kek+4) bkk+2 =bk+2k = dkdk+2(hkek+2 + gkhk+2ek+4) bkk+4 =bk+4k = dkdk+4gkek+4 ckk = ¡ 2(2k + 3)d2 khk ckk+2 =ck+2k = ¡2(2k + 3)dkdk+2 ; where ek = 2 2k + 1 ; gk = 2k + 3 2k + 7 ; hk = ¡(1 + gk): Proof. Since Lk(§1) = (§1)k and L0 k(§1) = 1 2 (§1)k¡1k(k + 1), we can readily check that Ãk(x) 2 WN . On the other hand it is clear that fÃi(x)g are linear independent and the dimension of WN is N ¡ 3. Hence WN = spanfÃ0(x); Ã1(x); ¢ ¢ ¢ ; ÃN ¡4(x)g: (3.5) and (3.6) can be derived by direct computations using (2.4)-(2.6) and integration by part. To simplify the notation, we denote hereafter q = N ¡ 4. Let us denote now B = (bkj)0·k;j·q ; C = (ckj)0·k;j·q ; fk = (f; Ãk(x)); f = (f0; f1; ¢ ¢ ¢ ; fq)T ; uN = qX n=0 vnÃn(x); v = (v0; v1; ¢ ¢ ¢ ; vq)T ; we ¯nd that (3.2) with d = 1 is equivalent to the following matrix equation: (3.7) (®B + ¯C + I)v = f : It is obvious that B and C are symmetric positive de¯nite matrices. Furthermore, B can be split into two pentadiagonal submatrices and C can be split into two tridiagonal submatrices. Hence, the system can be e±ciently solved. 3.2. Two dimensional case. The equation (3.1) in the two dimensional case with ® = ¯ = 0 is the well-known biharmonic equation. It has many important applications. In particular, it is known as a model for the plate problem; also the steam-function of a °ow governed by two dimensional Stokes equations is a solution of the equation (3.1). The case with ® 6= 0 is also important for time dependent problems. It is obvious that W 2 N = spanfÃi(x)Ãj(y) : i; j = 0; 1; ¢ ¢ ¢ ; qg: efficient spectral-galerkin method 1497 Using the same notations as in Section 2.2 (with Ák(x) replaced by Ãk(x), and N ¡ 2 replaced by q), taking v = Ãl(x)Ãm(y) in (3.2) for l; m = 0; 1; ¢ ¢ ¢ ; q, we ¯nd that (3.2) is equivalent to the following matrix equation: (3.8) ®BU B + ¯(CU B + BU C) + BU + 2CU C + U B = F: We can also rewrite the above equation in the following form using the tensor product notation: (3.9) Du ´ (®B B + ¯(C B + B C) + B I + 2C C + I B)u = f ; where f and u are F and U written in the form of a column vector, i.e. (3.10) f = (f00; f10; ¢ ¢ ¢ ; fq0; f01 ¢ ¢ ¢ ; fq1; ¢ ¢ ¢ ; f0q; ¢ ¢ ¢ ; fqq)T ; and denotes the tensor product of matrices, i.e. A B = (Abij)i;j=0;1;¢¢¢ ;q: Let us ¯rst remark that if BC = CB, then the equation (3.8) can be e±ciently solved by using the matrix diagonalization method (see below). But unfortunately due to the fact that the equation (3.1) is not separable, we have BC 6= CB. However BC ¡CB only has eight non zero entries at positions (0; 2); (1; 3); (q¡3; q¡1); (q¡2; q) and their symmetric counterpart (2; 0); (3; 1); (q ¡ 1; q ¡ 3); (q; q ¡ 2). These non zero entries can be eliminated by modifying the following four entries of the matrix B: b00 ¡! ~b00 = (c00b02 + c02b22 ¡ b02c22 ¡ b04c42)=c02; b11 ¡! ~b11 = (c11b13 + c13b33 ¡ b13c33 ¡ b15c53)=c13; bq¡1q¡1 ¡! ~bq¡1q¡1 = (cq¡1q¡1bq¡1q¡3 + cq¡1q¡3bq¡3q¡3 ¡ bq¡1q¡3cq¡3q¡3 ¡ bq¡1N ¡9cN ¡9q¡3)=cq¡1q¡3; bqq ¡! ~bqq = (cqqbqq¡2 + cqq¡2bq¡2q¡2 ¡ bqq¡2cq¡2q¡2 ¡ bqq¡4cq¡4q¡2)=cqq¡2: Setting ~B = (~bij) with ~bij = bij for (i; j) 6= (0; 0); (1; 1); (q ¡ 1; q ¡ 1); (q; q), we have ~BC = C ~B: Now let us explain how to e±ciently solve the equation: (3.11) ® ~BU B + ¯(CU B + ~BU C) + ~BU + 2CU C + U B = F: Since ~B and C are symmetric and ~BC = C ~B, it is well known that there exists an orthonormal matrix E such that (3.12) ~BE = E¤; CE = E§; and ¤ and § are real diagonal matrices. The matrix E is the set of eigenvectors of ~B and C, the diagonal entries f¸pg and f¾pg of ¤ and § are respectively eigenvalues of ~B and C. Hence, setting U = EV in (3.8), using (3.12), we obtain: ®E¤V B + ¯E(§V B + ¤V C) + E¤V + 2E§V C + EV B = F: Multiplying ET to the above equation, we get (3.13) ®¤V B + ¯(§V B + ¤V C) + ¤V + 2§V C + V B = E T F ´ G: As in Section 2.2, let vp = (vp0; vp1; ¢ ¢ ¢ ; vpq)T and gp = (gp0; gp1; ¢ ¢ ¢ ; gpq)T for p = 0; 1; ¢ ¢ ¢ ; q. Then the pth row of the equation (3.13) is: (3.14) f(®¸p + ¯¾p + 1)B + (¯¸p + 2¾p)C + ¸pIg vp = gp; p = 0; 1; ¢ ¢ ¢ ; q: 1498 jie shen For each p, the above equation is simply an one dimensional equation of the form (3.7). In summary, the solution of (3.11) consists of the following steps: (0) Pre-processing: compute the eigenvalues and eigenvectors ¤, §, E of ~B and C; (1) Compute G = ET F ; (2) Obtain vp by solving (3.14); (3) Set U = EV . By a classical result on tridiagonal matrices (see Section 3.7 of [14]), we derive that the eigenvalues of C are all distinct. Consequently an eigenvector of C is automatically an eigenvector of ~B. Therefore for the pre-processing stage, we only have to compute the eigenvalues and the eigenvectors § and E of C, ¤ can then be determined by the relation ~BE = E¤. Since C can be split into two tridiagonal submatrices, the preprocessing stage only takes O(N 2) operations. As before the steps 1 through 3 take about 2N 3 operations. Now let us describe how to use the fast solver for (3.11) to solve the original system (3.8) or equivalently (3.9). To this end, we rewrite (3.11) by using the tensor product notation: (3.15) ~Du ´ ³ ® ~B B + ¯(C B + ~B C) + ~B I + 2C C + I B ´ u = f : it is easy to see that D and ~D di®er at only 4(q + 1) rows, more precisely they di®er at the rows: (i ¡ 1) ¤ q + 1; (i ¡ 1) ¤ q + 2; i ¤ q ¡ 1; i ¤ q for i = 1; 2 ¢ ¢ ¢ q. Following the idea in [6], we can use the fast solver for (3.15) to solve the equation (3.9) by the method of capacitance matrix. For the readers' convenience, we brie°y describe the method of capacitance matrix below: Without loss of generality, we assume that the ¯rst p rows of D are changed to obtain ~D. Although this is not the case here, but the same result can be achieved by using an implicit indexing scheme. Partition D, ~D and f in the form D = µ D1 D2 ¶ ; ~D = µ ~D1 D2 ¶ ; f = µ f1 f2 ¶ ; where D1 and ~D1 are p £ r matrices with r = (q + 1)2 to be the order of the matrix D, and f1 is a vector of length p. Then the equation (3.9) can be solved as follows: (0) Pre-processing: compute the p £ p capacitance matrix (3.16) P = D1 ~D¡1 µ I 0 ¶ ; where I is the p £ p identity matrix; factor P into a LU form; (1) Compute v1 = D1 ~D¡1f ; (2) Solve P w1 = f1 ¡ v1; (3) Solve ~Du = f + µ w1 0 ¶ . One can check that u is in fact the solution of the equation Du = f . It is clear that the steps 1 through 3 can be performed in 4N 3 +O(N 2) operations. The pre-processing stage, i.e. the computation of the capacitance matrix is however a little tricky. As explained in [5], one should take advantage of the sparseness of D1 and µ I 0 ¶ in the construction of P so that the preprocessing stage can be done in O(pr + p3) = O(N 3) operations. We refer to [5] for more details in this aspect. efficient spectral-galerkin method 1499 However, unlike in the ¯nite di®erence case [5], the capacitance matrix is no longer symmetric positive de¯nite. For we can write D = ~D + ¢ with ¢ = 0 BB@ E; 0; ¢ ¢ ¢ ; 0 0; E; ¢ ¢ ¢ ; 0 ... ... 0; ¢ ¢ ¢ ; 0; E 1 CCA where E is a diagonal matrix of order q with four nonzero entries at positions (1; 1), (2; 2), (q ¡ 1; q ¡ 1) and (q; q). Hence, ~D¡1D = I + ~D¡1¢ and (3.17) P = I + ¹¢ ¹D; where ¹¢ is the diagonal matrix with the nonzero entries of ¢ and ¹D is the part of ~D¡1 corresponding to the entries in positions: (i; j) : j = 0; 1; ¢ ¢ ¢ ; q; i = 0; 1; q ¡ 1; q: ~D is symmetric positive de¯nite so is ¹D. It turns out that all the nonzero entries in ¢ are positive. Hence P is not symmetric but it is similar to the symmetric positive de¯nite matrix ¹¢¡ 1 2 + ¹¢ 1 2 ¹D ¹¢ 1 2 . Furthermore, we note that D and ~D have alternating zero and nonzero elements, hence the system (3.9) (resp. the capacitance matrix P ) can be decoupled into four subsystems (resp. four submatrices of order q or q + 1). This would reduce the cost of pre-processing by a factor of 16. Finally, let us mention that three dimensional fourth order equations can also be treated by the above procedure. 4. Miscellaneous extensions. The Legendre Galerkin method described above can be applied to more general problems. In this section, we describe several imme- diately extensions. 4.1. Robin type boundary conditions. When other boundary conditions are prescribed, it is necessary to construct a basis incorporating the boundary conditions. For the sake of simplicity, we only consider the one dimensional equation ®u ¡ uxx = f; in I; with the Robin type boundary condition a§u(§1) + b§ux(§1) = 0: Let WN = fv 2 SN : a§v(§1) + b§vx(§1) = 0g, then the standard Legendre Galerkin approximation to the above equation is: Find uN 2 WN such that (4.1) ®(uN ; v) + (DxuN ; Dxv) = (f; v); 8 v 2 WN : As before, we can ¯nd an appropriate basis for WN by setting Ák(x) = Lk(x) + akLk+1(x) + bkLk+2(x); where ak and bk are the unique constants such that Ák(x) 2 WN . Therefore WN = spanfÁ0(x); Á1(x); ¢ ¢ ¢ ; ÁN ¡2(x)g: Taking v = Ák(x) in (4.1) for k = 0; 1; ¢ ¢ ¢ ; N ¡ 2, it can be readily checked that the matrix corresponding to the discrete system (4.1) is a symmetric pentadiagonal matrix. 1500 jie shen In the special case where a§ = 0 and b§ = 1 (i.e. the homogeneous Neumann boundary condition), we have in particular ak = 0 and bk = ¡ k(k+1) (k+2)(k+3) . In this particular case the matrix can be decoupled into two tridiagonal submatrices. Let us mention that we can also construct special basis for the fourth order problems with the condition uj@ = ¢uj@ = 0. 4.2. Non homogeneous boundary conditions. We can always modify the right-hand side to take care of the non homogeneous boundary conditions. Let us consider for instance the two dimensional Helmholtz equation (2.1). Non homogeneous boundary conditions for fourth order equations can be treated similarly. If the solution u of (2.1) is subject to the non homogeneous Dirichlet boundary condition: u(§1; y) = a§(y); u(x; §1) = b§(x); we proceed as follows: Setting u1(x; y) = b+(x) ¡ b¡(x) 2 y + b+(x) + b¡(x) 2 ; ~a§(y) = a§(y) ¡ u1(§1; y): By construction, we have ~a§(§1) = 0: Then setting u2(x; y) = ~a+(y) ¡ ~a¡(y) 2 x + ~a+(y) + ~a¡(y) 2 ; ~u = u ¡ u1 ¡ u2: One can readily check that ~u(§1; y) = ~u(x; §1) = 0: Hence it su±ces to solve the following modi¯ed Helmholtz equation: ®~u ¡ ¢~u = f ¡ ®(u1 + u2) + ¢(u1 + u2) in = I £ I; ~uj@ = 0: We note that the extra term ¢(u1 + u2) on the right hind side can be obtained in only O(N ) operations by using the recursive relation (2.5). 4.3. Non separable elliptic equations. For non separable equations of the form (4.2) Lu ´ ¡r ¢ [a(x; y)ru] + b(x; y)u = f (x; y); in = I £ I; uj@ = g(x; y); or more generally for problems with variable coe±cients, the Legendre-Galerkin meth- ods lead to systems with dense matrices, and can not be e±ciently solved by a direct method. However the fast direct methods for constant coe±cient problems developed in the previous sections can be used to e±ciently solve the equation (4.2) by using an iterative procedure proposed in [9]. The heart of this iterative procedure is the utiliza- tion of the fast solver for the Helmholtz equation, regardless the type of discretization employed. It is shown in [9] that the rate of the convergence of the iterative procedure is independent of the number of modes used in each direction. Therefore an equation of the form (4.2) can be solved in O(N 3) operations. 5. Numerical results. We report in this section several numerical examples by using the algorithms presented in the previous sections. Let us remark that the pure spectral-Galerkin method is rarely used in practice, since for a general right-hand side function f we are not able to compute exactly efficient spectral-galerkin method 1501 its representation by Legendre polynomials. Instead, the so called pseudo-spectral method is used to treat the right-hand side (or the product of two functions), i.e. we replace f by IN f in the computation, where IN f being the interpolation of f over the set of Gauss-Lobatto points. This would introduce an extra error term of order C(¾)N ¡¾kf k¾ for f 2 H ¾() (see [8]) in the estimates (2.3) and (3.3). Hence, the spectral accuracy is still retained. Unfortunately in the Legendre case, we can not use FFT to transform from the physical space to the spectral space and vice versa. Instead we shall use direct matrix multiplication, which takes 2dN d+1 operations for each transformation in a d dimen- sional domain. Hence for each particular solution of the Helmholtz equation and the biharmonic equation, 2dN d+1 additional operations are needed to transform IN f to the spectral space and to transform the solution uN to the physical space. However let us remark that this additional amount of operations can be eventually reduced, at least for N su±ciently large, by using the fast transform developed by Orszag [17], to O(N d(log2 N )2) operations, or by the fast multipole method presented in [4], to O(N d log2 N ) operations. We note also that this additional amount of work is not needed if one is content with the solution in spectral space for right-hand side given in spectral space. We consider ¯rst the two examples considered in [12]. Example 1. The Poisson equation ¡¢u = 32 sin(4¼x) sin(4¼y); in = I £ I; uj@ = 0; with a smooth exact solution u(x; y) = sin(4¼x) sin(4¼y). Example 2. The Poisson equation ¡¢u = 1; in = I £ I; uj@ = 0; with an exact solution u(x; y) = ¡ 64 ¼4 1X n;m=1 n;m odd (¡1) n+m 2 cos( n¼x 2 ) cos( m¼y 2 ) nm(n2 + m2) ; which has singularities at the four corners. We shall compare the Legendre-Galerkin method (LGM) with the Chebyshev-tau (CTM) and Chebyshev-collocation (CCM) methods. In Table I, we list the maximum pointwise error of u ¡ uN by LGM, CTM, CCM and the second and fourth order ¯nite di®erence (FD2 and FD4) methods. Table I. Maximum pointwise error of u ¡ uN for examples 1 and 2. Example N LGM CTM CCM FD4 FD2 1 16 2.93E-3 3.33E-2 5.25E-3 2.81E-2 2.34E-1 1 32 3.44E-13 4.77E-11 2.12E-12 1.62E-3 5.30E-2 1 64 5.55E-15 8.67E-13 1.55E-13 9.97E-5 1.30E-2 1 128 6.88E-15 2.00E-12 1.56E-13 6.21E-6 3.22E-3 2 16 1.42E-6 3.52E-5 7.47E-7 7.17E-6 9.02E-4 2 32 7.48E-8 2.23E-6 5.51E-8 1.79E-6 2.26E-4 We notice that for the ¯rst example, all three spectral methods converge ex- ponentially but the LGM is considerably more accurate than the CTM and CCM. For the second example which has corner singularities, the LGM is as accurate as 1502 jie shen the CCM and is still clearly more accurate than the CTM. We note that the main source of roundo® errors comes from the matrix decomposition. Since decomposing a symmetric tridiagonal matrix in LGM is much less a®ected by roundo® errors than decomposing a full matrix in CTM and CCM, the roundo® errors in LGM are much less pronounced than that of CTM and CCM. This is con¯rmed by the numerical results in Table I. In Table II, we list the execution time in seconds on Sun-Sparc2 for the ¯rst example by the three spectral methods. The approximate pre-processing times are given in parentheses. The programs were written in Fortran and compiled with the option ¡O. LAPACK routines were used for matrix-matrix multiplications and for solving the eigenvalue problems. Table II. Execution time and pre-processing time for example 1. Example N LGM CTM CCM 1 32 0.10 (0.03) 0.09 (0.13) 0.05 (0.27) 1 64 0.64 (0.12) 0.44 (0.54) 0.43 (2.44) 1 128 6.96 (1.01) 3.36 (5.20) 4.66 (19.58) We note that for a particular solution of the Helmholtz equation, LGM is clearly the method of choice since its pre-processing time is negligible. For multiple solutions, the LGM is still competitive to CTM and CCM for N up to the range of 48 to 64.1 We remark also that it is not very appropriate to compare the execution time of the collocation method which provides only the physical representation, to that of the Galerkin and tau methods which provide both the physical and spectral representa- tions, since derivatives of functions, which are often needed for nonlinear problems, can be e±ciently evaluated in spectral representations. We note that most of the com- puting time in LGM is used for transforming from physical representation to spectral representation and vice versa. Hence the CPU in LGM can be greatly reduced if one only needs the spectral representation. Example 3. The 2-D biharmonic equation in = I £ I: ¢2u = 128¼4(cos(4¼x) cos(4¼y) ¡ cos(4¼x) sin(2¼y)2 ¡ cos(4¼y) sin(2¼x)2) uj@ = @u @n j@ = 0; with a smooth exact solution u(x; y) = (sin(2¼x) sin(2¼y))2. In Table III, we list in the second row the maximum pointwise error of u ¡ uN ; in the third row, we list the execution time for Example 3 with approximate pre- processing time in parentheses; in the last row, we list the condition number of the capacitance matrix P . Table III. Results for example 3. N 16 32 64 128 L1 error 1.48E-2 7.45E-12 2.04E-14 2.81E-14 CPU (Pre-P) 0.02 (0.08) 0.12 (0.60) 0.82 (5.15) 8.28 (45.03) Cond. no. of P 115.524 1608.96 24772.8 393214 1 This range may be increased for highly parallel computers or when a fast transform method is employed. efficient spectral-galerkin method 1503 It is obvious that the approximate solutions converge exponentially to the exact solution. We note that the condition numbers of P grow like O(N 4). Hence the inversion of P is probably the main source of roundo® errors observed for N large. It is worth noting that the execution time for solving a 2-D biharmonic equation is only about 20% more than that for solving a 2-D Poisson equation. The last example we consider is the non separable equation (4.2) with a(x; y) = [1 + 1 4 ((x + 1)4 + (y + 1)4)]2; u(x; y) = sin(¼x) sin(¼y): For the details of the iterative scheme, we refer to [9]. Note however that we used the shifting factor K ¼ k ¢ p a(x;y)p a(x;y) kL2(), which seemed to give a slightly better conver- gence rate, instead of K ¼ 1 2 (min ¢ p a(x;y)p a(x;y) + max ¢ p a(x;y)p a(x;y) ) suggested in [9]. Note also that the preconditioned conjugate gradient method, as opposed to the simple Richardson iteration proposed in [9], can be used to accelerate the convergence rate. Various iterative methods along with treatments for more general variable coe±cient problems will be investigated in a future work. Table IV. Results for the non separable equation. N 16 32 64 128 max(u7 N ¡ u6 N ) 2.93E-7 4.87E-7 6.15E-7 6.83E-7 max(u7 N ¡ u) 2.47E-8 4.65E-8 6.16E-8 6.98E-8 CPU 0.09 0.62 4.51 45.06 We have summarized In Table IV the results after 7 Richardson iterations with the initial guess u0 N ´ 0. The results clearly demonstrate that the convergence rate of the scheme is independent of N . Note however that due to the expensive transformations required by the Galerkin method, a collocation method is probably preferable for this problem, especially when N is large. Concluding remarks. We have presented in this paper a systematic way to construct appropriate bases for the Legendre-Galerkin method applied to constant coe±cient elliptic problems. We have also developed e±cient direct solvers whose complexities are a small multiple of N d+1 operations in a d dimensional domain with (N ¡ 1)d unknowns. Furthermore, the algorithms can be e®ectively parallelized. Tak- ing into account the fact that the convergence rate of the Legendre-Galerkin method is exponential, we conclude that our algorithms are very valuable for the speci¯c prob- lems considered in this article. To the best of the author's knowledge, our algorithm for the fourth order equations is the ¯rst fast direct solver with spectral discretiza- tion. Our direct solver for one particular second order equations is probably the most e±cient among the existing spectral methods. Our direct solver for the second order equations with multiple right-hand sides is also very competitive to the direct solvers by Chebyshev-tau, Chebyshev-collocation and spectral element methods (see [12], [8], [18]). We note that similar techniques can be applied to Galerkin method using Cheby- shev polynomials (cf. [21]) or other Jacoby polynomials. 1504 jie shen REFERENCES [1] C. BERNARDI, G. COPPOLETTA, and Y. MADAY, Some spectral approximations of two- dimensional fourth-order problems, Math. Comp., 59 (1992), pp. 63{76. [2] C. BERNARDI AND Y. MADAY, Some spectral approximations of one dimensional fourth- order problems, in Progress in Approximation Theory, P. Nevai and A. Pinkus, eds., Aca- demic Press, 1991, pp. 43{116. [3] P. BJORSTAD, Fast numerical solution of the biharmonic Dirichlet problem on rectangles, SIAM J. Numer. Anal., 20 (1983), pp. 59{71. [4] J. P. BOYD, Multipole expansions and pseudospectral cardinal functions: a new generation of the fast Fourier transform, J. Comput. Phys., 103 (1992), pp. 184{186. [5] B. L. BUZBEE AND F. W. DORR, The direct solution of the biharmonic equation on rect- angular regions and the Poisson equation on irregular regions, SIAM J. Numer. Anal., 11 (1974), pp. 753{763. [6] B. L. BUZBEE, F. W. DORR, J. A. GEORGE, and G. H. GOLUB, The direct solution of the discrete Poisson's equation on irregular domains, SIAM J. Numer. Anal., 8 (1971), pp. 722{ 736. [7] B. L. BUZBEE, G. H. GOLUB, and C. W. NIELSON, On direct methods for solving Poisson's equations, SIAM J. Numer. Anal., 7 (1970), pp. 627{656. [8] C. CANUTO, M. Y. HUSSAINI, A. QUARTERONI, and T. A. ZANG, Spectral Methods in Fluid Dynamics, Springer-Verlag, 1987. [9] P. CONCUS AND G. H. GOLUB, Use of fast direct methods for the e±cient numerical solution of nonseparable elliptic equations, SIAM J. Numer. Anal., 10 (1973), pp. 1103{1120. [10] D. FUNARO AND W. HEINRICHS, Some results about the pseudospectral approximation of one dimensional fourth order problems, Numer. Math., 58 (1990), pp. 399{418. [11] D. GOTTLIEB AND S. A. ORSZAG, Numerical Analysis of Spectral Methods: Theory and Applications, SIAM-CBMS, Philadelphia, 1977. [12] D. B. HAIDVOGEL AND T. A. ZANG, The accurate solution of Poisson's equation by expansion in Chebyshev polynomials , J. Comput. Phys., 30 (1979), pp. 167{180. [13] Y. MADAY AND A. T. PATERA, Spectral element methods for the incompressible Navier- Stokes equations, in State-of-the-art surveys on computational mechanics, A. K. Noor and J. T. Oden, eds., 1989, pp. 71{143. [14] M. MARCUS AND H. MINC, A Survey of Matrix Theory and Matrix Inequalities, Prindle, Weber and Schmidt, Boston, 1964. [15] A. MAYO, The fast solution of Poisson's and the biharmonic equations on general regions , SIAM J. Numer. Anal., 21 (1984), pp. 285{299. [16] A. MAYO AND A. GREENBAUM, Fast iterative solution of Poisson's and the biharmonic equations on irregular regions, SIAM J. Sci. Stat. Comput., 13 (1992), pp. 101{118. [17] S. A. ORSZAG, Fast eigenfunction transforms, Science and Computers: Advances in mathe- matics supplementary studies, 10 (1986), pp. 23{30. [18] A. T. PATERA, Fast direct Poisson solvers for high-order ¯nite element discretizations in rectangularly decomposable domains, J. Comput. Phys., 65 (1986), pp. 474{480. [19] G. SACCHI-LANDRIANI, Spectral tau approximation of the two-dimensional Stokes problem, Numer. Math., 23 (1988), pp. 683{699. [20] J. SHEN, A spectral-tau approximation for the Stokes and Navier-Stokes equations, Math. Model. Num. Anal., 22 (1988), pp. 677{693. [21] , E±cient spectral-Galerkin method II. Direct solvers for second- and fourth-order equa- tions by using Chebyshev polynomials, SIAM J. Sci. Comput., 16 (1995), pp. 74{87. [22] J. SHEN AND R. TEMAM, Nonlinear Galerkin methods using Chebyshev or Legendre poly- nomials I. One dimensional case, SIAM J. Numer. Anal., 32 (1995), pp. 215{234. [23] G. SIVASHINSKY, Nonlinear analysis of hydrodynamic instability in laminar °ames, Part I. Derivation of basic equations, Acta Astronaut., 4 (1977), pp. 1177{1206. [24] R. W. de VRIES AND P. J. ZANDBERGEN, The numerical solution of the biharmonic equation, using a spectral multigrid method, in Advances in Fluid Dynamics, W. F. Ballhaus and M. Y. Hussaini, eds., 1989, pp. 25{35.
采集于
查看校方原文 ↗