marcfehling / mg-ev-estimator

0 stars 1 forks source link

Fill LAPACK full matrix with eigenvalues #4

Open kronbichler opened 10 months ago

kronbichler commented 10 months ago

This PR aims to check the eigenvalues with the LAPACK full matrix. I was curious about the eigenvalue distribution and those indeed looked interesting: eigenvector_diagonal This indicates that there is indeed a large contribution coming from exactly the edge between the unknowns. Here is an excerpt of the eigenvalues (I list the smallest eigenvalue and the three largest):

2d:
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 0.225851 1.3198 1.34486 1.51812
eigenvalues: 0.0801544 1.52772 1.63276 1.99292
eigenvalues: 0.0403382 1.70237 1.78458 2.51628
eigenvalues: 0.0239733 1.82964 1.93205 3.03531
eigenvalues: 0.0156992 1.92881 2.03292 3.55877
eigenvalues: 0.0109859 2.01821 2.10943 4.08243
3d:
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 0.322735 1.16821 1.18745 1.35173
eigenvalues: 0.0916491 1.52566 1.63812 2.57579
eigenvalues: 0.0454553 1.7319 1.88564 4.42498
eigenvalues: 0.0270935 1.93915 2.05505 6.82354
eigenvalues: 0.0177825 2.06808 2.16254 9.78025
eigenvalues: 0.0124501 2.2839 2.29007 13.2934

By the way, the estimation of the largest eigenvalue is pretty accurate, if we take away that factor 1.2 that the Chebyshev iteration adds. The interesting observation here is that we have essentially one single eigenvalue that grows large, all others are around 2 at the value where we would expect them for a diagonal approximation. This indicates that there is an underlying mechanism that one could understand. To further analyze the method, I suspected that just doing a block-diagonal smoother would cure the problem. I imitated this by adding off-diagonal terms to those dofs that sit at the interface. Due to constraints, most of those are still diagonal, and only the actual unknowns are present. This gives me back what is otherwise the second largest eigenvalues (approximately): eigenvector_fixed and the eigenvalue distribution is really nice:

2d:
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 0.225851 1.3198 1.34486 1.51812
eigenvalues: 0.0867918 1.59242 1.61693 1.6643
eigenvalues: 0.043551 1.72448 1.73452 1.78931
eigenvalues: 0.0256065 1.8318 1.84136 1.93287
eigenvalues: 0.0166267 1.92886 1.92972 2.03316
eigenvalues: 0.0115625 2.01835 2.0184 2.10958
3d:
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 1 1 1 1
eigenvalues: 0.322735 1.16821 1.18745 1.35173
eigenvalues: 0.115564 1.52559 1.53102 1.63816
eigenvalues: 0.0555461 1.73017 1.736 1.88676
eigenvalues: 0.0317927 1.9393 1.9393 2.05509
eigenvalues: 0.0202675 2.06752 2.06752 2.16249
eigenvalues: 0.0139077 2.15904 2.15904 2.23583

I did not yet introduce the collection to the right place because I wanted to understand the underlying mathematics, but I think this gives us a good overview.