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);