Opposite sign eigenvalues' real parts using klu as preconditioner
I'm trying to solve a generalized eigenvalue problem Aq = wBq with the shift-invert technique and I'm testing different LU direct solvers (superLU, umfpack, klu). KLU seems to be the fastest but in this case the EVP solver returns eigenvalues with opposite real parts. This is the script that I run: python main_stab.py -eps_tol 1e-05 \ -st_type sinvert \ -st_matmode inplace \ -st_ksp_type preonly \ -st_pc_type lu \ -st_pc_factor_mat_solver_type klu
Comments (5)
-
-
reporter - attached diff_matrices.py
- attached script.sh
- attached operators.py
- attached main_stab.py
I'm attaching the code where I found the problem. In script.sh are the command lines with different PC. I obtain approximately the same results with SuperLU and umfpack, whereas , using KLU, eigenvalues have opposite real parts.
-
Your matrices have many zero blocks. KLU may not be appropriate for these matrices. I don't know how it works. You may want to ask SuiteSparse developers to see if KLU supports complex matrices with zero blocks.
Anyway, I would use UMFPACK since it seems to work well for your problem.
-
reporter Ok, thank you.
-
- changed status to resolved
- Log in to comment
I don't see why KLU should give a different result. You must provide a reproducible example, otherwise we cannot help. I have just tried a SLEPc example with UMFPACK and KLU and there are no strange results.