Repository navigation
perf(modal): shift-invert block Lanczos eigenvalues for long lines - #116
Conversation
The banded modal solver took its lowest eigenvalues from LAPACK DSBGVX, whose band reduction costs O(n^2 kd) for n free DOFs and dominated the modal analysis of a long refined line (86 % of lazy_wave_modes.dat). The eigenvalue stage is now a block Lanczos iteration (block 2, full M-reorthogonalisation) on K^-1 M with the banded Cholesky factor of K, at O(n) cost per vector. A Ritz value is accepted on its residual (1e-10 of its eigenvalue); the count is certified by the Cholesky factor (no eigenvalue at or below zero) and by the inertia of K - sigma M (an unpivoted banded LDL^T) at a shift in a gap above the wanted values, so a repeated frequency beyond the block size or a missed eigenvector is never accepted. DSBGVX remains for short lines, many modes of a short line, an indefinite or singular K, a basis that would exceed 256 MB, and an iteration that is not certified within its basis bound; the inverse iteration, the quadruple-precision Rayleigh quotient, the ordering and the messages are unchanged, and a shape the Lanczos eigenvalues do not give is solved again on the band reduction's eigenvalues. On identical matrices the frequencies agree with the band-reduction route to 7e-16 (lazy_wave_modes.dat) and bit for bit (torsion lazy wave, synthetic lines of 100 to 4000 elements), the shapes to 2.6e-8 of their largest component, with a smaller quadruple-precision residual than before. 10 modes of a 1024-element finite-EI line: 3.7 s -> 0.14 s; of a 4000-element line: 55 s -> 0.51 s (50 modes: 59 s -> 2.9 s), one thread. A mode whose largest components are equal to round-off (the mirrored nodes of a symmetric line) now takes its sign from the first of them, not from round-off. CD_Modal_Solve_Band takes optional eig_method / eig_used arguments to select and report the eigenvalue stage. test_modal runs both stages against the dense reference, on sagged lines and on a sixfold repeated frequency; lapack_guard_pages covers DPBTRF, DPBTRS and DSYEV. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The [Unreleased] entries of the open changes are added together in one change, so that they do not conflict with each other. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The
nModeseigenvalue stage used LAPACK DSBGVX. That routine reduces the whole band to tridiagonal form, which costs O(n² kd) even when only a few modes are wanted. Onlazy_wave_modes.datit took 86 % of the run.Change
The new eigenvalue stage,
lanczos_lowestinCD_Modal_Solve_Band, serves every modal route: EI = 0, Hermite, and the twist variant.Accuracy
lazy_wave_modes.Speed
Eigen-solve time, before → after, one thread:
lazy_wave_modes.datend to end: 4.5 s → 0.93 s.Tests
test_modalchecks both stages explicitly:test_lapack_guard_pages: now covers DPBTRF, DPBTRS and DSYEV.-Wclean.Effect on results
No deck-syntax change. Mode shapes differ at round-off. On symmetric lines, a few tied modes now flip sign deterministically.