Scientific Computation EditorialBoard J.-J.Chattot,Davis,CA,USA P.Colella,Berkeley,CA,USA WeinanE,Princeton,NJ,USA R.Glowinski,Houston,TX,USA M.Holt,Berkeley,CA,USA Y.Hussaini,Tallahassee,FL,USA P.Joly,LeChesnay,France H.B.Keller,Pasadena,CA,USA J.E.Marsden,Pasadena,CA,USA D.I.Meiron,Pasadena,CA,USA O.Pironneau,Paris,France A.Quarteroni,Lausanne,Switzerland andPolitecnicoofMilan,Italy J.Rappaz,Lausanne,Switzerland R.Rosner,Chicago,IL,USA P.Sagaut,Paris,France J.H.Seinfeld,Pasadena,CA,USA A.Szepessy,Stockholm,Sweden M.F.Wheeler,Austin,TX,USA C. Canuto M. Y. Hussaini A. Quarteroni T. A. Zang Spectral Methods Fundamentals in Single Domains With106Figuresand19Tables 123 ClaudioCanuto M.YousuffHussaini DipartimentodiMatematica SchoolofComputationalScience PolitecnicodiTorino FloridaStateUniversity CorsoDucadegliAbruzzi,24 Tallahassee,FL32306-4120,USA 10129Torino,Italy e-mail:[email protected] e-mail:[email protected] AlfioQuarteroni ThomasA.Zang,Jr. SB-IACS-CMCS,EPFL NASALangleyResearchCenter* 1015Lausanne,Switzerland MailStop449 and Hampton,VA23681-2199,USA MOX,PolitecnicodiMilano e-mail:[email protected] PiazzaLeonardodaVinci,32 20133Milano,Italy e-mail:alfio.quarteroni@epfl.ch *ThisdoesnotconstituteanendorsementofthisworkbyeithertheU.S.GovernmentortheNASA LangleyResearchCenter. Coverpicture:SeeFig.4.4(left) LibraryofCongressControlNumber:2006922326 ISSN 1434-8322 ISBN-10 3-540-30725-7 SpringerBerlinHeidelbergNewYork ISBN-13 978-3-540-30725-9 SpringerBerlinHeidelbergNewYork Thisworkissubjecttocopyright.Allrightsarereserved,whetherthewholeorpartofthematerialisconcerned, specificallytherightsoftranslation,reprinting,reuseofillustrations,recitation,broadcasting,reproductionon microfilmorinanyotherway,andstorageindatabanks.Duplicationofthispublicationorpartsthereofispermitted onlyundertheprovisionsoftheGermanCopyrightLawofSeptember9,1965,initscurrentversion,andpermission forusemustalwaysbeobtainedfromSpringer.ViolationsareliabletoprosecutionundertheGermanCopyrightLaw. SpringerisapartofSpringerScience+BusinessMedia springer.com ©Springer-VerlagBerlinHeidelberg2006 PrintedinGermany Theuseofgeneraldescriptivenames,registerednames,trademarks,etc.inthispublicationdoesnotimply,evenin theabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevantprotectivelawsandregulationsand thereforefreeforgeneraluse. Typesetting:Camera-readycopyfromtheauthors DataconversionandproductionbyLE-TEXJelonek,Schmidt&VöcklerGbR,Leipzig,Germany Coverdesign:ErichKirchnerHeidelberg Printedonacid-freepaper SPIN:11584711 55/3100/YL-543210 Preface As a tool for large-scale computations in fluid dynamics, spectral methods were originally proposed in 1944 by Blinova, first implemented in 1954 by Silberman, virtually abandoned in the mid-1960s, resurrected in 1969–70 by Orszag and by Eliason, Machenhauer and Rasmussen, developed for special- ized applications in the 1970s, endowed with the first mathematical foun- dations by the seminal work of Gottlieb and Orszag in 1977, extended to a broader class of problems and thoroughly analyzed in the 1980s, and en- tered the mainstream of scientific computation in the 1990s. Two decades ago when we wrote Spectral Methods in Fluid Dynamics (1988) both the subject and the authors were barely past their adolescence. As the field and the authors are now in their middle age, the time seems ripe for a more mature discussion of the field, accounting for the main contributions of the intervening years. Motivated by the many favorable comments we have re- ceivedand the continuing interest in the first book (which will be referred to asCHQZ1),yetdesiringtopresentamoremodernperspective,weembarked on a project which has resulted in this book (referred to as CHQZ2) and itscompanionbook(Canuto,Hussaini,QuarteroniandZang(2007),referred to as CHQZ3). These, like our first text on this subject, are books about spectral methods for partial differential equations – when to use them, how to implement them, and what can be learned from their rigorous theory. The original promoters of spectral methods were meteorologists study- ing global weather modeling and fluid dynamicists investigating isotropic turbulence. The converts who were inspired by the successes of these pio- neersremained,forthemostpart,confinedtotheseandcloselyrelatedfields throughout the 1970s. During that decade spectral methods appeared to be well-suited only for problems governed by ordinary differential equations or by partial differential equations with (mostly) periodic boundary conditions. And, of course, the solution itself needed to be smooth. Both the theory and the algorithms of classical (single-domain) spectral methods for smooth problems were already reasonably mature in the mid- 1980s. On the theoretical side, approximation theory results were available for periodic and nonperiodic problems, stability and convergence analyses were in-hand for steady and unsteady linear problems, and detailed numer- ical analyses had been produced for a variety of methods for fluid dynam- VI Preface ics applications, and particularly for the incompressible Navier-Stokes equa- tions. Open issues included discontinuous problems (with compressible flows of particular interest), convergence analysis of iterative methods, artificial outflow boundary conditions, and rigorous analysis of time discretizations. On the algorithms front, explicit methods for fully periodic problems were routine,efficientdirectsolutionmethodswereavailableforseveralimportant constant-coefficient implicit equations, numerous efficient algorithms were available for incompressible flows with at most one nonperiodic direction, and shock-fitting methods had been developed for compressible flows. Nu- merous approaches were being tried for discontinuous problems, especially for shock capturing in compressible flows. Rapid developments were taking place in iterative methods for implicit equations. The extension of spectral methods to problems in complex geometries through multidomain spectral approaches was proceeding explosively. Singular progress has indeed been made over the past two decades in ex- tendingspectralmethodstoarbitrarygeometries,enablingwhatsomewould considerthemathematicalnirvanaofamethodofarbitrarilyhighordercap- ableofapplicationtoproblemsonanarbitrarygeometry.Inthisrespect,the trajectory of spectral methods over the past 20 years has been converging towards that of hp finite-element methods. This process of migration from single-domain to multidomain spectral methods has required the injection of novel mathematical tools, and stimu- lated original investigation directions. Mathematics has had a profound im- pact on the correct design and interpretation of the methods, and in some casesithasinspiredthedevelopmentofdiscontinuousspectralmethods(such asthemortarmethodandthediscontinuousGalerkinmethod)evenforprob- lemswithcontinuoussolutions.Ontheotherhand,sinceingeneralageomet- rically complex computational domain is split into polygonal or polyhedral subdomains (or elements), tensor-product domains are no longer a prerequi- siteforspectralmethods,withthedevelopmentofspectralbasesontriangles and tetrahedra. Oneofthemostpronouncedchangesisthatthestrongformofdifferential equationshaslostitsprimacyastheanchorforthediscretizationoftheprob- lem.Multidomain spectralmethodsaremoreeasilyandreliablyapproached, both algorithmically and theoretically, from weak formulations of the differ- ential equations. Moreover, the use of many subdomains has motivated the use of moderate polynomial degrees in every subdomain – small from the perspective of classical spectral methods, but large from the perspectives of finite-difference and finite-element methods. From a theoretical viewpoint, new error estimates have been established for which the roles of the local polynomial degree and the geometrical size of the local elements are both captured. From an algorithmic point of view, the role of matrices has been addressedingreatdetail,correspondingtotheincreasedinterestinsmalland moderate values of N and on techniques of matrix assembly. Exploitation of Preface VII advanced linear algebra tools for sparse, ill-conditioned systems has become of paramount importance. Inspiteofthismajorchangeofperspective,thenewmultidomainspectral methodsstillenjoysomeofthemostdistinguishing(anddesirable)featuresof “classical”spectralmethods–Gaussianintegrationformulas,lowdispersion, and ease of preconditioning by low-order discretization matrices. Over the past twenty years the appeal of spectral methods for applica- tions such as computational fluid dynamics has expanded, commensurate with the erosion of most of the obstacles to their wider application. Beyond the specific techniques, the culture of high-order methods has entered the background knowledge of numerical analysts. Spectral methods have been traditional in academic instruction since the 1990s and began to penetrate industrial applications this decade. In fact, spectral methods are successfully usednowadaysforwidelydiverseapplications,suchaswavepropagation(for acoustic, elastic, seismic and electromagnetic waves), solid and structural analysis, marine engineering, biomechanics, astrophysics, and even financial engineering.Theirprincipalappealintheacademicresearchenvironmentstill reliesontheirsuperiorrateofconvergence,whichmakesthemanidealvirtual lab.Intheindustrial(extra-academic)environment,spectral-basedcodesare appreciated, andoften preferred,owingtothe low dissipation and dispersion errors,theneatwaytotreatboundaryconditions,and,today,theavailability ofefficientalgebraicsolversthatallowafavorabletrade-offbetweenaccuracy and computational cost. The basics of classical spectral methods remain essential for current re- search on the frontiers of both the algorithms and the theory of spectral methods.Atthesametime,multidomainspectralmethodshavealreadywar- rantedbooksintheirownright.Ourobjectiveswiththecurrenttwobooksare to modernize our thorough discussion of classical spectral methods, account- ing for advances in the theory and more extensive application experience in the fluid dynamics arena, while summarizing the current state of multido- main spectral methods from the perspective of classical spectral methods. Themajormethodologicaldevelopmentsinclassicalspectralmethodsduring the past two decades have been the emergence of the Galerkin with numer- ical integration (G-NI) approach, the decline of the tau method to a niche role,improvedtreatmentofboundaryconditions,theadaptationofadvanced direct and iterative methods to spectral discretizations also thanks to a bet- ter insight into the mathematical basis of preconditioning, the development of more sophisticated tools to control spurious high-frequency oscillations without losing the formal accuracy of the method, and the formulation of spectral discretizations on triangles (in two dimensions) and tetrahedra (in three dimensions). From the applications perspective in fluid dynamics, new algorithms have been produced for compressible linear and secondary stabil- ity, for parabolized stability equations, for velocity-vorticity formulations of incompressible flow,and forlarge-eddysimulations, alongwith refinementof VIII Preface spectral shock-fitting methods. Moreover, the once intense debate over the impact of aliasing errors has settled down to polite differences of opinion. While asignificant amountofmaterialinthetwonewbooks has beenre- tainedfromportionsofourearliertext,CHQZ1,themajorityofthematerial is new. The most consistent augmentation is that all chapters are enhanced by the addition of material for the G-NI method. The added material has necessitated publishing this new work as two separate books. The rationale for the division of the material between the two books is that we furnish in this first book, CHQZ2, a comprehensive discussion of the generic aspects of classical spectral methods, while the second book, CHQZ3, focuses on applications to fluid dynamics and on multidomain spectral methods. Chapters 1–4 of the present book are of general interest. Chapter 1 pro- vides a motivational introduction to spectral methods, as well as a preview of the more sophisticated single-domain applications in fluid dynamics pre- sentedinthesecondbook.Chapter2containsathoroughdiscussionofclassi- cal orthogonal expansions, supplemented with a basic description of spectral approximationsontrianglesandtetrahedra.Chapter3providesacomprehen- siveguidetospectraldiscretizationsinspaceforpartialdifferentialequations in one space dimension, using the Burgers equation model problem for illus- trative purposes. A discussion of boundary conditions for hyperbolic equa- tions, and detailed prescriptions for the construction of mass and stiffness matrices for elliptic problems are also given. Chapter 4 focuses on solution techniques for the algebraic systems generated by spectral methods. In ad- dition to a number of now classical results, the chapter offers a thorough investigation of modern direct and iterative methods, as befits the extensive developments that have transpired in the past two decades. A large number of original numerical examples are presented in these two chapters. Chap- ters 5–7 focus on the mathematical theory of classical spectral methods. Chapter 5 consists of a review of those results from approximation theory which are pertinent to the theoretical analysis of spectral methods. Most of them are classical; however a few of them are newer, as they highlight the dependence on both polynomial degree and geometrical parameters for both tensor-product domains and simplicial domains (triangles and tetrahedra). Chapter 6 is the focal point of this book regarding the theory of spectral methods. The fundamental stability and convergence results are established forallkindsofnumericalspectralapproximations(Galerkin,tau,collocation, and G-NI) to linear partial differential equations, both steady and unsteady. Finally, Chap. 7 addresses the theoretical analysis of spectral approxima- tions to a family of partial differential equations that can be regarded as the building blocks of mathematical modelling in continuum mechanics in general, and in fluid dynamics in particular. It places particular emphasis on the Poisson equation, singularly perturbed elliptic equations that govern advection-diffusion and reaction-diffusion processes featuring sharp bound- ary layers, the heat equation, hyperbolic equations and systems, and the Preface IX steady Burgers equation. Moreover, it addresses the eigenvalue analysis of matrices produced by spectral approximations, and illustrates recent tech- niques to resolve the Gibbs phenomenon for discontinuous solutions through filtering, singularity detection and spectral reconstruction techniques. The first book ends with four Appendices surveying several algorithmic and the- oretical numerical analysis topics that are not specific to spectral methods, but of sufficient utility to some readers to warrant inclusion. In Appendix A we review some basic notations and theorems from functional analysis. Appendix B reviews the fast Fourier transform and some adaptations that are particularly useful to Fourier and Chebyshev methods. Appendix C is a gentle introduction to iterative methods and lists several specific iterative algorithms that have been exploited in spectral methods, while Appendix D describes some basic concepts, specific numerical schemes, and stability re- gionsforthosetemporaldiscretizationsthathavebeenfavoredbythespectral methods community. In our second book (Canuto, Hussaini, Quarteroni and Zang (2007)), Chap. 1 covers the basic equations of fluid mechanics. Chapter 2 is solely devoted to spectral algorithms for analyses of linear and nonlinear stability offluid flows.Applications tocompressible flows andtoparabolized stability equations post-date our earlier book. Chapter 3, on algorithms for incom- pressible flows, has a sharp emphasis on those algorithms that remained in reasonablyextensiveusepost-1990andprovidesamoderndiscussionofsolu- tion techniques for problems with twoormorenonperiodic directions. Chap- ter 4, on algorithms for hyperbolic systems and compressible flows, empha- sizes algorithms for enforcing boundary conditions, methods for computing homogeneous,compressibleflows,andanimprovedapproachtoshockfitting. Chapter 5 introduces the main strategies to construct spectral approxima- tionsincomplexdomains,andinparticularthespectral-elementmethod,the mortar-elementmethod,thespectraldiscontinuous Galerkinmethod,aswell as the more traditional patching collocation method. Their theoretical prop- erties are analyzed, and their algebraic aspects are investigated. Chapter 6 illustrates solution strategies based on domain decomposition techniques for the spectral discretizations investigated in Chap. 5. Both Schur-based and Schwarz-basediterativesolversandpreconditionersareconsidered,andtheir computationaladvantages(inparticular,theirpropertyofscalabilitywithre- specttothenumberofsubdomains) areillustrated.Ourprojectclosesinthe same manner in which it began, with a survey of representative large-scale applications of (this time multidomain) spectral methods. Whereas with our first text we made a valiant effort to provide compre- hensivecoverageofallavailablespectralmethods(atleastforfluiddynamics applications) and to provide a bibliography that encompassed all extant ref- erences to spectral methods, here we acknowledge the practical impossibility ofsuchanambitioninthefaceofalltheworkthathassincetranspiredinthe field.Westillaimtoprovidecomprehensivecoverageofgeneralmethodology. X Preface However, our coverage of particular algorithms is necessarily representative rather than complete. Our aim is to focus on those algorithms that have stood the test of time in fluid dynamical applications, as assessed by how widely they have been used in the past two decades. But our knowledge in this area is certainly not exhaustive, and others would no doubt have made somewhatdifferentchoices.Inourcitationsweenforceastrongpreferencefor archivalpublications.Werecognizethatmanydevelopmentsappearedearlier (in some cases many years earlier) in pre-prints or conference publications. Butweonly citenon-archival sourceswhennoarchivalreferenceis available. Themanynumericalexamplesproducedexpresslyforthesebookshaveall been run on desktop computers (under both Linux and Macintosh operating systems), usually in 64-bit arithmetic with the standard IEEE precision of 2−52 ≈2×10−16.Ahalf-dozenorsodifferentcomputerswereemployed,with clockspeedsontheorderof1–3GHz;someofthesecomputershadtwoCPUs. The workhorse languages were Matlab and Fortran, with no special effort devotedtofine-tuningtheperformanceofthecodes.Thereaderwillcertainly appreciate that the occasional timings presented here are meant solely to provide a rough comparison between the costs of alternative algorithms and should not be construed as representing a definitive verdict on the efficiency of the methods. Nowadays, considerable software for spectral methods is freely available on the web, ranging from libraries of basic spectral operations all the way to complete spectral codes for Navier-Stokes (and other complex) applications. Due to the highly dynamic nature of these postings, we have chosen not to list them in the text (except to acknowledge codes that we have used here for numerical examples), but to maintain a reasonably current list of such sources on the Web site (http://www.dimat.polito.it/chqz/) for this and the companion text. There is always the possibility that this site itself may need tobemovedduetounforeseencircumstances;inthateventoneshouldcheck the Springer site for the link to the detailed book Web site. The authors are grateful to Dr. Wolf Beiglbo¨ck, Dr. Ramon Khanna and the Springer staff for their patience while waiting for our long overdue manuscript. The authors are pleased to acknowledge the many discussions and helpful comments on the manuscript that have been provided by col- leagues such as Paola Gervasio, David Kopriva, Giovanni Monegato, Luca Pavarino and Andrea Toselli. The technical support of Paola Gervasio and Marco Discacciati in running numerical tests, preparing figures and tables, typing and editing a significant part of the whole manuscript is gratefully acknowledged. Thanks are also due to Stefano Berrone and Sophie Fosson for providing further technical support, and to Susan Greenwalt for her ad- ministrative support of this project. We appreciate the generosity of those individuals who have given us permission to reprint figures from their work in these texts. The authors are grateful to the Politecnico di Torino, the Florida State University, the Ecole Polytechnique F´ed´erale de Lausanne and Preface XI the Politecnico di Milano for their facilitation of this endeavor. One of us (MYH) is particularly grateful to Provost Lawrence Abele of Florida State Universityforhisencouragementandsupportforthisproject.Finally,weare most appreciative of the support and understanding we have received from our wives (Manuelita, Khamar, Fulvia and Ann) and children (Arianna, Su- sanna, Moin, Nadia, Marzia and Silvia) during this project. Torino, Italy Claudio Canuto Tallahassee, Florida M. Yousuff Hussaini Lausanne, Switzerland and Milano, Italy Alfio Quarteroni Carrollton, Virginia Thomas A. Zang February, 2006