[petsc-users] SLEPc with offline preconditioner

Jose E. Roman jroman at dsic.upv.es
Sat May 26 04:47:29 CDT 2012


El 26/05/2012, a las 10:47, Ye Jianbo Bob escribió:

> Hi, I have some problem when using SLEPc to compute eigenvalue
> problems. I do not know how to implement my idea properly. Let me
> explain in detail.
> 
> I am interested in solving a set of eigenvalue problems (to find the
> smallest magnitude eigenvalues)
> 
> A x = \lambda B_i x
> for i=1,2,3,...
> 
> where A is the Laplacian of some regular grid, B_i is diagonal. It is
> known that A is semi-positive with a null vector [1,1,...,1].
> 
> I found SLEPc provides EPSSetDeflationSpace to set deflation space
> when applies iterative eigen solver. But I am not sure what default
> precondition is used when I defined my problem by setting
> eps_smallest_magnitude through EPSSetWhichEigenpairs.
> 
> It is possible to use shift-and-invert to explicitly address my
> problem. If the shift value is 0, zero pivot will be reported during
> LU precondition stage. But since my set of eigen problems has the
> exact the same A, I hope I could somehow do the precondition (direct
> solver) offline only associate with A and apply the iterative eigen
> solver online with set of different B_i.
> 
> The very initiative is the direct solver applied in precondition stage
> is O(N^2) while the matrix-free eigen solver is O(N), thus I think
> this would improve the efficiency of my situation. Is there any way to
> realize it?
> 
> Here is some rough idea:
> To prevent the zero pivot during LU, I would dampshift A with a small
> quantity A-\sigma I, and then compute its LU offline and store it. In
> online stage, I could build an ST shell that read LU computed in
> offline stage and solve. This is only an approximated approach,
> hopefully not degrading the performance.
> 
> Thank you!

You can use STSHELL to perform any customized spectral transformation. But in your case I don't think it is necessary. [1,1,...,1] is also an eigenvector of the matrix pair (A,B), so you can pass it through EPSSetDeflationSpace, then use shift-and-invert with zero target - in that case the internal KSP will have A as the coefficient matrix and KSPSetNullSpace will be invoked with the [1,1,...,1] vector. The only thing is that you have to use a KSP solver that supports nullspaces. I am not sure if PETSc's direct solvers (or external solvers) support it, so you may have to use an iterative solver (e.g., -st_ksp_type bcgs -st_pc_type bjacobi -st_ksp_rtol 1e-9).

Jose



More information about the petsc-users mailing list