Slepc ESPSetDeflationSpace function

I am solving an eigenvalue problem and looking for information at SLEPc manual I have seen the function EPSSetDeflationSpace. I think it is not implemented in the SLEPc plugin. It would be possible to add?


Yes, it’s possible to add that. Is there a specific reason you’d want to use this routine?

I am computing Neumann-Laplace eigenvalues on some sets, and I would like to avoid the computation of the zero eigenvalue, as I think it is possible to do it with that function.

OK, so you basically want to provide a constant function, associated to the zero eigenvalue, as the deflation space? I’m trying to understand the best I can what you’d like to do, so that the solution I come up with satisfies your needs.

I think that the same arguments as the EPSSetDeflationSpace are the best option.

This is not really answering my question. What kind of deflation space do you want to provide?

Just FYI, it will not be possible to match the SLEPc interface, because there is no EPS type in the FreeFEM language, only Mat. What I currently have in mind is something like PetscScalar[int,int] space(n, m); EPSSolve(A, B, deflation = space);, which will internally call EPSSetDeflationSpace before EPSSolve.

Is that space(n,m) a set of vectors? In that case, I think that is the best option.

Yes, exactly, for your Neumann problem, I think it would read:

real[int, int] space(A.n, 1);
space(:, 0) = 1; // constant function
EPSSolve(A, B, deflation = space);

This is now implemented, cf. the modified example laplace-2d-SLEPc.edp. You can of course supply a deflation space of dimension greater than 1. It must be supplied in PETSc numbering.