The Jacobi-Davidson Algorithm for Solving Large Sparse Symmetric Eigenvalue Problems with Application to the Design of Accelerator Cavities
Total Page:16
File Type:pdf, Size:1020Kb
Research Collection Doctoral Thesis The Jacobi-Davidson algorithm for solving large sparse symmetric eigenvalue problems with application to the design of accelerator cavities Author(s): Geus, Roman Publication Date: 2002 Permanent Link: https://doi.org/10.3929/ethz-a-004469464 Rights / License: In Copyright - Non-Commercial Use Permitted This page was generated automatically upon download from the ETH Zurich Research Collection. For more information please consult the Terms of use. ETH Library DISS. ETH NO. 14734 The Jacobi-Davidson algorithm for solving large sparse symmetric eigenvalue problems with application to the design of accelerator cavities A dissertation submitted to the SWISS FEDERAL INSTITUTE OF TECHNOLOGY ZURICH for the degree of Doctor of Technical Sciences presented by ROMAN GEUS Dipl. Informatik-Ing. ETH born 6. September 1970 citizen of Arbon, Switzerland accepted on the recommendation of Prof. Dr. Walter Gander, examiner Prof. Dr. Henk van der Vorst, co-examiner Dr. Peter Arbenz, co-examiner 2002 Acknowledgements This work would not have been possible without the help of many people. First of all I would like to thank Prof. Dr. Walter Gander for giving me the opportunity to do my Ph.D. thesis in his group. His guidance and encouragement were always a great help. My special thank goes to Dr. Peter Arbenz, my supervisor during all these years. With his support he contributed a great deal to this work. He was there to answer many of my questions and to help me dealing with difficult problems. He gave me the opportunity and freedom to learn a great variety of methods and to realise my own ideas. I’m very much obliged to Prof. Dr. Henk van der Vorst for accepting to be co-examiner of this thesis. I’m very grateful to the three of them for reviewing the entire thesis and giving valuable suggestions. A special thank goes to all my present and former co-workers in the group, Oliver Broker,¨ Oscar Chinellato, Leonhard Jaschke, Erwin Achermann and Rolf Strebel. We had many in- spiring and not only scientific discussions. They all contributed a lot to a pleasant working atmosphere, together with all the other members of the institute. Further, I want to thank the following people: Dr. Stefan Adam, who was one of the initiators of this project, for his support in the early stages of this work; Dr. Hans-Rudolf Fitze, Markus Bopp and Lukas Stingelin for providing me the mesh data of the accelerator cavities and giving me some insight into accelerator cavity design; Stefan Rollin¨ for contributing to the optimisation and parallelisation of the sparse matrix vector multiplication; Anne Preisig for helping me with the translation of this document. I would like to express my gratitude to all the people who dedicated their time to develop the free and open source software which was essential for realising this project. Furthermore, I want to thank all those who have supported me in non-work related terms. In this respect I am especially grateful to Regula, my family and all my friends for the moral support during this long and interesting time. Last but not least, I want to thank everyone else who kept asking all these years: “Have you finished your thesis yet?” Silencing that question is an extra benefit of this work. Zusammenfassung Diese Arbeit beschaftigt¨ sich mit der Berechnung elektromagnetischer Schwingungen in Ka- vitaten¨ von Teilchenbeschleunigern. Die zeit-harmonischen Maxwell-Gleichungen, welche die- se elektromagnetischen Schwingungen beschreiben, werden mit der Methode der finiten Ele- mente diskretisiert und so in ein allgemeines symmetrisches Matrix-Eigenwertproblem uberge-¨ fuhrt.¨ Von diesem Eigenwertproblem sollen die 10 bis 20 kleinsten positiven Eigenwerte mit den zugehorigen¨ Eigenvektoren berechnet werden. Werden ubliche¨ knotenbasierte finite Elemente verwendet, so wird das Eigenwertproblem viele unphysikalische Eigenlosungen¨ (sog. spurious modes) mit positiven Eigenwerten aufwei- sen. In einem ersten Losungsansatz¨ verwenden wir weiterhin die ublichen¨ knotenbasierten fi- niten Elemente und fuhren¨ einen zusatzlichen¨ Strafterm ein. Die gewunschten¨ Eigenlosungen¨ konnen¨ dann mit der “shift-and-invert” Spektraltransformation berechnet werden. In einer zweiten Variante verwenden wir Ned´ elec-Vektorelemente.´ Alle spurious modes ha- ben dann den Eigenwert Null. Wir stellen verschiedene Methoden vor, welche die effiziente Berechnung der gewunschten¨ Eigenlosungen¨ mit positivem Eigenwert erlauben. Als Eigenwertloser¨ benutzen wir einerseits das ARPACK Softwarepaket, welches die Lan- czos Methode mit implizitem Neustart implementiert, und andererseits unsere eigene, fur¨ das symmetrische Eigenwertproblem optimierte Implementation der Jacobi-Davidson Methode. Ein weiterer Schwerpunkt dieser Arbeit bildet die Optimierung der Matrix-Vektor Multi- plikation fur¨ schwach-besetzte Matrizen. Wir stellen Verfahren vor, welche diese Operation substanziell beschleunigen. Unsere Software haben wir als Python-Module implementiert, wobei die zeitkritischen Be- rechnungen als Erweiterungsmodule in C realisiert wurden. Wir haben effiziente und stabile Verfahren entwickelt, um die gewunschten¨ Eigenlosungen¨ zu berechnen. Unsere Software ist in der Lage, grosse Eigenwertprobleme (Ordnung grosser¨ als zwei Millionen) auf einer Einprozessormaschine zu bewaltigen.¨ Mit der Python-Implemen- tation haben wir eine Softwareumgebung geschaffen, welche die implementierten Methoden einfach benutzen, kombinieren und erweitern lasst.¨ Summary This thesis deals with the computation of electromagnetic oscillations in cavities of particle accelerators. The time-harmonic Maxwell equations, which describe these electromagnetic os- cillations, are discretised using the finite element method. Of the resulting generalised sym- metric matrix eigenvalue problem, the 10 to 20 smallest positive eigenvalues together with the associated eigenvectors have to be computed. If ordinary node-based finite elements are used, then the eigenvalue problem will exhibit many non-physical eigensolutions (so-called spurious modes) with positive eigenvalues. In a first approach we use node-based finite elements and introduce an additional penalty term. The desired eigensolutions can then be computed using a shift-and-invert spectral trans- formation. In a second variant we use Ned´ elec´ vector finite elements. All spurious modes then have the eigenvalue zero. We present different methods, which allow us to efficiently compute the desired eigensolutions with positive eigenvalues. As eigenvalue solvers we use on the one hand the ARPACK package, which implements the Implicitly Restarted Lanczos method, and on the other hand our own implementation of the Jacobi Davidson method optimised for the symmetric eigenvalue problem. A further emphasis of this thesis is the optimisation of the matrix-vector multiplication for sparse matrices. We present techniques, which accelerate this operation substantially. We implemented our software as Python modules. The time-critical computations were realised as extension modules written in C. We developed efficient and stable methods for computing the desired eigensolutions. Our software is able to handle large eigenvalue problems with an order of over two million on a single-processor workstation. With the Python implementation, our methods can be used, combined and extended easily. i Notation A,..., Z matrices aij entry of matrix A in the i-th row and the j-th column A(i, j) alternate notation for aij A(i, :), A(:, j) i-th row, resp. j-th column of A A([i1, i2, i3], :) submatrix, consisting of rows i1, i2 and i3 of A A(:, [j1, j2, j3]) submatrix, consisting of columns j1, j2 and j3 of A a,..., z vectors A,..., Z vectors R ha, bi ha, bi = Ω a · b dx a · b scalar dot product a.∗b element-wise multiplication a./b element-wise division Symbols ξ = (ξ, η, ζ)T Cartesian coordinates in the unit tetrahedron x = (x, y, z)T Cartesian coordinates L1, L2, L3, L4 simplex coordinates in a general tetrahedron, functions in x, y, z (xi, yi, zi) coordinates of tetrahedron corners, 1 ≤ i ≤ 4 Nk scalar, global basis functions for the FEM (e) Nk scalar, local basis functions for the FEM, defined in tetrahedron e (0) Nk scalar, basis functions for the FEM, defined in the unit tetrahedron Nk global vector basis functions for the FEM (e) Nk local vector basis functions for the FEM, defined in tetrahedron e (0) Nk vector basis functions for the FEM, defined in the unit tetrahedron u, u solutions of differential equations Ω domain on which the differential equations are solved Γ boundary of Ω, surface Te e-th tetrahedral element T0 unit tetrahedron A(e) stiffness element matrix or curl element matrix M (e) mass element matrix N (e) divergence element matrix e index over finite elements i, j indices over global degrees of freedom (DOFs) A, M global matrices of the generalised eigenvalue problem Y sparse basis of the null space of A CC := MY T HH := Y C, used in the projector P R(Y )⊥M ii s penalty parameter α parameter for Bespalov term σ shift for “Shift-and-Invert” spectral transformation τ target value used in the Jacobi-Davidson algorithm K preconditioner, approximation of A − σM, resp. A − θM V basis of search subspace used in eigensolvers V A V A := AV T GG := V V A, interaction matrix for Rayleigh-Ritz step (θ, u) Ritz pair W , S [W , S] = eig(G), eigenvectors W and eigenvalues S of G Q matrix of converged eigenvectors QM QM := MQ Qˆ Qˆ := [Q, u] ˆ ˆ ˆ QM QM := MQ ˆ ˆ −1 ˆ QK QK := K Q, preconditioned eigenvectors ˆ ˆ ˆ T ˆ F F := QK QM , matrix used in