<div dir="ltr"><div dir="ltr">On Mon, Feb 8, 2021 at 7:04 AM Florian Bruckner <<a href="mailto:e0425375@gmail.com">e0425375@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear PETSc / SLEPc Users,</div><div><br></div><div>my question is very similar to the one posted here: <br></div><div><a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2018-August/035878.html" target="_blank">https://lists.mcs.anl.gov/pipermail/petsc-users/2018-August/035878.html</a></div><div><br></div><div>The eigensystem I would like to solve looks like:</div>B0 v = 1/omega A0 v<div>B0 and A0 are both hermitian, A0 is positive definite, but only given as a linear operator (matshell). I am looking for the largest eigenvalues (=smallest omega). <br></div><div><br></div><div>I also have a sparse approximation P0 of the A0 operator, which i would like to use as precondtioner, using something like this:</div><div><br></div><div> es = SLEPc.EPS().create(comm=fd.COMM_WORLD)<br> st = es.getST()<br> ksp = st.getKSP()<br> ksp.setOperators(self.A0, self.P0)<br></div><div><br></div><div>Unfortunately PETSc still complains that it cannot create a preconditioner for a type 'python' matrix although P0.type == 'seqaij' (but A0.type == 'python'). <br></div><div>By the way, should P0 be an approximation of A0 or does it have to include B0?</div><div><br></div><div>Right now I am using the krylov-schur method. Are there any alternatives if A0 is only given as an operator?</div></div></blockquote><div><br></div><div>Jose can correct me if I say something wrong.</div><div><br></div><div>When I did this, I made a shell operator for the action of A0^{-1} B0 which has a KSPSolve() in it, so you can use your P0 preconditioning matrix, and</div><div>then handed that to EPS. You can see me do it here:</div><div><br></div><div> <a href="https://gitlab.com/knepley/bamg/-/blob/master/src/coarse/bamgCoarseSpace.c#L123">https://gitlab.com/knepley/bamg/-/blob/master/src/coarse/bamgCoarseSpace.c#L123</a></div><div><br></div><div>I had a hard time getting the embedded solver to work the way I wanted, but maybe that is the better way.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>thanks for any advice<br></div><div>best wishes</div><div>Florian<br></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>