[petsc-users] preconditioned eigensolver in slepc

Verena Kuhlemann vkuhlem at gmail.com
Thu Feb 16 09:41:15 CST 2012


Hi,

I am trying to use LOBPCG via Slepc and I am a little confused on how
to set the preconditioner and operator matrices. I have a shell matrix
A and a matrix P that should be used for the preconditioning. Here is
the relevant part of my code:

EPSCreate(PETSC_COMM_WORLD,&eps);

EPSSetOperators(eps, A, PETSC_NULL);

EPSSetProblemType(eps, EPS_HEP);

EPSSetType(eps, EPSBLOPEX);

EPSGetST(eps, &st);

STPrecondSetMatForPC(st, P);

STGetKSP(st,&ksp);

KSPGetPC(ksp, &pc);

KSPSetOperators(ksp,A, P, DIFFERENT_NONZERO_PATTERN); //do I have to
set this?? If I don't the program complains that a matrix is not set

PCSetType(pc, PCJACOBI);

EPSSetUp(eps);


Is that correct or do I need to do something else?


Thanks,

Verena
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120216/36357cd4/attachment.htm>


More information about the petsc-users mailing list