Hello! I am using PETSc / SLEPc to compute an eigenvalue problem. Comparing the results in parallel with a single process with a code in single core, I get the same eigenvalues and matrices, but the eigenfunctions differ. I’d like to export them later on for further computations.
As the generated matrices are identical in both Single.edp and Parallel.edp when running Parallel.edp on a single process, I expected the same for the eigenvectors. Maybe I misunderstand the format of the eigenvectors in SLEPc or is there some sort of scaling or something else that I miss? I want them to satisfy the equation Au = lambdaB*u.
So eigenvalues are matching. There is no real reason for eigenvectors to match precisely, as what matters is the space spanned by the eigenvectors, not each individual eigenvector.
Ok, thank you. In the single code, when I export matrices A, B and an eigenpair (u,lambda), the equation Au=lambdaBu is satisfied. So I was hoping the same for the parallel code, but as the eigenvector is very different, it is not satisfied at all.
That’s because you are using the default tgv value of 10^30. Apply these changes:
[...]
varf b(u,v) = int3d(Th3) (u*v) + on(0,3,u=0);
[...]
A = a(Vh,Vh, tgv = -1);
B = b(Vh,Vh, tgv = -10);
[...]
Then run with the options -eps_error_backward ::ascii_info_detail -eps_error_relative ::ascii_info_detail -eps_error_absolute ::ascii_info_detail, and you’ll get the proper errors: