[petsc-users] Select a preconditioner for SLEPc eigenvalue solver Jacobi-Davidson
Jose E. Roman
jroman at dsic.upv.es
Wed Oct 23 04:58:45 CDT 2019
Yes, it is confusing. Here is the explanation: when you use a target, the preconditioner is built from matrix A-sigma*B. By default, instead of TARGET_MAGNITUDE we set LARGEST_MAGNITUDE, and in Jacobi-Davidson we treat this case by setting sigma=PETSC_MAX_REAL. In this case, the preconditioner is built from matrix B. The thing is that in a standard eigenproblem we have B=I, and hence there is no point in using a preconditioner, that is why we set PCNONE.
Jose
> El 22 oct 2019, a las 19:57, Fande Kong via petsc-users <petsc-users at mcs.anl.gov> escribió:
>
> Hi All,
>
> It looks like the preconditioner is hard-coded in the Jacobi-Davidson solver. I could not select a preconditioner rather than the default setting.
>
> For example, I was trying to select LU, but PC NONE was still used. I ran standard example 2 in slepc/src/eps/examples/tutorials, and had the following results.
>
>
> Thanks,
>
> Fande
>
>
> ./ex2 -eps_type jd -st_ksp_type gmres -st_pc_type lu -eps_view
>
> 2-D Laplacian Eigenproblem, N=100 (10x10 grid)
>
> EPS Object: 1 MPI processes
> type: jd
> search subspace is orthogonalized
> block size=1
> type of the initial subspace: non-Krylov
> size of the subspace after restarting: 6
> number of vectors after restarting from the previous iteration: 1
> threshold for changing the target in the correction equation (fix): 0.01
> problem type: symmetric eigenvalue problem
> selected portion of the spectrum: largest eigenvalues in magnitude
> number of eigenvalues (nev): 1
> number of column vectors (ncv): 17
> maximum dimension of projected problem (mpd): 17
> maximum number of iterations: 1700
> tolerance: 1e-08
> convergence test: relative to the eigenvalue
> BV Object: 1 MPI processes
> type: svec
> 17 columns of global length 100
> vector orthogonalization method: classical Gram-Schmidt
> orthogonalization refinement: if needed (eta: 0.7071)
> block orthogonalization method: GS
> doing matmult as a single matrix-matrix product
> DS Object: 1 MPI processes
> type: hep
> solving the problem with: Implicit QR method (_steqr)
> ST Object: 1 MPI processes
> type: precond
> shift: 1.79769e+308
> number of matrices: 1
> KSP Object: (st_) 1 MPI processes
> type: gmres
> restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
> happy breakdown tolerance 1e-30
> maximum iterations=90, initial guess is zero
> tolerances: relative=0.0001, absolute=1e-50, divergence=10000.
> left preconditioning
> using PRECONDITIONED norm type for convergence test
> PC Object: (st_) 1 MPI processes
> type: none
> linear system matrix = precond matrix:
> Mat Object: 1 MPI processes
> type: shell
> rows=100, cols=100
> Solution method: jd
>
> Number of requested eigenvalues: 1
> Linear eigensolve converged (1 eigenpair) due to CONVERGED_TOL; iterations 20
> ---------------------- --------------------
> k ||Ax-kx||/||kx||
> ---------------------- --------------------
> 7.837972 7.71944e-10
> ---------------------- --------------------
>
>
>
More information about the petsc-users
mailing list