校园网页 · 学校官网
Sphere.dvi
EFFICIENT SPECTRAL-GALERKIN METHODS IV. SPHERICAL GEOMETRIES JIE SHENy SIAM J. SCI. COMPUT. c 1999 Society for I ndustrial and Applied Mathematics Vol. 20, No. 4, pp. 1438{1455 Abstract. Fast spectral-Galerkin algorithms are developed for elliptic equations on the sphere. The algorithms are based on a double Fourier expansion and have quasi-optimal (optimal up to a loga- rithmic term) computational complexity. Numerical experiments indicate that they are signi cantly more ecient and/or accurate when compared with the algorithms based on spherical harmonics and on nite di erence. Extensions to problems in spherical layers and to vector equations are also discussed. Key words. spectral-Galerkin, spherical harmonics, double Fourier series, spherical geometry AMS subject classi cations. 65N35, 65N22, 65F05, 35J05 PII. S1064827597317028 1. Introduction. This paper is the fourth and nal part of a sequential work on ecient spectral-Galerkin methods for elliptic problems. In the rst and second parts [14, 15], we presented ecient algorithms for elliptic equations in rectangular domains. In the third part [17], we dealt with polar and cylindrical geometries. In this part, we shall develop ecient spectral-Galerkin algorithms for elliptic equations in spherical geometries, which have important applications in many elds of science and engineering, especially in computational uid dynamics, climate modeling, and numerical weather prediction. The most natural way to deal with spherical geometries is to use spherical coordi- nates and spherical harmonic functions. Although the spherical harmonic functions, being the eigenfunctions of the spherical Laplace operator, o er a number of dis- tinct advantages, such as uniform resolution on the sphere and simplicity for linear, constant-coecient problems, they have a notorious drawback due to the lack of a fast algorithm for the analysis (from the function values at a set of appropriate points to the coecients of its spherical harmonic expansion) and synthesis (the inverse op- eration of analysis) in spherical harmonic expansions. Even though this situation may be improved in light of some recent contributions (see, for instance, [6, 10]), it is still unlikely that spherical harmonic transforms can be as ecient as the fast Fourier transform (FFT). An alternative approach is to use double Fourier series whose anal- ysis and synthesis can be done by the FFTs. The advantages and disadvantages of using double Fourier series as opposed to using spherical harmonic functions were discussed in great detail by Orszag [12] (see also Boyd [2, 4]). There have been a number of attempts at using double Fourier series for solving Poisson equations on the sphere. Orszag [12] (see also the references therein for other earlier and less successful attempts) suggested an ecient algorithm based on the tau method for solving the Poisson equation by using double Fourier series. Later, Yee [20] presented a similar algorithm with all the details needed for implementation. Unfor- tunately, although very ecient and easy to implement, Yee's algorithm is not entirely Received by the editors February 31, 1997; accepted for publication (in revised form) October 31, 1997; published electronically March 30, 1999. This work was supported in part by NSF grant DMS-9623020. http://www.siam.org/journals/sisc/20-4/31702.html yDepartment of Mathematics, Penn State University, University Park, PA 16802 (shen@ math.psu.edu). 1438 EFFICIENT SPECTRAL-GALERKIN METHODS IV 1439 correct, for the pole condition (10) in [20] is enforced incorrectly by determining u0m from the relation (15) in [20], which may lead to inaccurate results. Some interesting pseudospectral approaches can be found in [7, 8]. However, the double Fourier se- ries approach has not been used much in practice, partly because most computations on the sphere were restricted, by computing resource in the past, to using coarse to moderate resolutions for which not much could be gained by using double Fourier series and perhaps partly because of the lack of fast and reliable algorithms (see also p. 495 in Boyd [4]). With the rapid increase in computing power, researchers are bound to use ner and ner resolutions in their computations to tackle more complex problems. Thus, fast algorithms using double Fourier series may become more and more advantageous with ner and ner resolutions when compared to the algorithms using spherical harmonics. The purpose of this paper is to develop fast algorithms for elliptic equations on the sphere by using double Fourier series. We will also consider the problems in spherical layers by using the double Fourier series or spherical harmonics for the horizontal variables and Legendre or Chebyshev polynomials for the vertical variable. It is hoped that this paper will help to revive researchers' interests in using double Fourier series for elliptic- or parabolic-type equations in spherical geometries. The rest of the paper is organized as follows. In the next section, we present two new algorithms by using double Fourier series for the Helmholtz equation and we report on the numerical experiments which compare the new algorithms with the existing algorithms based on the spherical harmonics and nite di erence. In section 3, we present various extensions of our algorithms, including, in particular, applications to the elliptic equations in spherical layers and to the vector elliptic equations. Finally, we o er some concluding remarks followed by an appendix detailing the matrices introduced in section 3. 2. Elliptic problems on the sphere. Since the surface of the sphere has no boundary, high-order equations such as biharmonic or Stokes equations can be readily split up into a couple of second-order equations. Therefore, we shall only consider the Helmholtz equation on the surface of a unit sphere U U =F inS :=f(x;y;z ): x 2 +y2 +z2 =1g:(2.1) We refer to [5] for a classical analysis on the well-posedness of this equation. Applying the spherical transformation x =s i n cos ; y=s i n sin ; z=c o s(2.2) to (2.1) and settingu(; )= U(x;y;z ),f(; )= F (x;y;z ), andD := (0; )[0; 2), we obtain Lu := u 1 sin@(sin@u) 1 sin2@ u =f; (; )2D:(2.3) If 6= 0, the above equation has a unique solution, while for = 0, the compatibility condition Z 2 0 d Z 0 sinf(; )d =0(2.4) should be satis ed, and the solution u is only determined up to an additive constant. 1440 JIE SHEN Equation (2.3) can be trivially solved by using the spherical harmonics which are in fact the eigenfunctions of the elliptic operatorL (cf. [5]). The main disadvantage of using spherical harmonics is that the transformations between physical and spectral spaces are expensive. An alternative is to expand functions on the sphere by using double Fourier series (cf. [12] and [2]). In order to develop a fast algorithm based on a double Fourier expansion, we need to recall some important properties satis ed by u m and fm. Since u is periodic in ,w em a yw r i t e u(; )= 1X jmj=0 um()eim ; with u m()=um() for all m;(2.5) where um is the complex conjugate of um, and likewise for f. Substituting the ex- pansion (2.5) (likewise for f) in (2.3), we nd um 1 sin d d sin d dum + m2 sin2 um =fm; 2 (0; ):(2.6) On the other hand, we may expand u(; ) in spherical harmonics functions, u(; )= 1X n=0 nX jmj=0 anmPm n (cos)eim ;(2.7) wherePm n (x) is the associated Legendre function. Following Orszag (cf. [12]),Pm n (cos) can be expressed as sinjmjPnm(cos)( w h e r ePnm(x) is a polynomial of degreen jmj in x), and we nd from (2.5) and (2.7) that um()=s i njmj 1X n=jmj anmPnm(cos):(2.8) Hence,um() has the same parity asm and is a periodic function with period 2; i.e., um (and fm) belongs to the space Y (m) := ( v()= 1X n=0 vn (m) n (): v2L2(0; ) ) ;(2.9) where (m) n (): = ( sinn for m odd; cosn for m even.(2.10) Consequently,u (and f) belongs to the space Y := 8 < :v = 1X jmj=0 vm()eim 2L2(D): vm2Y (m);v m()=vm() 9 = ;:(2.11) Note that Y (m) (andX(m),Z(m) de ned later) are complex spaces, while Y (andX, Z de ned later) are real spaces. Furthermore, um()h a s( a tl e a s t )a njmjth order zero at =0; ; i.e., um() satis es the following pole condition: dkum dk j=0; =0f o rm6=0;k =0; 1; 2;:::; jmj 1:(2.12) EFFICIENT SPECTRAL-GALERKIN METHODS IV 1441 As pointed out by Orszag [12] (see also [2]), it is impractical and not necessary for the approximate solution to satisfy all the pole conditions in (2.12). We present below a fast solver for (2.6) (hence for (2.3)) based on a weighted Galerkin method in which the approximate solution, while being spectrally accurate, only satis es the essential or necessary pole condition(s) to be speci ed below. 2.1. An interpolation operator. Given a pair of even integers ( N;M ), we de ne the approximations of Y (m) and Y as Y (m) N := 8 < :v()= N mod(m;2)X n=mod(m;2) vn (m) n () 9 = ;(2.13) and YNM := 8 < :v = MX jmj=0 vm()eim : vm2Y (m) N ; v m =vm for all m v0;v M;vM are real 9 = ;:(2.14) Observing that, for u2Y\C(D), we have u(0; )= u(0; + );u (; )= u(; + )8 2 (0; 2);(2.15) we de ne a grid associated to YNM by ~NM := ( (i; j): j =0; 1;:::; 2M 1f o ri =1; 2;:::;N 1 j =0; 1;:::;M 1f o ri =0a n d N ) ;(2.16) where i = i N and j = j M . One observes that there are 2NM points in ~NM and that the degree of freedom of YNM is also 2NM . Next, for any continuous, 2-periodic function v( ), we de ne an interpolation operator based on f jgj=0;1;:::;2M 1 by I Mv( )= MX jmj=0 vmeim and I Mv( j )= v( j );j =0; 1;:::; 2M 1:(2.17) One derives from the discrete Fourier transform that vm = 1 cmM 2M 1X j=0 v( j )e im j;v m =vm;m =0; 1;:::;M;(2.18) where cm =1f o rjmj6 =M,cM =c M =2 . Now, for u2Y\C(D)a n df o rk =0; 1:::;N ,w eh a v e I Mu(k; )= MX jmj=0 um(k)eim with um(k)= 1 cmM 2M 1X j=0 u(k; j)e im j:(2.19) In particular, we have u(0; j)= I Mu(0; j)= MX jmj=0 um(0)eim j; u(0; + j)= I Mu(0; + j)= MX jmj=0 ( 1)mum(0)eim j: (2.20) 1442 JIE SHEN Since u(0; )= u(0; + )f o ru2Y , we derive from the above relations that MX jmj=0 m odd um(0)eim j =0 f o r j =0; 1;:::; 2M 1:(2.21) Consequently,um(0) = 0 for m odd. Similarly, um()=0f o r m odd. Let cj =1f o r j =1;:::;N 1a n dc0 =cN =2 ;w es e t unm = 2 N N 1X j=1 um(j )s i n (nj);n =1;:::;N 1f o r m odd;(2.22) and unm = 2 cnN NX j=0 1 cj um(j)c o s (nj);n =0;:::;N for m even:(2.23) Then one nds from the discrete sin and cos transforms that um(j)= N mod(m;2)X j=mod(m;2) unm (m) n (j);j =m o d (m; 2);:::;N mod(m; 2):(2.24) Now we de ne an operator INM :Y\C(D) !YNM by INMu(; ): = MX jmj=0 N mod(m;2)X n=mod(m;2) unm (m) n ()eim :(2.25) By construction, we have INMu(; )= u(; ) 8(; )2 ~NM;u 2Y\C(D); i.e., INM :Y\C(D) !YNM is an interpolation operator associated with the grid ~NM . Note that functions in Y do not satisfy any pole conditions in (2.12), hence, they are not even single valued at the poles in the Cartesian coordinates. We de ne below a sequence of spaces whose functions satisfy the rst pole condition in (2.12): Z(m) = n v2Y (m)\H1(0; ): v(0) =v()=0w h e n m6=0 o ; Z = 8 < :v = 1X jmj=0 vm()eim 2H1(D): vm2Z(m);v m =vm 9 = ;; Z(m) N = n v2Y (m) N : v(0) =v()=0w h e n m6=0 o ; ZNM = 8 < :v = MX jmj=0 vm()eim : vm2Z(m) N ; v m =vm for all m v0;v M ;vM are real 9 = ;: (2.26) We observe that, for u2Z,w eh a v e u(0; )= u(0; 0);u (; )= u(; 0) 8 2 (0; 2):(2.27) Therefore, functions in Z are single valued at the poles in the Cartesian coordinates. Note that one veri es easily that the spherical gradient rsu =( u; u sin )t 2 L2(D) for u2 Z. Thus, functions in Z are also di erentiable at the poles in the Cartesian coordinates. EFFICIENT SPECTRAL-GALERKIN METHODS IV 1443 2.2. Formulation of the algorithm. Given a positive weight function !() satisfying!(0) =!() = 0, and an appropriate subspace X(m) N Y (m) N ,t h ew e i g h t e d spectral-Galerkin (Petrov{Galerkin) approximation to (2.6) is to nd u(m) N 2 X(m) N (for m =0; 1;:::;M ) such that Z o u(m) N v!()d Z 0 d d sin d du(m) N v!() sind +m2 Z 0 u(m) N v !() sin2d = Z 0 f(m) N v!()d 8v2X(m) N ; (2.28) where f(m) N is an approximation of fm de ned by INMf = MX jmj=0 f(m) N ()eim ; with f(m) N 2Y (m) N :(2.29) Then the approximation of u is de ned as uNM = MX jmj=0 u(m) N ()eim ;u ( m) N ()=u(m) N ():(2.30) Given a set of basis functionsf (m) n g forX(m) N (the dimension ofX(m) N will be speci ed later), we may write u(m) N =P nx(m) n (m) n . Setting a(m) kj = Z 0 (m) j (m) k !()d; b(m) kj = Z 0 d d (sin d d (m) j ) (m) k !() sind; c(m) kj = Z 0 (m) j (m) k !() sin2d; g(m) j = Z 0 f(m) N (m) j !()d; (2.31) and A(m) =(a(m) kj );B (m) =(b(m) kj );C (m) =(c(m) kj ); x(m) =(x(m) j ); g(m) =(g(m) j ); (2.32) then (2.28) is equivalent to the following linear system: ( A(m) +B(m) +m2C(m))x(m) =g(m):(2.33) The eciency of the method depends on the structure of these matrices, which in turn depend on the choice of !()a n dX(m) N . There are numerous ways to choose the weight !()a n d X(m) N as long as the linear system (2.28) is well-posed. Note that although the exact solution um of (2.6) will automatically satisfy all the pole conditions in (2.12), the approximation solution u(m) N will not unless these pole conditions are built into the space X(m) N . We recall that it is impractical and not necessary for the approximate solution to satisfy all the pole conditions in (2.12). Hence, we shall search a pair of w()a n dX(m) N such that (i) the linear system (2.33) is nonsymmetric but positive de nite; and (ii) the matrices A(m), B(m),a n dC(m) are banded matrices with small bandwidth so that (2.33) can be solved eciently. 1444 JIE SHEN To x the idea, we assume 6=0 . T h ec a s e = 0 can be treated similarly with slight modi cations (see Remark 2.1). The form of (2.6) suggests that we choose !()=s i n2. In this case, the system (2.28) is well de ned forX(m) N =Y (m) N ; i.e., no pole condition isessential |a l lt h ep o l e conditions in (2.12) are nonessential (i.e., natural). We consider below two di erent choices for X(m) N . Case 1. !()=s i n2; X(m) N =Y (m) N . In this case, (m) n () is de ned in (2.10). By elementary computations, we nd that the system (2.33) has only three nonzero diagonals. More precisely, the nonzero entries of A (m), B(m),a n dC(m) are given below (the superscript (m) is omitted for simplicity). Form odd and k;j =1; 2;:::;N 1: ajk =akj = 2 ( 1 4;k =j +2; 1 2;k =j6=1; a11 = 3 8 ;(2.34) bkj = 2 8 >> < >> : 1 4j(j +1 );k =j +2; 1 2j2;k =j; 1 4j(j 1);k =j 2; (2.35) ckj = 2kj:(2.36) Form even (including m =0 ) and k;j =0; 1;:::;N : Fork;j =1; 2;:::;N ,t h e akj , bkj ,a n dckj are exactly the same as above except that a11 = 8 . The additional nonzero entries (for k or j =0 )a r e a00 = 2;a 02 =a20 = 4;b 02 = 2; and c00 =: The choice X(m) N =Y (m) N leads to the simplest linear system. However, the solu- tion uNM (in YNM ) is neither necessarily single valued nor di erentiable at the poles in the Cartesian coordinates, although the approximate solution uNM still converges tou exponentially provided thatf is smooth in the spherical coordinates (see section 3). In order to apply this algorithm to more complicated situations, such as nonlinear or time dependent problems, we may project, in an appropriate way, the solutionuNM to the space ZNM . To this end, we de ne a simple projector NM : YNM !ZNM as follows. L e tu s r s td e n eap r o j e c t o r(m) N : Y (m) N !Z(m) N . Form odd or m =0 ,w es e t(m) N to be the identity operator. For m even and m 6= 0, any function u in Y (m) N c a nb ew r i t t e na su =PN k=0ak cosk.W e s e t(m) N u :=PN k=0 ~ak cosk,w h e r e~ak = ak for k = 0; 1;:::;N 2, while ~aN 1 and ~aN are uniquely determined by the conditions ((m) N u)(0) = ((m) N u)()=0 . Then, for u =PM jmj=0um()eim 2YNM ,w es e t NM u := MX jmj=0 (m) N umeim :(2.37) EFFICIENT SPECTRAL-GALERKIN METHODS IV 1445 Thus, NM uNM 2 ZNM and is single valued and di erentiable at the poles, and we may use (m) N uNM as an approximation to u whenever necessary. Case 2. !()=s i n2; X(m) N =Z(m) N . In this case, the rst pole condition in (2.12) is imposed so that the solutions are single valued and di erentiable at the poles. A convenient set of basis functions for Z(m) N is (m) n ()= 8 >< >: cos(n 1) cos(n +1 ); m even and m6=0; cosn; m =0; sinn; m odd: :(2.38) It can be veri ed that in this case the system (2.33) has at most ve nonzero diagonals. For m odd or m = 0, the matrices are exactly the same as in the case of X(m) N =Y (m) N , while for m even and m6= 0, their nonzero entries are (the superscript (m) is omitted below for simplicity) ajk =akj = 2 8 >< >: 1 4;k =j +4; 1;k =j +2 6=3; 3 2;k =j6=1; 2; (2.39) with a11 = 5 4 , a22 = 5 8 ,a13 =a31 = 5 8 ; bkj = 2 8 >> > >>> > > < >> > > > > > > : 1 4 (j +2 ) (j +3 );k =j +4; 1 2 (2j2 +7j +3 );k =j +2; 1 2 (3j2 +6j +5 );k =j6=1; 1 2 (2j2 +j +1 );k =j 26=1; 1 4j(j 1);k =j 4; (2.40) with b11 = 3 2 ,b13 = 3 ; cjk =ckj = 2 ( 1;k =j +2; 2;k =j6=1;(2.41) with c11 = 3 2 . Note that in both cases the linear system (2.28) (or (2.33)) is nonsymmetric but positive de nite for 0. Indeed, for u2Y (m) N , Z 0 sinu(sinu) d = Z 0 sin2u2 d + 1 2 Z 0 sin 2uud = Z 0 sin2u2 d + 1 4 Z 0 sin 2(u2)d = Z 0 sin2u2 d 1 2 Z 0 cos 2u2d: Therefore, for u2Y (m) N ,w eh a v e am(u;u )= Z 0 sin2u2d + Z 0 sinu(sinu) d +m2 Z 0 u2d Z 0 sin2u2 d + Z 0 m2 1 2 + sin2 u2d: (2.42) 1446 JIE SHEN Table 2.1 Condition number of (2.33) with m =0 . N =M 16 32 64 128 256 =0 1.36E+3 9.03E+3 5.74E+4 3.52E+5 2.11E+6 =1; 000 1.51E+2 5.83E+2 3.85E+3 2.89E+4 2.08E+5 =1; 000; 000 1.66E+2 6.07E+2 2.32E+3 9.01E+3 3.51E+4 Hence, for m6= 0, the bilinear form is nonsymmetric positive de nite. For the case m = 0, the same conclusion can be drawn since the matrix B0 given in (2.35) is irre- ducibly (column) diagonally dominant with positive diagonal elements. In addition, the above inequality indicates that the conditioning of the linear system (2.28) (or (2.33)) improves as increases. In Table 2.1, we list the condition numbers, de ned as the ratio of the largest and smallest singular values, of the matrices associated to (2.33) with several values of . Only the case m = 0 is listed since it is clear from (2.42) and it is found numerically that the largest condition number occurs at m =0 . Since Y (0) N =Z(0) N , the matrix of (2.33) with m = 0 is the same for both cases. Note that the condition numbers are relatively large, so it is advised to use double precision, especially for largeN. On the other hand, for large values of , which occur often in solving time dependent uid problems with large Reynolds numbers, the condition number improves signi cantly, especially for largeN. Thus, our algorithms are well-suited for problems with large values of ; see Table 2.3 for more numerical results on this point. Note also that (2.33) can be split up into two tridiagonal or pentadiagonal sub- systems which can be solved very eciently in O(N) operations. Thus, the overall computational complexity of this Helmholtz solver is O(NM logM). Remark 2.1. For =0 , we can x the additive constant by removing the constant function, i.e., (0) 0 , from the expansion. In other words, we look for u(0) N 2 spanfcosn : n =1 ; 2;:::;N g. Then, the system (2.33) at m =0 becomes a well de ned NN system. Hence, u(0) N is uniquely determined without requiring any compatibility condition. However, the corresponding approximate solution uNM will converge to u only if f satis es the compatibility condition (2.4). Remark 2.2. A seemingly more natural weight function is !()=s i n which is in fact the Jacobian of the spherical transformation and which leads to symmetric positive de nite systems (2.33). In this case, (2.28) makes sense only if u m(0) =um()=0 ;m 6=0:(2.43) Hence, we may take X(m) N =Z(m) N and use (m) n de ned in (2.38). Unfortunately, the resulting linear systems are not sparse. 2.3. Numerical results. We have solved the Helmholtz equation (2.3) on the sphere with the function f being such that the exact solution is u(; ) = cos(8(sin cos +s i n sin +c o s))(2.44) by using four di erent algorithms. Namely, (i) sph har: using spherical harmonics; (ii) Fourier I: using double Fourier series in (2.28) with !()=s i n2()a n dX(m) N =Y (m) N ; (iii) Fourier II: using double Fourier series in (2.28) with !()=s i n2()a n dX(m) N = Z(m) N ; (iv) FISHPACK: using the nite di erence code hwsssp.f in FISHPACK [19]. EFFICIENT SPECTRAL-GALERKIN METHODS IV 1447 Table 2.2 Comparison of the l2 errors for the solution u with =0 . N =M 16 20 24 32 40 sph har 4.93E-2 1.80E-3 2.63E-5 5.06E-10 6.24E-15 Fourier I 1.29E-2 1.47E-4 1.20E-6 5.55E-11 4.54E-15 Fourier II 1.28E-2 1.45E-4 1.99E-6 5.56E-11 4.59E-15 FISHPACK 3.41E-1 2.13E-1 1.41E-1 7.24E-2 4.35E-2 Table 2.3 l2 errors for the solution u with di erent . N =M 16 32 64 128 Fourier I( =0 ) 1.29E-2 5.55E-11 8.54E-15 4.76E-15 Fourier II ( =0 ) 1.28E-2 5.56E-11 8.52E-15 5.04E-15 Fourier I( =1; 000) 3.17E-3 2.03E-11 7.72E-15 1.52E-14 Fourier II ( =1; 000) 1.68E-3 2.03E-11 8.74E-15 1.51E-14 Fourier I( =1; 000; 000) 1.37E-5 5.88E-12 2.14E-12 7.66E-13 Fourier II ( =1; 000; 000) 2.11E-6 5.88E-12 2.14E-12 7.67E-13 Fourier I( = 1; 000) 1.03E-2 2.91E-10 2.18E-14 1.34E-14 Fourier II ( = 1; 000) 3.43E-3 2.91E-10 1.77E-14 1.69E-14 All computations were carried out in double precision on a SUN Ultra-1 workstation Model-140 with the standard optimization option \-O." In Table 2.2, we list the discretel2 errors, based on the collocation points in ~NN , of the four algorithms applied to (2.3) with = 0. As expected, all three spectral methods converge exponentially and the nite di erence code converges quadratically. Note that the two algorithms using double Fourier series are slightly more accurate than that using spherical harmonics. Next, we demonstrate the robustness of our algorithms with respect to .I n Table 2.3, we list the l 2 errors of our algorithms with several di erent values of . The exact solution is again given in (2.44). The results in Table 2.3 clearly indicate that our algorithms are robust with respect to large values of . They even produce spectrally accurate results for negative values of which are not close to the critical values for which (2.33) is singular. In Table 2.4, we list the CPU times of the four algorithms for solving the Helmholtz equation (2.3) on the sphere. FFTPACK, developed by Swarztrauber and Sweet, is used to compute the discrete Fourier transforms in the algorithms Fourier Ia n d Fourier II, while SPHEREPACK, developed by Swarztrauber and Adams, is used to compute the discrete spherical harmonic transforms. For the spherical harmonic algo- rithm, (N3) values of the associate Legendre polynomials need to be precomputed and stored. The CPU times for the precomputation are listed in parentheses. The two algorithms using double Fourier series are signi cantly more ecient than that using spherical harmonics; e.g., a factor of about 30 (taking into account the precom- putation) is observed with N =M = 256. They are also considerably more ecient than the nite di erence code while providing exponential convergence as opposed to the second-order convergence of the nite di erence method. For applications in nonlinear and/or time dependent problems, it is important that the spherical gradient of the solution r su =( u; u sin )t is approximated with a desirable accuracy. Althoughrsu is not necessarily de ned for u2YNM ,w ec a nu s e , in the algorithm Fourier I,rs(NM uNM ) (see (2.37)) as the approximation to rsu. In Table 2.5, we list the l2 errors forrsu by using Fourier I and Fourier II applied 1448 JIE SHEN Table 2.4 CPU time (in second) for the Helmholtz solvers on the sphere. N =M 32 48 64 96 128 192 256 sph har 6.2E-3 1.7E-2 3.7E-2 .12 .28 1.19 3.06 (pre comp) (2.5E-2) (7.0E-2) (.15) (.45) (1.18) (3.85) (9.02) Fourier I 6.6E-3 1.4E-2 2.3E-2 5.3E-2 9.0E-2 .24 ..42 Fourier II 7.1E-3 1.5E-2 2.4E-2 6.0E-2 .11 .27 .46 FISHPACK 6.8E-3 3.1E-2 6.9E-2 .13 .27 .65 1.22 Table 2.5 Comparison of the l2 errors forrsu =(u; u sin )t. N =M 20 24 32 36 40 Fourier I 2.81E-2 5.31E-4 1.13E-8 1.44E-11 3.54E-14 Fourier II 2.82E-2 5.32E-4 1.12E-8 1.40E-11 3.91E-14 to (2.3) with = 0. We nd that both algorithms o er essentially the same accuracy forrsu. Thus, by applying the projector NM whenever needed, we believe that the algorithm Fourier I is as widely applicable as the algorithm Fourier II. We emphasize that the main purpose of this comparison is not to determine which algorithm is better, but rather to support the view that nonessential pole conditions in (2.12) can be safely ignored. 3. Extensions. As indicated previously (cf. [14, 17]), elliptic problems with vari- able coecients can be eciently solved by using a conjugate gradient-type iterative method with a spectrally equivalent operator associated to a constant coecient prob- lem as a preconditioner. Below, we provide details on how to treat vector equations and problems in spherical layers. 3.1. Vector equations. In many physical applications, one often needs to solve vector equations in spherical geometries. Consider, for instance, the vector Poisson equation on the unit sphere in spherical coordinates r 2 u1 u2 := r2 1 sin2 ; 2c o s sin2 @ @ 2c o s sin2 @ @ ; r2 1 sin2 ! u1 u2 = f1 f2 ;(3.1) where (u1;u 2)a n d(f1;f 2) are vectors in spherical coordinates and r2 := 1 sin @ @ (sin @ @ )+ 1 sin2 @2 @ 2(3.2) is the scalar Laplace operator in spherical coordinates. The diculty here is that the uncoupled vector Poisson equation in Cartesian coordinates now becomes coupled in spherical coordinates. One may use, of course, the so-called vectorial spherical harmonics (cf. [11, 18]) which are the eigenfunctions of the operator r2. However, in addition to the inevitable expensive transforms, the implementation task with vectorial spherical harmonics can be formidable. In order to be able to use double Fourier series, one can rst decouple the system (3.1) by applying the transform ~u 1 ~u2 = sin ; cos cos ; sin u1 u2 and ~f1 ~f2 = sin ; cos cos ; sin f1 f2 :(3.3) Then the system (3.1) is reduced to r2 ~u1 = ~f1 and r2 ~u2 = ~f2;(3.4) EFFICIENT SPECTRAL-GALERKIN METHODS IV 1449 which can be solved by using double Fourier series as in section 2 or by using scalar spherical harmonics. The three-dimensional (3D) case can be handled in a similar way. We refer to Appendix B in [13] for more details on how to decouple the 3D vector equations in spherical coordinates. 3.2. Elliptic equations in a spherical layer. We consider again the model Helmholtz equation U U =F in =f(x;y;z ): R 1 <x 2 +y2 +z2 <R 2g; Uj@ =0:(3.5) Applying the spherical transformation x =r sin cos ; y=r sin sin ; z=r cos(3.6) to (3.5), and setting u(r;; )= U(x;y;z ), f(r;; )= F (x;y;z ), we obtain u 1 r2@r(r2@ru) 1 r2 sin@(sin@u) 1 r2 sin2@ u =f; (r;; )2 (R1;R 2) (0; ) [0; 2); u =0 a t r =R1 (if R16=0 )a n dr =R2: (3.7) Below, we present two approaches; one is based on spherical harmonics and the other on double Fourier series. 3.2.1. Using spherical harmonics. Let Ylm(; )= Pm l (cos)eim be the spherical harmonics function of index (l;m ); we can write u(r;; )= 1X l=0 jmjl ulm(r)Ylm(; ) (and likewise for f). Then, thanks to the property [5] LYlm := 1 sin@(sin@Ylm) 1 sin2@ Ylm =l(l +1 )Ylm;(3.8) we nd, after multiplying (3.7) by r2 (this is a natural process since r2 sin is the Jacobian of the spherical transform), that (3.7) reduces to ur2 lm (r2u0 lm)0 +l(l +1 )ulm =r2flm; 0jmj l< 1; ulm(R1)=0i f R16=0;u lm(R2)=0 :(3.9) Since the interval [R1;R 2]c a nb em a p p e dt o[ 1; 1] by using the transform r = R2 R1 2 (t + )w i t h = R2 +R1 R2 R1 1;(3.10) we have only to consider the following prototypical one-dimensional problem: (t + )2u ((t + )2u0)0 + u =(t + )2f; u( 1) = 0 if > 1; u(1) = 0:(3.11) 1450 JIE SHEN Let PK be the space of polynomials of degree less than or equal to K,a n dl e t ZK =ZK ( ): =fv2PK : v( 1) = 0 if > 1;v (1) = 0g:(3.12) Then the weighted spectral-Galerkin approximation to (3.11) is to nd uK 2ZK such that ((t + )2uK;v! )+( (t + )2u0 K; (v!)0)+ (uK;v! ) =( (t + )2JKf;v! ) 8v2ZK; (3.13) where ! 1 in the Legendre case and !(t)=( 1 t2) 1 2 in the Chebyshev case, (u;v )= R 1 1uvdt,a n dJK is the operator of interpolation based on the Legendre or Chebyshev Gauss{Lobatto points. Let k(t);k =0; 1;:::;K I be a set of basis function for ZK ,w h e r eI =1i f = 1 while I =2i f > 1. We set qkj = Z 1 1 (t + )2 j k !dt; Q =(qkj ); rkj = Z 1 1 (t + )2 0 j ( k!)0dt; R =(rkj ); skj = Z 1 1 j i!dt; S =(skj ); fj = Z 1 1 JKf j !dt; f =(fj); uN = N 2X i=0 xj j (t); x =(xj ): (3.14) Then (3.13) becomes the matrix equation ( Q +R + S)x =f:(3.15) The eciency of the method depends on the choice of the basis functions which, in turn, determine the matrices Q, R,a n dS. To simplify the notation, we will only consider the case R1 > 0 (i.e., > 1). The case R1 = 0 (i.e., = 1) can be treated similarly. We present below three di erent ways to implement (3.13). Legendre{Galerkin.I n t h i s c a s e , w e s e t! =1a n d j(t)= Lj(t) Lj+2(t). By using the identities 0 i(t)= (2i +3 )Li+1(t);(3.16) (i +1 )Li+1(t)=( 2i +1 )tLi(t) iLi 1(t);(3.17) i(t)= 2i +3 (i +1 ) (i +2 )(1 t2)L0 i+1(t);(3.18) one can readily derive that Q, R,a n dS are positive de nite symmetric ma- trices with qij =0f o r ji jj > 4, rij =0f o r ji jj > 2, and sij =0 for j6= i;i 2. Their nonzero entries are given in Appendix A. The draw- back of this approach is that no fast Legendre transform is available. The Chebyshev{Legendre Galerkin method presented below is designed to over- come this shortcoming. EFFICIENT SPECTRAL-GALERKIN METHODS IV 1451 Chebyshev{Legendre Galerkin. In this case, we use the Legendre formulation with ! =1a n d j (t)= Lj(t) Lj+2(t), but we de ne the interpolation op- erator JK based on the Chebyshev Gauss{Lobatto points. Then (3.13) leads to a symmetric banded system with small bandwidth, while the transforma- tion between function values at the Chebyshev Gauss{Lobatto points and the coecients of its Legendre expansion can be done with quasi-optimal computational complexity (cf. [1, 16]). Chebyshev{Galerkin.W e s e t ! =( 1 t 2) 1 2 and j(t)=( 1 t2)Tj(t). It c a nb ee a s i l ys h o w nt h a tQ and S are positive de nite symmetric matrices with qij =0f o rji jj> 6, sij =0f o rji jj> 4a n dji jj odd. Although R is nonsymmetric, it can be shown that R is banded with rij =0f o r i 4ji + 4. Indeed, it is easy to see that rij = Z I (t + )2 0 j 0 (1 t2)Ti!dt =0 f o r i>j +4: On the other hand, thanks to identity!0(t)= t!3(t) and integration by parts, rij = Z I (t + )2 0 j (1 t2)Ti! 0 dt = Z I (t + )2 0 j ((1 t2)Ti)0 +tTi !dt = Z I 0 jPi+3!dt = Z I Tj(1 t2)(Pi+3!)0dt = Z I Tj (1 t2)P0 i+3 +tPi+3 !dt = Z I TjPi+4!dt; wherePi+3 (resp., Pi+4) is a polynomial of degree less than or equal to i +3 (resp., i + 4). Hence, rij =0f o r j>i +4: Although it is very tedious to determine their nonzero entries by hand, one can easily compute them by using appropriate Gaussian quadratures. The details are left to the interested readers. The main advantage of the Cheby- shev method is the availability of the fast Chebyshev transform. Beside the tedious process involved in evaluating the nonzero entries of Q, R,a n dS, the nonsymmetry of R may introduce additional diculties when iterative methods are needed for problems with variable coecients. A performance comparison of the three methods in a di erent context can be found in [16]. Remark 3.1. In case R 1 =0( i:e:; =1 ), the appropriate basis functions are j(t)= Lj(t) Lj+1(t) in the Legendre case and j (t)=( 1 t)Tj(t) in the Chebyshev case. Higher-order equations can be solved in a similar fashion. For instance, by using the expansion in spherical harmonics, the biharmonic equation would be reduced to a set of one-dimensional fourth-order equations which can be solved eciently by using a spectral-Galerkin method (see [17] for a similar case ). 3.2.2. Using double Fourier series. Since u is periodic in ,w em a yw r i t e u = 1X jmj=0 ~um(r; )eim ; 1452 JIE SHEN and likewise for f. Then (3.7) becomes ~um 1 r2@r(r2@r ~um) 1 r2 sin@(sin@ ~um)+ m2 r2 sin2 ~um = ~fm; ~umj@ ~D =0; ~D := (R1;R 2) (0; ): (3.19) Applying again the transform (3.10) and multiplying by r2 sin2, (3.19) becomes 2(t + )2 sin2um sin2@t((t + )2@tum) sin@(sin@um) +m2um = 2(t + )2 sin2fm; in D := ( 1; 1) (0; ); umj@D =0; (3.20) w h e r ew eh a v es e t = R2+R1 R2 R1 , = R2 R1 2 , r = (t + ), um(t)=~ um(r), and fm(t)= ~fm(r). As before, we only have to consider the approximation of (3.20), where fm and um are real functions. We now describe a spectral-Galerkin scheme for (3.20). We shall look for an approximation of um in the tensor-product space X(m) NK :=Y (m) N ZK or alternatively X(m) NK :=Z(m) N ZK;(3.21) where Y (m) N ,Z(m) N and ZK are de ned, respectively, in (2.13), (2.26), and (3.12). Let ! =!(t) be the weight function associated with the Legendre or Chebyshev polynomials and INMK := INM JK be the 3D interpolation operator, where INM is de ned in section 2.1 and JK is the interpolation operator associated with the Legendre or Chebyshev Gauss{Lobatto points in [ 1; 1]. We write INMK f = MX jmj=0 f(m) NK (;t )eim ; with f(m) NK 2X(m) NK: Then the weighted spectral-Galerkin method for (3.20) is to nd u(m) NK 2 X(m) NK such that 2 (t + )2 sin2u(m) NK ;v! sin2@t((t + )2@tu(m) NK );v! sin@(sin@u(m) NK );v! +m2 u(m) NK ;v! = 2 (t + )2 sin2f(m) NK ;v! 8v2X(m) NK ; (3.22) where (u;v )= R 1 1dt R 0 uvd. If we denote u(m) NK = X k;j u(m) kj (m) k () j (t);U (m) =(u(m) kj ); f(m) kj = (t + )2 sin2f(m) NK ; (m) k () j (t)! ;F (m) =(f(m) kj ); with k = ( 1; 2;:::;N 1 m6=0 0; 1;:::;N m =0 ;j =0; 1;:::;K 2; (3.23) then (3.22) is equivalent to the following matrix system: 2A(m)U(m)Q +A(m)U(m)Rt +B(m)U(m)S +m2C(m)U(m)S = 2F(m);(3.24) EFFICIENT SPECTRAL-GALERKIN METHODS IV 1453 where the matrices A(m),B(m),a n dC(m) are de ned in (2.31){(2.32), and Q,R,a n d S are de ned in (3.14). We recall that A(m), C(m), Q,a n dS are symmetric, B(m) is nonsymmetric, and R is symmetric in the Legendre case and nonsymmetric in the Chebyshev case. Since (3.24) is derived from the discretization of the separable elliptic equation (3.19), it can be solved by using the matrix diagonalization method which is, in fact, a discrete counterpart of separation of variables. To this end, we rst solve the generalized eigenvalue problem ( 2Q +R)G =SG (i.e.;G t( 2Q +Rt)= GtS);(3.25) where = diag(0; 1;:::; K 2)a n dG is formed by the eigenfunctions. Note that the ellipticity of the equation ensures that all the eigenvalues are real and positive even in the Chebyshev case when R is nonsymmetric. Making the transform U(m) =V (m)Gt in (3.24) and using (3.25), we nd A(m)V (m)GtS +(B(m) +m2C(m))V (m)GtS =F(m):(3.26) Therefore, A(m)V (m)+( B(m) +m2C(m))V (m) =F(m)S 1G t := ~F(m):(3.27) Let v(m) j and ~f (m) j be, respectively, the jth column of V (m) and ~F(m). Then, the above equation splits up into a sequence of one-dimensional equations, (jA(m) +B(m) +m2C(m))v(m) j = ~f (m) j ;j =0; 1;:::;K 2;(3.28) which can be solved in O(NK ) operations. Hence, neglecting the preprocessing cost for computing G and , the cost of solving (3.24) is dominated by the two ma- trix multiplications U(m) =V (m)Gt and (F(m)S 1)G t, which require about 2K2N ops. Again, one can use three di erent approaches, namely, Legendre{Galerkin, Chebyshev{Galerkin, and Chebyshev{Legendre Galerkin, for the discretization of the vertical variable. Although the operation count of this algorithm is not optimal, but since in most applications the vertical scale is much smaller than the horizontal scales so thatK can be chosen to be much smaller than N, this algorithm is still very competitive, thanks to the fast Fourier transform, when compared with the algorithm using spherical harmonics. The question of which algorithm is superior will depend on, among others, the size of the problem, computer platform, and availability of machine coded BLAS or FFT. Remark 3.2. Elliptic problems in the unbounded domain = f(x;y;z ): R 1 < x2 +y2 +z2g can be handled in a similar fashion by discretizing the radial direction using Laguerre polynomials, if the solution decays exponentially at in nity (cf. [9]), or mapped Chebyshev or Legendre functions (cf. [3]). 4. Concluding remarks. We have presented several fast algorithms for elliptic equations in spherical geometries by using double Fourier series for the horizontal variables and Chebyshev or Legendre polynomials for the vertical variable. Our al- gorithms for elliptic problems on the sphere have quasi-optimal (optimal up to a logarithmic term) computational complexity as well as optimal error estimates. We have performed numerical experiments which indicate that our algorithms are signif- icantly more ecient and/or accurate when compared with the algorithms based on 1454 JIE SHEN spherical harmonics and on nite di erence. The numerical experiments also con rm that nonessential pole conditions can be safely ignored, at least for steady problems, in agreement with the arguments in [12] and [2]. For time dependent problems, it is also generally believed that ignoring nonessential pole conditions will not lead to unreasonable time step restrictions as long as the principle elliptic operator is treated implicitly [12]. It is hoped that this paper will help to revive researchers' interests in using double Fourier series for elliptic or parabolic type equations in spherical geometries. Appendix A. The nonzero entries of Q, R,a n d S. Let Q, R,a n dS be de ned in (3.14) with ! 1a n d j(t)= Lj(t) Lj+2(t). Then, their nonzero entries are qkj =qjk := Z I (t + )2 j kdt = 8 >> > > > > > >>> > > > > > > > > >>< >> > >>> > > > > > > > > >>> > > > : 2(j +3 ) (j +4 ) (2j + 5)(2j + 7)(2j +9 ) ;k =j +4 ; 2 2(j +3 ) (2j + 5)(2j +7 ) ;k =j +3 ; 2(j +2 ) (2j + 1)(2j +5 )2 2(j +3 ) (2j + 9)(2j +5 )2 2 2 2j +5 ;k =j +2 ; 2 2 (2j + 1)(2j +5 ) + 2(j +3 ) (2j + 5)(2j +7 ) ;k =j +1 ; 2j2 (2j +1 )2(2j 1) + 2(2j +3 ) (2j +1 )2(2j +5 )2 ;k =j; + 2(j +3 )2 (2j +5 )2(2j +7 ) + 2 2 2j +1 + 2 2j +5 ; rkj =rjk := Z I (t + )2 0 j 0 k dt =( 2j + 3)(2k +3 ) Z I (t + )2Lj+1Lk+1dt = 8 >> > > > < >> > > > : 2(j +2 ) (j +3 ) 2j +5 ;k =j +2 ; 4 (j +2 );k =j +1 ; 2(j +2 )2 2j +5 + 2(j +1 )2 2j +1 +2 2(2j +3 );k =j; skj =sjk := Z I j kdt = 8 >> < >> : 2 2j +5 ;k =j +2 ; 2 2j +1 + 2 2j +5 ;k =j: EFFICIENT SPECTRAL-GALERKIN METHODS IV 1455 REFERENCES [1] B. K. Alpert and V. Rokhlin , A fast algorithm for the evaluation of Legendre expansions , SIAM J. Sci. Stat. Comput., 12 (1991), pp. 158{179. [2] J. P. Boyd , The choice of spectral functions on a sphere for boundary and eigenvalue prob- lems: A comparison of Chebyshev, Fourier and associated Legendre expansions ,M o n t h l y Weather Rev., 106 (1978), pp. 1184{1191. [3] J. P. Boyd , Orthogonal rational functions on a semi-in nite interval ,J .C o m p u t .P h y s . ,7 0 (1987), pp. 63{88. [4] J. P. Boyd, Chebyshev and Fourier Spectral Methods , Springer-Verlag, New York, 1989. [5] R. Courant and D. Hilbert, Methods of Mathematical Physics ,V o l .1 ,I n t e r s c i e n c eP u b l i s h - ers, New York, 1953. [6] J. R. Driscoll and D. M. Healy , Computing fourier transforms and convolutions on the 2-sphere, Adv. in Appl. Math., 15 (1994), pp. 202{250. [7] B. Fornberg , A pseudospectral approach for polar and spherical geometries ,S I A MJ .S c i . Comput., 16 (1995), pp. 1071{1081. [8] B. Fornberg , A Practical Guide to Pseudospectral Methods , Cambridge University Press, London, 1996. [9] Y. Maday, B. Pernaud-Thomas, and H. Vandeven , Reappraisal of Laguerre type spectral methods, Rech. Aerospat., 6 (1985), pp. 13{35. [10] M. J. Mohlenkamp, A Fast Transform for Spherical Harmonics, Ph.D. thesis, Yale University, New Haven, CT, 1997. [11] P. M. Morse and H. Feshback , Methods of Theoretical Physics , McGraw-Hill, New York, 1953. [12] S. A. Orszag, Fourier series on spheres , Monthly Weather Rev., 102 (1974), pp. 56{75. [13] L. Quartapelle , Numerical Solution of the Incompressible Navier-Stokes Equations , Birkhauser, Boston, Cambridge, MA, 1993. [14] J. Shen, Ecient spectral-Galerkin method I. Direct solvers for second- and fourth-order equa- tions by using Legendre polynomials , SIAM J. Sci. Comput., 15 (1994), pp. 1489{1505. [15] J. Shen , Ecient spectral-Galerkin method II. Direct solvers for second- and fourth-order equations by using Chebyshev polynomials , SIAM J. Sci. Comput., 16 (1995), pp. 74{87. [16] J. Shen, Ecient Chebyshev-Legendre Galerkin methods for elliptic problems , in Proceedings of the ICOSAHOM'95, Houston J. Math., (1996), pp. 233{240. [17] J. Shen , Ecient spectral-Galerkin methods III. Polar and cylindrical geometries ,S I A MJ . Sci. Comput., 18 (1997). [18] P. N. Swarztrauber , The approximation of vector functions and their derivatives on the sphere, SIAM J. Numer. Anal., 18 (1981), pp. 191{210. [19] P. N. Swarztrauber and R. A. Sweet, Ecient FORTRAN subprograms for the solution of elliptic partial di erential equations , ACM Trans. Math. Software, 5 (1979), pp. 352{364. [20] S. Y. K. Yee , Solution of Poisson's equation on a sphere by truncated double Fourier series , Monthly Weather Rev., 109 (1981), pp. 501{505.
采集于
查看校方原文 ↗