<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Great thanks, Matt!</p>
<p>The second option is what I was looking for.</p>
<p><br>
</p>
<p>Best Regards,</p>
<p>Vlad</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>От:</b> Matthew Knepley <knepley@gmail.com><br>
<b>Отправлено:</b> 10 ноября 2021 г. 16:45:00<br>
<b>Кому:</b> Vladislav Pimanov<br>
<b>Копия:</b> petsc-users@mcs.anl.gov<br>
<b>Тема:</b> Re: [petsc-users] How to compute the condition number of SchurComplementMat preconditioned with PCSHELL.</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Wed, Nov 10, 2021 at 8:42 AM Vladislav Pimanov <<a href="mailto:Vladislav.Pimanov@skoltech.ru">Vladislav.Pimanov@skoltech.ru</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 id="gmail-m_-9053906504632661544divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Dear PETSc community,</p>
<p><br>
</p>
<p></p>
<span>I wonder if you could give me a hint on how to compute the condition number of a preconditioned matrix in a proper way.</span>
<p>I have a <i>MatSchurComplement</i> matrix S and a preconditioner P of the type
<i>PCSHELL</i> (P is a diffusion matrix, which itself is inverted by <i>KSPCG</i>).</p>
<p>I tried to compute the condition number of P^{-1}S "for free" during the outer PCG procedure using <span><i>KSPComputeExtremeSingularValues()</i> routine.</span></p>
<p>Unfortunately, \sigma_min does not converge even if the solution is computed with very high precision.</p>
<p><span>I also looked at SLEPc interface, but did not realised how PC should be included.</span><br>
</p>
<p></p>
</div>
</div>
</blockquote>
<div>You can do this at least two ways:</div>
<div><br>
</div>
<div>  1) Make a MatShell for P^{-1} S. This is easy, but you will not be able to use any factorization-type PC on that matrix.</div>
<div><br>
</div>
<div>  2) Solve instead the generalized EVP, S x = \lambda P x. Since you already have P^{-1}, this should work well.</div>
<div><br>
</div>
<div>  Thanks,</div>
<div><br>
</div>
<div>     Matt</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 id="gmail-m_-9053906504632661544divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Thanks!</p>
<p><br>
</p>
<p>Sincerely,</p>
<p>Vladislav Pimanov</p>
<p><br>
</p>
</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>
</div>
</body>
</html>