-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheigen.tex
More file actions
1811 lines (1529 loc) · 85 KB
/
eigen.tex
File metadata and controls
1811 lines (1529 loc) · 85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%
%% This is file `lexample.tex',
%% Sample file for siam macros for use with LaTeX 2e
%%
%% October 1, 1995
%%
%% Version 1.0
%%
%% You are not allowed to change this file.
%%
%% You are allowed to distribute this file under the condition that
%% it is distributed together with all of the files in the siam macro
%% distribution. These are:
%%
%% siamltex.cls (main LaTeX macro file for SIAM)
%% siamltex.sty (includes siamltex.cls for compatibility mode)
%% siam10.clo (size option for 10pt papers)
%% subeqn.clo (allows equation numbners with lettered subelements)
%% siam.bst (bibliographic style file for BibTeX)
%% docultex.tex (documentation file)
%% lexample.tex (this file)
%%
%% If you receive only some of these files from someone, complain!
%%
%% You are NOT ALLOWED to distribute this file alone. You are NOT
%% ALLOWED to take money for the distribution or use of either this
%% file or a changed version, except for a nominal charge for copying
%% etc.
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\documentclass[final]{siamltex}
\usepackage{amsmath,amssymb}%,amsfonts,stmaryrd,amsthm}
\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{algorithm}
\usepackage{algorithmic}
% definitions used by included articles, reproduced here for
% educational benefit, and to minimize alterations needed to be made
% in developing this sample file.
\newtheorem{assumption}[theorem]{Assumption}
\newcommand{\pe}{\psi}
\def\d{\delta}
\def\ds{\displaystyle}
\def\e{{\epsilon}}
\def\eb{\bar{\eta}}
\def\enorm#1{\|#1\|_2}
\def\Fp{F^\prime}
\def\fishpack{{FISHPACK}}
\def\fortran{{FORTRAN}}
\def\gmres{{GMRES}}
\def\gmresm{{\rm GMRES($m$)}}
\def\Kc{{\cal K}}
\def\norm#1{\|#1\|}
\def\wb{{\bar w}}
\def\zb{{\bar z}}
\newcommand{\cS}{\mathcal{S}}
\newcommand{\tU}{\tilde{U}}
\newcommand{\ta}{\tilde{a}}
\newcommand{\tk}{\tilde{k}}
\newcommand{\bfb}{\mathbf{b}}
\newcommand{\tB}{\tilde{\mathcal{B}}}
\newcommand{\cV}{\mathcal{V}}
\newcommand{\cT}{\mathcal{T}}
\newcommand{\calB}{\mathcal{B}}
\newcommand{\cB}{{B}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\cK}{\mathcal{K}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\cI}{\mathcal{I}}
\newcommand{\cA}{{A}}
\newcommand{\calA}{\mathcal{A}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\osc}{\mathrm{osc}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\bk}{\mathbf{k}}
\newcommand{\br}{\mathbf{r}}
\newcommand{\tcb}{\textcolor{blue}}
% some definitions of bold math italics to make typing easier.
% They are used in the corollary.
\def\bfE{\mbox{\boldmath$E$}}
\def\bfG{\mbox{\boldmath$G$}}
\title{An Iterative Finite Element Method\\ for Elliptic Eigenvalue Problems}
% The thanks line in the title should be filled in if there is
% any support acknowledgement for the overall work to be included
% This \thanks is also used for the received by date info, but
% authors are not expected to provide this.
\author{P.~Solin\thanks{Department of Mathematics and Statistics, University of Nevada, Reno, USA, and Institute of Thermomechanics,
Prague, Czech Republic
({\tt solin@unr.edu}).}
%\thanks{Institute of Thermomechanics, Academy of Sciences of the Czech Republic, Prague.}
\and S.~Giani\thanks{School of Mathematical Sciences, University of Nottingham, United Kingdom ({\tt stefano.giani@nottingham.ac.uk}).}}
\begin{document}
\maketitle
\begin{abstract}
We consider the task of resolving accurately the $n$th eigenpair of a generalized
eigenproblem rooted in some elliptic partial differential equation (PDE), using an adaptive finite
element method (FEM). Conventional adaptive FEM algorithms call
a generalized eigensolver after each mesh refinement step. This is not
practical in our situation since the generalized eigensolver needs to calculate $n$
eigenpairs after each mesh refinement step, it can switch the order of eigenpairs,
and for repeated eigenvalues it can return an arbitrary linear combination of eigenfunctions
from the corresponding eigenspace. In order to circumvent these problems, we propose a novel adaptive algorithm
that only calls the eigensolver once at the beginning of the computation, and then employs
an iterative method to pursue a selected eigenvalue-eigenfunction pair on a sequence
of locally refined meshes. Both Picard's and Newton's variants of the iterative
method are presented. The underlying partial differential equation (PDE) is discretized
with higher-order finite elements ($hp$-FEM) but the algorithm also works for standard
low-order FEM. The method is described and
accompanied with theoretical analysis and numerical examples. Instructions on how to
reproduce the results are provided.
\end{abstract}
\begin{keywords}
Partial differential equation, Eigenvalue problem, Iterative method, Adaptive higher-order finite element
method, $hp$-FEM, Reproducible research
\end{keywords}
\begin{AMS}
%15A15, 15A09, 15A23
65N25, 65N30, 65N50, 35B45
\end{AMS}
\pagestyle{myheadings}
\thispagestyle{plain}
\markboth{P.~SOLIN AND S.~GIANI}{Adaptive $hp$-FEM for Eigenvalue Problems}
\section{Introduction}\label{sec:intro}
Eigenvalue problems for partial differential equations (PDE) are of considerable theoretical
and practical interest in engineering and sciences.
To name a few applications, let us mention automated multilevel substructuring
methods for noise prediction in acoustics \cite{lalor_prediction_2007},
analysis of photonic crystals \cite{pcf_apost,JoMeWi:95} and
plasmonic guides \cite{berini_plasmon-polariton_2000}, and
stability analysis of fluid systems \cite{cliffe_adaptive_2010}.
The most common approach to solving eigenproblems is using eigensolvers. For larger problems it is
practical to employ iterative eigensolvers such as ARPACK \cite{arpack}. A characteristic common to
all eigensolvers is that even if the user is interested in one particular eigenpair only, several
additional eigenvalues and possibly eigenvectors need to be computed. These auxiliary eigenpairs are
the byproduct of techniques such as deflation or orthogonalization that are used to filter out
unwanted solutions.
The majority of eigensolvers are not specifically designed to work with adaptive finite element methods
(FEM), and their application on sequences of locally refined meshes can lead to substantial problems.
In this paper we illustrate some of these problems and propose a novel iterative method that alleviates
them. We are going to adapt the Picard's and Newton's methods to solve eigenvalue problems
in order to minimize the number of unwanted eigenpair exploiting the orthogonality between eigenvectors.
In contrast to conventional adaptive methods that call an eigensolver after each mesh refinement,
the present method is capable of following reliably a selected eigenpair on a sequence of adapted
meshes. This is particularly useful with multiple eigenvalues when only a particular eigenfunction
in the eigenspace is wanted.
\subsection{Outline of the Paper}
Section \ref{sec:motiv} illustrates some difficulties associated with
conventional adaptive FEM algorithms. Section \ref{sec:preli} introduces notations and
preliminaries. Section \ref{sec:picard} presents a simple
Picard's method and shows that it does not work as expected.
The problem is fixed in Section \ref{sec:picard++} by adding
orthogonalization. Section \ref{sec:newton} presents
a Newton's method with orthogonalization.
Section \ref{sec:adapt} presents an outline of the adaptivity algorithm.
Section \ref{sec:reco}
discusses a reconstruction technology for spectra perturbed
by discretization. This is used to devise an algorithm for
computing reference solutions for $hp$-adaptivity in
Section \ref{sec:recoref}.
Moreover, in Section~\ref{sec:imp_ortho} we present improved versions of our iterative methods. A priori convergence results
are presented in Section \ref{sec:aprio}. Numerical results
are presented in Section \ref{sec:numer}. Reproducibility of
results is discussed in Section \ref{sec:reproducibility}.
Conclusion and outlook are presented in Section \ref{sec:conclusion}.
\section{Motivation}\label{sec:motiv}
We will illustrate a typical outcome of repeated eigensolver calls
on a simple eigenproblem of the form
\begin{equation} \label{one}
-\Delta u = \lambda u, \ \ \ u = 0 \ \mbox{on} \ \partial \Omega
\end{equation}
that is solved in a square domain with a hole, i.e., $\Omega = (0,\,1)^2\setminus [1/3,\,2/3]^2$.
%the eigenvalues $0 < \lambda_1 \le \lambda_2 \le \ldots$
%are known exactly, and it is of particular interest that $\lambda_2 = \lambda_3 = 5$
%and $\lambda_5 = \lambda_6 = 10$ are repeated.
Equation (\ref{one}) is discretized via the finite element method
on a mesh consisting of 16 quadratic ($p = 2$) triangular elements shown in Fig. \ref{fig:mesh1}.\\
\begin{figure}[!ht]
\begin{center}
\includegraphics[width=0.36\textwidth]{img/mesh_1_new.png}
\end{center}
%\vspace{-5mm}
\caption{Initial mesh for automatic adaptivity.}
\label{fig:mesh1}
\end{figure}
%Here, the numbers inside of finite elements mean their polynomial degrees.
In this case the second and the third eigenvalues are repeated, i.e., $\lambda_2 = \lambda_3$.
The corresponding approximate eigenfunctions are shown in Fig. \ref{fig:eigen1}.
%\clearpage
\begin{figure}[!ht]
\begin{center}
\includegraphics[width=0.4\textwidth]{img/eig2.png}\ \ \
\includegraphics[width=0.4\textwidth]{img/eig3.png}\\
\end{center}
%\vspace{-5mm}
\caption{Approximate eigenfunctions for $\lambda_2, \lambda_3$ on initial mesh.}
\label{fig:eigen1}
\end{figure}
Let us assume that the objective of the computation is to resolve accurately the eigenfunction corresponding
to $\lambda_3$ (target eigenfunction). This eigenfunction contains singularities at the upper-right and lower-left corners of the hole
and it is very smooth (almost constant) in the vicinity of the remaining two corners. Accordingly, in the first
mesh adaptation step, the mesh is refined towards the upper-right and lower-left corners of the hole.
On the refined mesh, a generalized eigensolver is called again.
The new approximate eigenfunctions for $\lambda_2, \lambda_3$
are shown in Fig. \ref{fig:eigen2}.
\begin{figure}[!ht]
\begin{center}
\includegraphics[width=0.4\textwidth]{img/eig2_2.png}\ \ \
\includegraphics[width=0.4\textwidth]{img/eig3_2.png}\\
\end{center}
%\vspace{-5mm}
\caption{Approximate eigenfunctions for $\lambda_2, \lambda_3$ after the second call to the generalized
eigensolver (compare to Fig. \ref{fig:eigen1}).}
\label{fig:eigen2}
\end{figure}
The reader can observe that the second call to the generalized eigensolver
switched the order of the eigenfunctions. This means that the second round of
mesh refinements goes towards the upper-leftt and lower-right corners of the
hole, i.e., into regions where the target eigenfunction is flat,
and no refinements are done where it has singularities.
Obviously, this is inefficient. In a worst-case scenario, the eigenfunctions
are not switched back, and thus all following mesh refinements go into regions
where the target eigenfunction is flat, i.e., its singularities are never
resolved.
To our best knowledge, contemporary generalized eigensolvers do
not offer any systematic way to avoid this problem. There are only a few publications
that deal specifically with repeated eigenvalues, such as \cite{thesis, grubii_estimators_2008}.
Their authors adapt the mesh considering an entire basis of the
eigenspace of the repeated eigenvalue. This means that for a double
eigenvalue such as, e.g., $\lambda_2 = \lambda_3$ the mesh would be refined using both
the eigenfunctions $u_2$ and $u_3$, even if one is just interested in the eigenpair
$(\lambda_3, u_3)$. This, however, does not solve the problem illustrated in Figs.
\ref{fig:eigen1} and \ref{fig:eigen2}. In addition, the degrees
of freedom that are targeting the eigenpair $(\lambda_2, u_2)$ are not going to
improve significantly the accuracy of the eigenpair $(\lambda_3, u_3)$ and in
fact they are wasted.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Preliminaries}\label{sec:preli}
Throughout, $L^2(\Omega)$
denotes the usual space of square-integrable real valued functions
equipped with the standard norm
\begin{equation}\label{eq:l2}
\|f\|_{0}\ := \ \left(\int_\Omega |f|^2\right)^{\frac{1}{2}} .
\end{equation}
The symbol $H^1(\Omega)$ denotes the usual space of functions in $L^2(\Omega)$
with square-integrable weak first partial derivatives. The $H^1$-norm is
denoted by $\|f\|_1$.
The variational formulation of problem \eqref{one} is:
\emph{Find eigenpairs of the form $(\lambda_j,u_j)\in
\mathbb{R}\times H^1_0(\Omega)$
such that}
\begin{equation}
\label{eq:var_prob}
\left.
\begin{array}{lcl}
a(u_j,v)&=& \lambda_j\ b(u_j,v),
\quad \text{for all } \quad v \in H^1_0(\Omega)\\
\Vert u_j \Vert_{0} &=& 1
\end{array}\quad
\right\}
\end{equation}
where
\begin{equation}\label{eq:a}
a(u,v):=\int_\Omega \nabla u(x)\cdot \nabla v(x),
\end{equation}
and
\begin{equation}\label{eq:b}
b(u,v):=\int_\Omega u(x) v(x).
\end{equation}
Now, to discretize (\ref{eq:var_prob}), let $\cT_n, n =
1,2,\ldots $ denote a family of meshes on $\Omega$.
The meshes can be irregular with multiple levels of hanging nodes,
and they can combine possibly curvilinear triangular and quadrilateral
elements. These meshes may be obtained using automatic adaptivity.
By $h_{n,\tau}$ we denote the diameter of element $\tau$,
we define
$
h_n:=\max_{\tau\in \mathcal{T}_n}\{h_{n,\tau}\}.
$
Similarly with $p_{n,\tau}$ we denote the order of polynomials of element $\tau$,
we define
$
p_n:=\min_{\tau\in \mathcal{T}_n}\{p_{n,\tau}\}.
$
On any mesh $\mathcal{T}_n$ we denote by $V_n \subset H^1_0(\Omega)$ the finite
dimensional space of continuous functions $v$ such that on any element $\tau$ we
have that $v|_\tau\in \mathcal{P}_{p_{n,\tau}}(K)$. Here either $\mathcal{P}_{p_{n,\tau}}(K)$
is the space of polynomials of total degree at most $p_{n,\tau}$ if $\tau$ is a triangular
element, or $\mathcal{P}_{p_{n,\tau}}(K)$ is the space of polynomials of degree at most
$p_{n,\tau}$ in each variable if $\tau$ is a quadrilateral element.
The discrete version of \eqref{eq:var_prob} reads:
\emph{Find eigenpairs of the form $(\lambda_{j,n},u_{j,n})\in
\mathbb{R}\times V_n$
such that}
\begin{equation}
\label{eq:disc_prob}
\left.
\begin{array}{lcl}
a(u_{jn},v_{n})&=& \lambda_{j,n}\ b(u_{j,n},v_{n}),
\quad \text{for all } \quad v_{n} \in V_n\\
\Vert u_{j,n} \Vert_{0} &=& 1
\end{array}\quad
\right\}
\end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Picard's Method}\label{sec:picard}
Problem \eqref{eq:disc_prob} can be reformulated in matrix form as:
\emph{Find eigenpairs of the form $(\lambda,\mathbf{u})\in
\mathbb{R}\times \mathbb{R}^N$, where $N$ is the dimension of $V_n$,
such that}
\begin{equation}
\label{eq:disc_prob_mat}
\left.
\begin{array}{lcl}
\mathbf{A} \mathbf{u}&=& \lambda\mathbf{B}\mathbf{u}\ ,
\\
\mathbf{u}^t\mathbf{B} \mathbf{u} &=& 1
\end{array}\quad
\right\}
\end{equation}
where the entries of the matrices $\mathbf{A}$ and $\mathbf{B}$ are
$$
\mathbf{A}_{k,p}:=a(\phi_k,\phi_p)\ ,\quad\mathbf{B}_{k,p}:=b(\phi_k,\phi_p)\ ,
$$
where $\phi_i$ are the basis functions spanning $V_n$.
The Picard's method, see Algorithm~\ref{alg:picard}, takes as arguments the matrices $\mathbf{A}$ and $\mathbf{B}$, an initial guess $\tilde u$ for the eigenfunction, a relative tolerance $\mathrm{Tol}$ and an absolute tolerance $\mathrm{AbsTol}$.
The algorithm returns an approximated eigenpair $(\lambda_{n},u_{n})$.
Because we use this iterative method on a sequence of adaptively refined meshes, we normally set as initial guess
the projection on the refined mesh of the eigenfunction of interest $u_{j,n-1}$.
\begin{algorithm}[H] \caption{Picard's method} \label{alg:picard}
\begin{algorithmic}
\STATE{$(\lambda_{j,n},u_{j,n}):=\mathrm{Picard}
(\mathbf{A}, \mathbf{B},\tilde u,\mathrm{Tol},\mathrm{AbsTol})$}
\STATE{$\mathbf{u}^1:=\tilde u$}
\STATE{$\displaystyle\lambda^{1}:=\frac{u_{j,n}^t\mathbf{A}u_{j,n}}{u_{j,n}^t\mathbf{B}u_{j,n}}$}
\STATE{$m=1$}
\REPEAT
\STATE{$\mathbf{u}^{m+1}:=\mathbf{A}^{-1}\lambda^m\mathbf{B}\mathbf{u}^{m}$}
\STATE{$\displaystyle\lambda^{m+1}:=\frac{(\mathbf{u}^{m+1})^t\mathbf{A}\mathbf{u}^{m+1}}{(\mathbf{u}^{m+1})^t\mathbf{B}\mathbf{u}^{m+1}}$}
\STATE{$m:=m+1$}
\UNTIL{ $\frac{\|\mathbf{u}^{m+1}-\mathbf{u}^{m}\|_1}{\|\mathbf{u}^{m}\|_1}>\mathrm{Tol}$ \bf{and}
$|\lambda^{m+1}-\lambda^m|>\mathrm{AbsTol}$}
\STATE{$u_{n}:=\mathbf{u}^{m}$}
\STATE{$\lambda_{n}:=\lambda^m$}
\end{algorithmic}
\end{algorithm}
The next theorem shows that the Picard's method always converges to the smallest eigenvalue.\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{theorem}\label{th:picard_conv}
The Picard's method in exact arithmetic converges into the eigenspace which is not orthogonal to the initial guess $\mathbf{u}^1$ and whose eigenvalue has minimum module.
\end{theorem}
\begin{proof}
Any vector $\mathbf{u}^m$ can be expressed as
$$
\mathbf{u}^m=\sum_{i=1}^N c_i^m \mathbf{u}_i\ ,
$$
where $c_i^m$ are real coefficients, $N$ is the size of the matrices $\mathbf{A}$ and $\mathbf{B}$ and the vectors $\mathbf{u}_i\equiv u_{i,n}$ are the eigenvectors of the discrete problem, which form an orthonormal basis.
With no lost in generality we can assume that $\lambda_1$ is the eigenvalue of minimum module and that $c_1^1$ is different from 0.
In the case that $\lambda_1$ is simple we have from the definition of the problem:
$$
\mathbf{u}^{m+1}=\mathbf{A}^{-1}\lambda^m\mathbf{B}\mathbf{u}^{m}
=\Big(\Pi_{j=1}^m\lambda^{j}\Big)\Big(\mathbf{A}^{-1}\mathbf{B}\Big)^m\mathbf{u}^1
=\Big(\Pi_{j=1}^m\lambda^{j}\Big)\sum_{i=1}^N c_i^1 (\lambda_i)^{-m}\mathbf{u}_i\ ,
$$
where $\lambda_i$ are the eigenvalues corresponding to $\mathbf{u}_i$.
Then
$$
\mathbf{u}^{m+1}=\Big(\Pi_{j=1}^m\lambda^{j}\Big)(\lambda_1)^{-m}\Big( c_1^1 \mathbf{u}_1 +
\sum_{i=2}^N c_i^1\frac{(\lambda_1)^m}{(\lambda_i)^{m}}\mathbf{u}_i\Big) \ ,
$$
where it is clear that, since $\lambda_1/\lambda_i<1$, for $i\ge 2$, the direction of $\mathbf{u}^{m+1}$ tends toward the direction of $\mathbf{u}_1$. Furthermore, the Rayleigh quotient of $\mathbf{u}^{m+1}$
$$
\lambda^{m+1}:=\frac{(\mathbf{u}^{m+1})^t\mathbf{A}\mathbf{u}^{m+1}}{(\mathbf{u}^{m+1})^t\mathbf{B}\mathbf{u}^{m+1}}
=\lambda_1 \frac{\displaystyle(c_1^1)^2 +
\sum_{i=2}^N (c_i^1)^2\Bigg(\frac{\lambda_1}{\lambda_i}\Bigg)^{m-1}}
{\displaystyle(c_1^1)^2 +
\sum_{i=2}^N (c_i^1)^2\Bigg(\frac{\lambda_1}{\lambda_i}\Bigg)^{m}}\ ,
$$
converges to $\lambda_1$.
In the case that $\lambda_1$ has multiplicity $R$ and that $c_r^1$, for some $1\leq r\leq R$, is not zero,
we similarly have that for all $i>R$:
$$
\mathbf{u}^{m+1}=\Big(\Pi_{j=1}^m\lambda^{j}\Big)(\lambda_1)^{-m}\Big( \sum_{r=1}^Rc_r^1 \mathbf{u}_r+
\sum_{i=R+1}^N c_i^1\frac{(\lambda_1)^m}{(\lambda_i)^{m}}\mathbf{u}_i\Big) \ ,
$$
and then
$$
\lambda^{m+1}:=\frac{(\mathbf{u}^{m+1})^t\mathbf{A}\mathbf{u}^{m+1}}{(\mathbf{u}^{m+1})^t\mathbf{B}\mathbf{u}^{m+1}}
=\lambda_1 \frac{\displaystyle \sum_{r=1}^R(c_r^1)^2 +
\sum_{i=2}^N (c_i^1)^2\Bigg(\frac{\lambda_1}{\lambda_i}\Bigg)^{m-1}}
{\displaystyle \sum_{r=1}^R(c_r^1)^2 +
\sum_{i=2}^N (c_i^1)^2\Bigg(\frac{\lambda_1}{\lambda_i}\Bigg)^{m}}\ ,
$$
which converges again to $\lambda_1$.
\end{proof}
Theorem~\ref{th:picard_conv} shows that even if the initial guess $\mathbf{u}^1$ is very close to a certain discrete eigenfunction $u_{i,n}$, for some $i$, the method can always converge to a different eigenfunction or a linear combinations of eigenfunctions with corresponding eigenvalues smaller in module than $\lambda_{i,n}$. In real arithmetic, even if the initial guess $\mathbf{u}^1$ is orthogonal to all eigenfunctions of indexes less than $i$, for some $m>1$ the orthogonality could be perturbed, due to round-off errors, and the method can eventually converges anyway to a different eigenfunction or a linear combinations of eigenfunctions with corresponding eigenvalues smaller in module than $\lambda_{i,n}$.
To illustrate this behavior, we refer to the numerical simulations in Section~\ref{ssec:ortho}, where we use the fifth eigenfunction corresponding to $\lambda_5 = 10$ (Fig. \ref{fig:picard} left) as a starting guess for the Picard's method.
However, the Picard's method converges to the first eigenfunction corresponding
to $\lambda_1 = 2$ (Fig. \ref{fig:picard} right).
\begin{figure}[!ht]
\begin{center}
\includegraphics[width=0.393\textwidth]{img/eigen_5_ex.png}\ \ \
\includegraphics[width=0.43\textwidth]{img/eigen-new-1.png}
\end{center}
%\vspace{-5mm}
\caption{The Picard's method converges from an initial guess that is very close to
the fifth eigenfunction (left) that corresponds to $\lambda_5 = 10$ to the
first eigenfunction (right) that corresponds to $\lambda_1 = 2$.}
\label{fig:picard}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Picard's Method with Orthogonalization}\label{sec:picard++}
In order to make the Picard's method suitable to approximate efficiently any discrete eigenpair, and not only the first one, we derived Algorithm~\ref{alg:picard_ortho}, which has an orthogonalization procedure in it.
The Picard's method with orthogonalization takes as arguments the matrices $\mathbf{A}$ and $\mathbf{B}$ of \eqref{eq:disc_prob}, an initial guess $\tilde u$ for the eigenfunction, the tolerances $\mathrm{AbsTol}$ and$\mathrm{Tol}$ and it also takes the $j-1$ eigenfunctions $u_{1,n},\dots,u_{j-1,n}$.
%Then it returns the eigenpair $\lambda_{j,n},u_{j,n}$.
Then it returns the eigenpair $\lambda_{j,n},u_{j,n}$ on the refined mesh.
%{\red STEFANO, do you want to move the following statement after the Algorithm,
%and formulate it as a Theorem with
%a simple proof? To me this would look stronger.}
%This method never converges to an eigenfunction of index smaller than $j$ because for any $m\ge 1$, the vector $\mathbf{u}^m$ is orthogonal to all eigenfunctions $u_{1,n},\dots,u_{j-1,n}$, i.e. all coefficients
%$c_1^m,\dots,c_{j-1}^m$ in the expansion of $\mathbf{u}^m$ are zero, so the eigenvalue smallest in module is $\lambda_j$ and the Picard's method naturally converges to it.
%Anyway this is not enough to guarantee to not lose the eigenfunction that we want because if a multiple eigenspace splits differently due to the refinement of the mesh, the eigenfunction of the refined mesh are not similar to the wanted eigenfunction on the coarse mesh.
%\textcolor{red}{Pavel, we should try to find such an example.}
\begin{algorithm}[H] \caption{Picard's method with orthogonalization} \label{alg:picard_ortho}
\begin{algorithmic}
\STATE{$(\lambda_{j,n},u_{j,n}):=\mathrm{PicardOrtho}
(\mathbf{A}, \mathbf{B},\tilde u_{j,n-1},\mathrm{Tol},\mathrm{AbsTol},u_{1,n},\dots
,u_{j-1,n})$}
\STATE{$\mathbf{u}^1:=\tilde u_{j,n-1}$}
\STATE{$\displaystyle\lambda^{1}:=\frac{u_{j,n}^t\mathbf{A}u_{j,n}}{u_{j,n}^t\mathbf{B}u_{j,n}}$}
\STATE{$m=1$}
\REPEAT
\STATE{$\mathbf{u}^{m+1}:=\mathbf{A}^{-1}\lambda^m\mathbf{B}\mathbf{u}^{m}$}
\FOR{$i = 1$ to $j-1$}
\STATE $\mathbf{u}^{m+1}:=\mathbf{u}^{m+1}-(u_{i,n}^t\mathbf{B}\mathbf{u}^{m+1})u_{i,n}$
\COMMENT{Orthogonalization}
\ENDFOR
\STATE $\displaystyle \mathbf{u}^{m+1}=\frac{\mathbf{u}^{m+1}}{((\mathbf{u}^{m+1})^t\mathbf{B}\mathbf{u}^{m+1})^{1/2}}$
\COMMENT{Normalize}
\STATE{$\displaystyle\lambda^{m+1}:=\frac{(\mathbf{u}^{m+1})^t\mathbf{A}\mathbf{u}^{m+1}}{(\mathbf{u}^{m+1})^t\mathbf{B}\mathbf{u}^{m+1}}$}
\STATE{$m:=m+1$}
\UNTIL{ $\frac{\|\mathbf{u}^{m+1}-\mathbf{u}^{m}\|_1}{\|\mathbf{u}^{m}\|_1}>\mathrm{Tol}$ \bf{and}
$|\lambda^{m+1}-\lambda^m|>\mathrm{AbsTol}$}
\STATE{$u_{j,n}:=\mathbf{u}^{m}$}
\STATE{$\lambda_{j,n}:=\lambda^m$}
\end{algorithmic}
\end{algorithm}
As can be seen in Algorithm~\ref{alg:picard_ortho}, the orthogonalization is done in each iteration.
This is necessary in real arithmetic to guarantee that $\mathbf{u}^m$ is orthogonal to all
eigenfunctions $u_{1,n},\dots,u_{j-1,n}$, for all $m$. Otherwise in exact arithmetic it would
be enough to orthogonalize only $\mathbf{u}^1$. Moreover, a normalization step is necessary
in all iterations because due to the orthogonalization procedure, this version of the Picard's
method does not conserve the norm of the vectors and possible underflows or overflows could
happen with no normalization.\\
\begin{theorem}
Algorithm~\ref{alg:picard_ortho} never converges to an eigenvalue of index smaller than $j$.
\end{theorem}
\begin{proof}
The proof comes straightforwardly from the arguments used to prove Theorem~\ref{th:picard_conv}.
The fact that $\mathbf{u}^m$ is orthogonal to all eigenfunctions $\mathbf{u}_1,\dots,\mathbf{u}_{j-1}$, implies that the coefficients $c_i^m$, with $m=1,\dots,j-1$, are zeros.
Then, the Rayleigh quotient converges to $\lambda_j$ by the same arguments use before.
\end{proof}
\vspace{4mm}
\noindent
{\bf Remark}: To make the Picard's method usable in practice, it is
recommended to enhance it with Anderson acceleration \cite{anderson}.
This method combines a number of last iterates in a GMRES-like fashion.
The result is equivalent to a Jacobian-free quasi-Newton (Broyden) method.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Newton's Method with Orthogonalization}\label{sec:newton}
The second iterative method that we are going to propose is based on the Newton's method applied to eigenvalue problems. Denoting by $\tilde x:=(x,\lambda)$, we have that problem \eqref{eq:var_prob} can be rewritten in the form
$$
0=f(\tilde x):=
\left(
\begin{array}{lcl}
A x&-& \lambda_j\ Bx
\\
x^T Bx&-& 1
\end{array}\quad
\right) ,
$$
then denoting by $\tilde h:=(h, \delta)$ the increment, we have that the truncated Taylor series of the problem is
\begin{equation}\label{eq:newton}
f(\tilde x + \tilde h)\approx f(\tilde x) + J_f(\tilde x)\cdot \tilde h,
\end{equation}
where the Jacobian matrix is defined as
$$
J_f(\tilde x):=
\left(
\begin{array}{lr}
A - B\lambda & -Bx
\\
2Bx^T & 0
\end{array}\quad
\right) .
$$
Then when $\tilde x + \tilde h$ is a solution of \eqref{eq:var_prob}, we have from \eqref{eq:newton}
that
$$
J_f(\tilde x)\cdot \tilde h = - f(\tilde x),
$$
which defines the linear problem of the Newton's method that we are solving.
\begin{algorithm}[H] \caption{Newton's method} \label{alg:newton}
\begin{algorithmic}
\STATE{$(\lambda_{j,n},u_{j,n}):=\mathrm{Newton}
(\mathbf{A}, \mathbf{B},\tilde u,\mathrm{Tol},\mathrm{AbsTol})$}
\STATE{$\mathbf{u}^1:=\tilde u$}
\STATE{$\displaystyle\lambda^{1}:=\frac{u_{j,n}^t\mathbf{A}u_{j,n}}{u_{j,n}^t\mathbf{B}u_{j,n}}$}
\STATE{$m=1$}
\REPEAT
\STATE{Solve $J_f(\mathbf{u}^m,\lambda^m)\cdot \tilde h = - f(\mathbf{u}^m,\lambda^m)$}
\STATE{$\mathbf{u}^{m+1}:=\mathbf{u}^m+h$}
\STATE{$\lambda^{m+1}:=\lambda^m+\delta$}
\STATE{$m:=m+1$}
\UNTIL{ $\frac{\|\mathbf{u}^{m+1}-\mathbf{u}^{m}\|_1}{\|\mathbf{u}^{m}\|_1}>\mathrm{Tol}$ \bf{and}
$|\lambda^{m+1}-\lambda^m|>\mathrm{AbsTol}$}
\STATE{$u_{n}:=\mathbf{u}^{m}$}
\STATE{$\lambda_{n}:=\lambda^m$}
\end{algorithmic}
\end{algorithm}
In order to make the method suitable for all eigenpairs, we are going write a version of the Newton's method that uses an orthogonalization procedure, similarly to what we have already done for the Picard's method.
\begin{algorithm}[H] \caption{Newton's method with orthogonalization} \label{alg:newton_ortho}
\begin{algorithmic}
\STATE{$(\lambda_{j,n},u_{j,n}):=\mathrm{NewtonOrtho}
(\mathbf{A}, \mathbf{B},\tilde u_{j,n-1},\mathrm{Tol},\mathrm{AbsTol},u_{1,n},\dots
,u_{j-1,n})$}
\STATE{$\mathbf{u}^1:=\tilde u_{j,n-1}$}
\STATE{$\displaystyle\lambda^{1}:=\frac{u_{j,n}^t\mathbf{A}u_{j,n}}{u_{j,n}^t\mathbf{B}u_{j,n}}$}
\STATE{$m=1$}
\REPEAT
%\STATE{$\mathbf{u}^{m+1}:=\mathbf{A}^{-1}\lambda^m\mathbf{B}\mathbf{u}^{m}$}
\STATE{Solve $J_f(\mathbf{u}^m,\lambda^m)\cdot h = - f(\mathbf{u}^m,\lambda^m)$}
\STATE{$\mathbf{u}^{m+1}:=\mathbf{u}^m+h$}
\STATE{$\lambda^{m+1}:=\lambda^m+\delta$}
\STATE{$m:=m+1$}
\FOR{$i = 1$ to $j-1$}
\STATE $\mathbf{u}^{m+1}:=\mathbf{u}^{m+1}-(u_{i,n}^t\mathbf{B}\mathbf{u}^{m+1})u_{i,n}$
\COMMENT{Orthogonalization}
\ENDFOR
\STATE $\displaystyle \mathbf{u}^{m+1}:=\frac{\mathbf{u}^{m+1}}{((\mathbf{u}^{m+1})^t\mathbf{B}\mathbf{u}^{m+1})^{1/2}}$
\COMMENT{Normalize}
\STATE{$\displaystyle\lambda^{m+1}:=\frac{(\mathbf{u}^{m+1})^t\mathbf{A}\mathbf{u}^{m+1}}{(\mathbf{u}^{m+1})^t\mathbf{B}\mathbf{u}^{m+1}}$}
\STATE{$m:=m+1$}
\UNTIL{$\frac{\|\mathbf{u}^{m+1}-\mathbf{u}^{m}\|_1}{\|\mathbf{u}^{m}\|_1}>\mathrm{Tol}$ \bf{and}
$|\lambda^{m+1}-\lambda^m|>\mathrm{AbsTol}$}
\STATE{$u_{j,n}:=\mathbf{u}^{m}$}
\STATE{$\lambda_{j,n}:=\lambda^m$}
\end{algorithmic}
\end{algorithm}
\begin{theorem}
Algorithm~\ref{alg:newton_ortho} converges always to an eigenvalue greater or equal to $\lambda_j$.
\end{theorem}
\begin{proof}
This result is a direct consequence of the orthogonalization step in Algorithm~\ref{alg:newton_ortho}.
We are using again the fact that any vector $\mathbf{u}^{m+1}$ can be expressed as
$$
\mathbf{u}^{m+1}=\sum_{i=1}^N c_i^{m+1} \mathbf{u}_i,
$$
where $c_i^{m+1}$ are real coefficients, $N$ is the size of the matrices $\mathbf{A}$ and $\mathbf{B}$ and the vectors $\mathbf{u}_i\equiv u_{i,n}$ are the eigenvectors of the discrete problem, which are sorted accordingly the magnitude of the corresponding eigenvalues $\lambda_i$.
In particular, when $\mathbf{u}^{m+1}:=\mathbf{u}^m+h$, where $h$ is the solution of
$J_f(\mathbf{u}^m,\lambda^m)\cdot h = - f(\mathbf{u}^m,\lambda^m)$, we have that, after the application of the orthogonalization step, the resulting vector is
$$
\mathbf{\hat u}^{m+1}=\sum_{i=j}^N c_i^{m+1} \mathbf{u}_i.
$$
Then, it is straightforward to see that the Rayleigh quotient
$$
\displaystyle\lambda^{m+1}:=\frac{(\mathbf{\hat u}^{m+1})^t\mathbf{A}\mathbf{\hat u}^{m+1}}{(\mathbf{\hat u}^{m+1})^t\mathbf{B}\mathbf{\hat u}^{m+1}} \ge \lambda_j.
$$
\end{proof}
%{\red STEFANO, it would be nice to have some sort of a Theorem with proof here, to
%say something formal about the Newton's method with orthogonalization. Otherwise this
%looks unfinished.}
%{\red Pavel, I'm working on it.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Automatic $hp$-Adaptivity}\label{sec:adapt}
With the Picard's and Newton's methods in hand, we can now proceed to automatic $hp$-adaptivity.
This part of the paper is not new but we need to present it to make the paper self-contained.
We use an algorithm from \cite{solin3} that is an analogy to embedded higher-order ODE methods:
In each adaptivity step it
constructs an approximation pair with different orders of accuracy and uses their difference
as an a-posteriori error estimator.
\begin{algorithm}[H] \caption{Automatic $hp$-Adaptivity} \label{alg:hp}
\begin{algorithmic}
\STATE{Let $\cT^c_{0}$ be an initial coarse mesh. We construct an initial fine mesh $\cT^f_{0}$
by refining all elements in space and moreover increasing their polynomial degrees by one.
A generalized eigensolver is called one time only,
to obtain a solution pair $(\lambda^c_{0}, u^c_{0})$
on the initial coarse mesh $\cT^c_{0}$.}
\STATE{Set $k := 0$}
\REPEAT
\STATE{Project the approximation $u^c_{k}$ to the mesh $\cT^f_{k}$. The projection
is denoted by $P^f_k u^c_{k}$. Since the finite element spaces on meshes
$\cT^c_{k}$ and $\cT^f_{k}$ are embedded, there is no projection error. }
\STATE{Calculate an initial guess $\tilde \lambda^f_{k}$ for the eigenvalue on the mesh $\cT^f_{k}$
using the relation
$$
\tilde \lambda^f_{k} = \frac{(P^f_k u^c_{k})^T \mathbf{A}^f_{k} P^f_k u^c_{k}}{(P^f_k u^c_{k})^T
\mathbf{B}^f_{k} P^f_k u^c_{k}},
$$
where $\mathbf{A}^f_{k}$ and $\mathbf{B}^f_{k}$ are the stiffness and mass matrices on the
mesh $\cT^f_{k}$, respectively.}
The pair $(\tilde \lambda^f_{k}, P^f_k u^c_{k})$ is {\bf not a solution} to the generalized eigenproblem
on the mesh $\cT^f_{k}$, but it is used as an initial guess.
\STATE{
Apply the Picard's or Newton's method as described in Sections \ref{sec:picard++} and \ref{sec:newton},
to obtain a solution pair $(\lambda^f_{k}, u^f_{k})$ on the mesh $\cT^f_{k}$.}
\STATE{
Project the approximation $u^f_{k}$ back to the coarse mesh
$\cT^c_{k}$ to obtain $P^c_k u^f_{k}$. }
\STATE{
Calculate an a-posteriori error estimate $e^c_{k}$,
$$
e^c_{k} = u^f_{k} - P^c_k u^f_{k}.
$$
Note: $e^c_{k}$ is a function, not a number.}
\STATE{
Use $e^c_{k}$ to guide one step of automatic $hp$-adaptivity \cite{solin3} that
yields a new coarse mesh $\cT^f_{k+1}$.}
\STATE{Update $k := k+1$}
\UNTIL{The $H^1$-norm of $e^c_{k-1}$ is sufficiently small.}
\end{algorithmic}
\end{algorithm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Reconstruction Technology}\label{sec:reco}
It is well known that the discretization process perturbs the spectrum, in particular the eigenspace $E(\lambda_j)$ of multiple eigenvalue $\lambda_j$ can be split in more than one discrete eigenspace $E(\lambda_{j,n}),E(\lambda_{j+1,n}),\dots,E(\lambda_{j+m,n})$ with correspondent discrete eigenvalues $\lambda_{j,n},\lambda_{j+1,n},\dots,\lambda_{j+m,n}$ forming a small cluster for sufficiently rich finite element spaces, also under the same assumption we have that
$$
\mathrm{dim}\ E(\lambda_j)=\sum_{i=0}^m\mathrm{dim}\ E(\lambda_{j+i,n}).
$$
This phenomenon is already well documented in literature, see \cite{strang, babuska, hackbusch}.
Different finite element spaces can split the same multiple eigenspace in different ways, this also happens with adaptively refined meshes. It is not rare that the same multiple eigenspace is split differently on the coarse and on the refined meshes. A different split corresponds to different discrete eigenfunctions, then it is not always possible to find for the same eigenvalue on the refined mesh an eigenfunction similar to the one on the coarse mesh.
%\textcolor{red}{Pavel, I think we need another figure here. It would be easy to see the phenomenon on unstructured meshes.}
We propose a way to always construct on a refined mesh, an approximation of the same eigenfunction as on the coarse mesh. The idea is based on the fact that for a sufficiently rich finite element space, the space
$M_n(\lambda_j)=\mathrm{span}\{E(\lambda_{j,n}),E(\lambda_{j+1,n}),\dots,$ $E(\lambda_{j+m,n})\}$ is an approximation of the space $E(\lambda_j)$, see \cite{strang}. Let us denote the space $M_{n,1}(\lambda_j)$ as the subspace of $M_n(\lambda_j)$ of functions with unit norm in the $L^2$.
So for any function $U_{n-1}\in M_{n-1,1}(\lambda_j)$, we propose the function $U_{n}\in M_{n,1}(\lambda_j)$ that minimize the $\|U_{n-1}-U_{n}\|_{0,\Omega}$ as an approximation of $U_{n-1}$ on the refined mesh. For a sufficiently rich finite element space the minimizer is unique. By construction
\begin{equation}\label{eq:const}
U_n=\sum_{i=1}^{R} c_i \ u_{i,n},
\end{equation}
where $u_{1,n},u_{2,n},\dots,u_{R,n}$, with $R=\mathrm{dim}\ E(\lambda_j)$, are eigenfunctions of the discrete problem forming an orthonormal basis for
$M_{n,1}$ and where the coefficients $c_i$ satisfy
\begin{equation}\label{eq:cond_on_corf}
\sum_{i=1}^{R} c_i^2=1.
\end{equation}
From the definition of problem \eqref{eq:var_prob} we have that the reconstructed eigenvalue is defined as
$$
\Lambda_n=\frac{a(U_n,U_n)}{b(U_n,U_n)}.
$$
The couple $(\Lambda_n,U_n)$ is not a discrete eigenpair of problem \eqref{eq:var_prob} in general, in section~\ref{sse:pcf_priori} we prove that $(\Lambda_n,U_n)$ converges a priori at the same rate as any other discrete eigenpair of \eqref{eq:var_prob} to a continuous eigenpair.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Computing Reference Solution via Reconstruction}\label{sec:recoref}
In this section we present two algorithms to compute approximations of eigenpairs. Each algorithm is based on a different method to compute the discrete spectrum, but all of them use the reconstruction technology to keep track of the eigenfunction of interest.
In all algorithms we are going to use on the initial mesh an iterative eigensolver with calling interface
$\{(\lambda_{j,n},u_{j,n})_{j=1}^{i}\}:=\mathrm{Eigensolver}(\mathbf{A},\mathbf{B},i,\mathrm{Tol},\mathrm{MaxIter})$, that computes the set of discrete eigenpairs $\{(\lambda_{j,n},u_{j,n})\}_{j=1}^{i}$ and where $\mathbf{A}$ is the stiffness matrix of the problem, $\mathbf{B}$ is the mass matrix of the problem $i$ is the number of eigenpairs to compute, $\mathrm{Tol}$ is the requested tolerance for the eigenpairs and $\mathrm{MaxIter}$ is the maximum number of iterations.
All algorithm we describe below are based on the reconstruction technology which is guided by two parameters: $\mathrm{DTE}$ and $\mathrm{FIE}$. The parameter $\mathrm{DTE}$ should be equal to the multiplicity of the continuous eigenvalue $\lambda$ that the user want to approximate. All the algorithms work also when $\mathrm{DTE}$ contains an upper bound of the multiplicity of $\lambda$, so in practise the multiplicity of the target eigenvalue is not necessary to be known exactly. The parameter $\mathrm{FIE}$ should be equal to the index $i$ of the first discrete eigenvalue on the initial mesh $\lambda_{i,0}$ that approximates $\lambda$. The reconstruction technology is described in Algorithm~\eqref{alg:reconstruction}.
\begin{algorithm}[H] \caption{Reconstruction algorithm} \label{alg:reconstruction}
\begin{algorithmic}
\STATE{$(\Lambda_n,U_n):=\mathrm{Reconstruction}
(\{(\lambda_{j,n},u_{j,n})\}_{j=\mathrm{FIE}}^{\mathrm{FIE}+\mathrm{DTE}},
(\Lambda_{n-1},U_{n-1}))$}
\STATE{Compute $\displaystyle (\Lambda_n,U_n):=\sum_{i=\mathrm{FIE}}^{\mathrm{FIE}+\mathrm{DTE}}
b(u_{i,n},U_{n-1})u_{i,n}$}
\STATE{$\displaystyle U_n:=\frac{U_n}{\sqrt{b(U_n,U_n)}}$}
\COMMENT{Normalize}
\STATE{$\Lambda_n:=a(U_n,U_n)$}
\end{algorithmic}
\end{algorithm}
The first method is based on the Picard's method. The only three parameters not yet defined are $M$ which is the maximum number of mesh adaptation requested, $0<\mathrm{FIE}\mathrm{TE}\leq\mathrm{FIE}+\mathrm{DTE} $ which is the index of the eigenvalue that the user want to target and $\mathrm{err}$ which is tolerance for the residual.
\begin{algorithm}[H] \caption{Adaptive method based on the Picard's method} \label{alg:picard_adapt}
\begin{algorithmic}
\STATE{$(\Lambda_M,U_M):=\mathrm{PicardAdapt}
(\mathcal{T}_0, V_0,M,\mathrm{err},\mathrm{Tol},\mathrm{AbsTol},\mathrm{MaxIter}
,\mathrm{DTE},\mathrm{FIE},\mathrm{TE})$}
\STATE{Construct $\mathbf{A}_0$ and $\mathbf{B}_0$}
\STATE{$\{(\lambda_{j,0},u_{j,0})\}_{j=1}^{\mathrm{DTE}+\mathrm{FIE}}:=\mathrm{Eigensolver}(\mathbf{A}_0,\mathbf{B}_0,
\mathrm{DTE}+\mathrm{FIE},$}
\STATE{$\quad\quad\quad\mathrm{Tol},\mathrm{MaxIter})$}
\STATE{$(\Lambda_0,U_0):=(\lambda_{\mathrm{TE},0},u_{\mathrm{TE},0})$}
%\STATE{Compute the residual $\eta$ for the couple $(\Lambda_0,U_0)$}
\STATE{$m:=1$}
\REPEAT
\STATE{Construct the mesh $\mathcal{T}_m$ and the finite element space $V_m$ adapting $\mathcal{T}_{m-1}$ and $V_{m-1}$}
\STATE{Construct $\mathbf{A}_m$ and $\mathbf{B}_m$}
\STATE{$(\lambda_{1,m},u_{1,m}):=\mathrm{Picard}
(\mathbf{A}_m, \mathbf{B}_m,u_{1,m-1},\mathrm{Tol},\mathrm{AbsTol})$}
\STATE{$j=1$}
\FOR{$j = 2$ to $\mathrm{DTE}+\mathrm{FIE}$}
\STATE{$(\lambda_{j,m},u_{j,m}):=$}
\STATE{$\quad \quad\mathrm{PicardOrtho}
(\mathbf{A}_m, \mathbf{B}_m,u_{j,m-1},\mathrm{Tol},\mathrm{AbsTol},u_{j,m-1},\dots
,u_{j-1,m-1})$}
\ENDFOR
\STATE{$(\Lambda_m,U_m):=\mathrm{Reconstruction}
(\{(\lambda_{j,m},u_{j,m})\}_{j=\mathrm{FIE}}^{\mathrm{FIE}+\mathrm{DTE}},
(\Lambda_{m-1},U_{m-1}))$}
\STATE{$m:=m+1$}
\UNTIL{ $m\leq M$ OR $\eta \leq \mathrm{err}$}
\end{algorithmic}
\end{algorithm}
Similarly we define the adaptive method based on the Newton's method.
\begin{algorithm}[H] \caption{Adaptive method based on the Newton's method} \label{alg:newton_adapt}
\begin{algorithmic}
\STATE{$(\Lambda_M,U_M):=\mathrm{NewtonAdapt}
(\mathcal{T}_0, V_0,M,\mathrm{err},\mathrm{Tol},\mathrm{AbsTol},\mathrm{MaxIter}
,\mathrm{DTE},\mathrm{FIE},\mathrm{TE})$}
\STATE{Construct $\mathbf{A}_0$ and $\mathbf{B}_0$}
\STATE{$\{(\lambda_{j,0},u_{j,0})\}_{j=1}^{\mathrm{DTE}+\mathrm{FIE}}:=\mathrm{Eigensolver}(\mathbf{A}_0,\mathbf{B}_0,
\mathrm{DTE}+\mathrm{FIE},$}
\STATE{$\quad\quad\quad\mathrm{Tol},\mathrm{MaxIter})$}
\STATE{$(\Lambda_0,U_0):=(\lambda_{\mathrm{TE},0},u_{\mathrm{TE},0})$}
%\STATE{Compute the residual $\eta$ for the couple $(\Lambda_0,U_0)$}
\STATE{$m:=1$}
\REPEAT
\STATE{Construct the mesh $\mathcal{T}_m$ and the finite element space $V_m$ adapting $\mathcal{T}_{m-1}$ and $V_{m-1}$}
\STATE{Construct $\mathbf{A}_m$ and $\mathbf{B}_m$}
\STATE{$(\lambda_{1,m},u_{1,m}):=\mathrm{Newton}
(\mathbf{A}_m, \mathbf{B}_m,u_{1,m-1},\mathrm{Tol},\mathrm{AbsTol})$}
\STATE{$j=1$}
\FOR{$j = 2$ to $\mathrm{DTE}+\mathrm{FIE}$}
\STATE{$(\lambda_{j,m},u_{j,m}):=$}
\STATE{$\quad \quad \mathrm{NewtonOrtho}
(\mathbf{A}_m, \mathbf{B}_m,u_{j,m-1},\mathrm{Tol},\mathrm{AbsTol},u_{1,m-1},\dots
,u_{j-1,m-1})$}
\ENDFOR
\STATE{$(\Lambda_m,U_m):=\mathrm{Reconstruction}
(\{(\lambda_{j,m},u_{j,m})\}_{j=\mathrm{FIE}}^{\mathrm{FIE}+\mathrm{DTE}},
(\Lambda_{m-1},U_{m-1}))$}
\STATE{$m:=m+1$}
\UNTIL{ $m\leq M$ OR $\eta \leq \mathrm{err}$}
\end{algorithmic}
\end{algorithm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Iterative methods with improved orthogonalization}\label{sec:imp_ortho}
The main disadvantage of the algorithms presented in Sections~\ref{sec:picard++} and \ref{sec:newton} is the cost of the method. Those methods ensure that the eigenpair with the correct index $m$ is computed, but, in order to ensure that, all eigenpairs of indices from 1 to $n-1$ are also computed. What we present now is a more cheaper way to ensure the computation of the target eigenpair. The key idea is a smarter way to use the orthogonalization only when it is really necessary and this is possible mainly because we can use information from the previous mesh to identify unwanted eigenpairs.
The reason why we introduce the algorithms in Sections~\ref{sec:picard++} and \ref{sec:newton} was to cure the downside of the iterative methods to possibly converge to an eigenpair different from the target one. The answer to this problem presented in Sections~\ref{sec:picard++} and \ref{sec:newton} was to compute all possible eigenpair to which the method could erroneously converge to, and then use all of them to force the method, by the orthogonalization, to produce an approximation of the wanted eigenpair. There is a better way which consists in starting with no-orthogonalization and then every time that the iterative method produces an unwanted eigenpair, save it to be used next time in the orthogonalization process to prevent the method to converge again to the same unwanted solution. This is possible only if a way to distinguish between wanted and unwanted solution is available. In the adaptive setting this is always possible because the orthogonality of any newly computed eigenpair against the results on the previous mesh can be computed.
The Algorithms~\ref{alg:picard_importho} and \ref{alg:newton_importho} are the incarnations of the improved orthogonality technology applied with the either the Picard's or the Newton's method respectively. Since these two algorithms are identical except for the call to either $\mathrm{PicardOrtho}$ or to $\mathrm{NewtonOrtho}$, in the rest we are gong to describe only Algorithm~\ref{alg:picard_importho}.
Algorithm~\ref{alg:picard_importho} compute a set of eigenpairs $\{(\lambda_{j,n},u_{j,n})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}}$, approximating the target continuous eigenspace, on the mesh $\cT_n$. The arguments that it needs are: the matrices $\mathbf{A}$ and $\mathbf{B}$, the approximation of the target eigenspace $\{(\tilde\lambda_{j,n-1},\tilde u_{j,n-1})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}}$ computed on the previous mesh $\cT_{n-1}$, and then projected on the refined mesh $\cT_n$, and a real value $0<\mathrm{ThO}<1$ which is used to decide wether a computed eigenfunction is part of the approximation of the target eigenspace or not. The set $\mathcal{D}$ is empty at the beginning, but then it is fed with all computed eigenfunctions. Then $\mathcal{D}$ is passed to every call to $\mathrm{PicardOrtho}$ and so it guarantees that the same eigenfunction is never computed twice.
The key part of the algorithm is just after the call to $\mathrm{PicardOrtho}$, where the newly computed eigenfunction is analyzed. The analysis consists in checking how orthogonal the newly computed eigenfunction $u_{j,n}$ is respect to the span of $\{(\tilde\lambda_{j,n-1},\tilde u_{j,n-1})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}}$. If the resulting value is smaller than $\mathrm{ThO}$, then $u_{j,n}$ is not considered part of the target eigenspace and a new approximation of $u_{j,n}$ is done. Otherwise, $u_{j,n}$ is kept and the algorithm pass to approximate the next eigenfunction in the target eigenspace.
The algorithm ends when all eigenpair in $\{(\lambda_{j,n},u_{j,n})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}}$ are computed.
\begin{algorithm}[H] \caption{Picard's method with improved orthogonalization} \label{alg:picard_importho}
\begin{algorithmic}
\STATE{$\{(\lambda_{j,n},u_{j,n})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}}:=\mathrm{PicardImpOrtho}
(\mathbf{A}, \mathbf{B},\{(\tilde\lambda_{j,n-1},\tilde u_{j,n-1})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}},\mathrm{ThO})$}
\STATE{$\mathcal{D}:=\O$}
%\STATE{$m:=1$}
\STATE{$j:=\mathrm{DTE}+\mathrm{FIE}$}
\REPEAT
\STATE{$(\lambda_{j,n},u_{j,n}):=\mathrm{PicardOrtho}
(\mathbf{A}, \mathbf{B},u_{j,n-1},\mathrm{Tol},\mathrm{AbsTol},\mathcal{D})$}
%\STATE{$m:=m+1$}
\STATE{Add $u_{j,n}$ to $\mathcal{D}$}
\STATE{$\mathrm{inner}:=0$}
\FOR{$i = \mathrm{FIE} \to \mathrm{DTE}+\mathrm{FIE}$}
\STATE{$\mathrm{inner}:=\mathrm{inner}+u_{j,n}^t\mathbf{B}\tilde u_{i,n-1}$}
\ENDFOR
\IF {$\mathrm{inner}>\mathrm{ThO}$}
\STATE{$j:=j-1$}
\ENDIF
\UNTIL{ $j<\mathrm{FIE}$}% OR $m>\mathrm{DTE}+\mathrm{FIE}$}
\end{algorithmic}
\end{algorithm}
\begin{algorithm}[H] \caption{Newton's method with improved orthogonalization} \label{alg:newton_importho}
\begin{algorithmic}
\STATE{$\{(\lambda_{j,n},u_{j,n})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}}:=\mathrm{NewtonImpOrtho}
(\mathbf{A}, \mathbf{B},\{(\tilde\lambda_{j,n-1},\tilde u_{j,n-1})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}},\mathrm{ThO})$}
\STATE{$\mathcal{D}:=\O$}
%\STATE{$m:=1$}
\STATE{$j:=\mathrm{DTE}+\mathrm{FIE}$}
\REPEAT
\STATE{$(\lambda_{j,n},u_{j,n}):=\mathrm{NewtonOrtho}
(\mathbf{A}, \mathbf{B},u_{j,n-1},\mathrm{Tol},\mathrm{AbsTol},\mathcal{D})$}
%\STATE{$m:=m+1$}
\STATE{Add $u_{j,n}$ to $\mathcal{D}$}
\STATE{$\mathrm{inner}:=0$}
\FOR{$i = \mathrm{FIE} \to \mathrm{DTE}+\mathrm{FIE}$}
\STATE{$\mathrm{inner}:=\mathrm{inner}+u_{j,n}^t\mathbf{B}\tilde u_{i,n-1}$}
\ENDFOR
\IF {$\mathrm{inner}>\mathrm{ThO}$}
\STATE{$j:=j-1$}
\ENDIF
\UNTIL{ $j<\mathrm{FIE}$}% OR $m>\mathrm{DTE}+\mathrm{FIE}$}
\end{algorithmic}
\end{algorithm}
So the number of computed eigenfunction may vary: in the best case scenario when the method is used to approximate an eigenspace of dimension $\mathrm{DTE}$, only $\mathrm{DTE}$ eigenfunctions are computed. In the worst case scenario, $\mathrm{DTE}+\mathrm{FIE}$ eigenfunctions are computed, which is the number of computed eigenfunctions by Algorithms~\ref{alg:picard_ortho},~\ref{alg:newton_ortho} on the same space. Because almost never the worst case scenario is achieved, Algorithms~\ref{alg:picard_importho} and \ref{alg:newton_importho} are more efficient than Algorithms~\ref{alg:picard_ortho},~\ref{alg:newton_ortho}.
We conclude this section stating the adaptive algorithms with improved orthogonality.
\begin{algorithm}[H] \caption{Adaptive method based on the Picard's method with improved orthogonality} \label{alg:picard_impadapt}
\begin{algorithmic}
\STATE{$(\Lambda_M,U_M):=\mathrm{PicardImpAdapt}
(\mathcal{T}_0, V_0,M,\mathrm{err},\mathrm{Tol},\mathrm{MaxIter}
,\mathrm{DTE},\mathrm{FIE},\mathrm{TE},\mathrm{ThO})$}
\STATE{Construct $\mathbf{A}_0$ and $\mathbf{B}_0$}
\STATE{$\{(\lambda_{j,0},u_{j,0})\}_{j=1}^{\mathrm{DTE}+\mathrm{FIE}}:=\mathrm{Eigensolver}(\mathbf{A}_0,\mathbf{B}_0,
\mathrm{DTE}+\mathrm{FIE},$}
\STATE{$\quad\quad\quad\mathrm{Tol},\mathrm{MaxIter})$}
\STATE{$(\Lambda_0,U_0):=(\lambda_{\mathrm{TE},0},u_{\mathrm{TE},0})$}
%\STATE{Compute the residual $\eta$ for the couple $(\Lambda_0,U_0)$}
\STATE{$m:=1$}
\REPEAT
\STATE{Construct the mesh $\mathcal{T}_m$ and the finite element space $V_m$ adapting $\mathcal{T}_{m-1}$ and $V_{m-1}$}
\STATE{Construct $\mathbf{A}_m$ and $\mathbf{B}_m$}
\STATE{$\{(\lambda_{j,m},u_{j,m})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}}:=$}
\STATE{$\quad \quad \mathrm{PicardImpOrtho}
(\mathbf{A}_m, \mathbf{B}_m,\{(\lambda_{j,m-1}, u_{j,m-1})\}_{j=\mathrm{FIE}}^{\mathrm{DTE}+\mathrm{FIE}},\mathrm{ThO})$}
\STATE{$(\Lambda_m,U_m):=\mathrm{Reconstruction}
(\{(\lambda_{j,m},u_{j,m})\}_{j=\mathrm{FIE}}^{\mathrm{FIE}+\mathrm{DTE}},
(\Lambda_{m-1},U_{m-1}))$}
\STATE{$m:=m+1$}
\UNTIL{ $m\leq M$ OR $\eta \leq \mathrm{err}$}
\end{algorithmic}
\end{algorithm}
Similarly we define the adaptive method based on the Newton's method.
\begin{algorithm}[H] \caption{Adaptive method based on the Newton's method with improved orthogonality} \label{alg:newton_impadapt}
\begin{algorithmic}
\STATE{$(\Lambda_M,U_M):=\mathrm{NewtonImpAdapt}
(\mathcal{T}_0, V_0,M,\mathrm{err},\mathrm{Tol},\mathrm{MaxIter}
,\mathrm{DTE},\mathrm{FIE},\mathrm{TE},\mathrm{ThO})$}
\STATE{Construct $\mathbf{A}_0$ and $\mathbf{B}_0$}