1
0
mirror of https://github.com/paboyle/Grid.git synced 2026-05-01 07:56:00 +01:00

added double orthog to KS

This commit is contained in:
Patrick Oare
2025-08-04 15:30:18 -04:00
parent 5e85aef19d
commit 9057694895
+7 -3
View File
@@ -225,7 +225,7 @@ class KrylovSchur {
* - Permutes the Rayleigh quotient according to the eigenvalues. * - Permutes the Rayleigh quotient according to the eigenvalues.
* - Truncate the Krylov-Schur expansion. * - Truncate the Krylov-Schur expansion.
*/ */
void operator()(const Field& v0, int _maxIter, int _Nm, int _Nk, int _Nstop, bool doubleOrthog = false) { void operator()(const Field& v0, int _maxIter, int _Nm, int _Nk, int _Nstop, bool doubleOrthog = true) {
MaxIter = _maxIter; MaxIter = _maxIter;
Nm = _Nm; Nk = _Nk; Nm = _Nm; Nk = _Nk;
Nstop = _Nstop; Nstop = _Nstop;
@@ -331,7 +331,7 @@ class KrylovSchur {
* start : int (default = 0) * start : int (default = 0)
* If non-zero, assumes part of the Arnoldi basis has already been constructed. * If non-zero, assumes part of the Arnoldi basis has already been constructed.
*/ */
void arnoldiIteration(const Field& v0, int Nm, int start = 0, bool doubleOrthog = false) void arnoldiIteration(const Field& v0, int Nm, int start = 0, bool doubleOrthog = true)
{ {
ComplexD coeff; ComplexD coeff;
@@ -366,7 +366,11 @@ class KrylovSchur {
} }
if (doubleOrthog) { if (doubleOrthog) {
// TODO implement for (int j = 0; j < basis.size(); j++) {
coeff = innerProduct(basis[j], w); // see if there is any residual component in basis[j] direction
Rayleigh(j, i) += coeff; // if coeff is non-zero, adjust Rayleigh
w -= coeff * basis[j];
}
} }
// add w_i to the pile // add w_i to the pile