<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">Dear, <br><br>First two answers are appreciated; </span></span></span><span style="color: rgb(0, 0, 255);"><br><br></span> <br><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">And last one is more appreciated; <br></span></span></span><span style="color: rgb(0, 0, 255);">-mg_levels_1_ksp_type cg can this be written in routine ? yes, with KSPSetType() but which ksp-context ? ksp_pre ? <br><br>My Preconditioner: <br></span><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span
style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">I need a preconditioner which read as: Prec = \lambda_max*C + (I - AC) , [C = CGC] where </span></span></span><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">(I - AC) deflates spectrum to zero, <br>
and this part </span></span></span><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">\lambda_max *C then shifts spectrum to \lambda_max (which is always 1 in my case) . <br>Dont I get my Prec by multiplicative combination of CGC with post smoother S = Identity using mg_type_</span></span></span><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">multiplicative</span></span></span><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);"> ? <br><br>Thanks in anticipation, <br>regards, Abdul </span></span></span><span style="background-color: rgb(0, 0, 255); font-family:
verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">multiplicative_</span></span></span><br><br><br><br><br><br><br><div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div> <font size="2" face="Arial"> <hr size="1"><b><span style="font-weight:bold;"></span></b></font><span>I dont want to try snes, since my problem is linear,</span></div><div id="yiv746560470"><div class="yiv746560470gmail_quote"><div><br></div><div>Note that you can still use SNES for linear problems. (I prefer the interface, you can choose -snes_type ksponly so there is no extra overhead, but use whatever you like.)</div>
<div><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">Thanks!</span></span></span><span style="font-family: verdana,helvetica,sans-serif;"> </span><br></div><blockquote class="yiv746560470gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><span> but I successfully applied the KSP</span></div><div><span>preconditioned with PCMG (not kaskade, but multiplicative; for some reasons) .</span></div>
<div><span>I make pre-smoother dummy by setting KSP_PRE context as PREONLY alongwith PCNONE. <br></span></div></blockquote><div><br></div><div>You can just set the number of pre-smoothing steps to 0.</div><div> <span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);">Done! :-) <br></span></span></span></div><blockquote class="yiv746560470gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><span></span></div><div><span>CGC and post-smoother serves my purpose to apply preconditioner</span></div><div><span>Prec = </span><span>I - A*P*(A_H)^-1 * R with KSP_POST as RICHARDSON alongwith PCNONE. <br></span></div>
</blockquote><div><br></div><div>Read my last message again. You either want the additive</div><div><br></div><div>Prec = I + C</div><div><br></div><div>(where C = P*A_H^{-1}*R is the coarse solve) or the multiplicative</div>
<div><br></div><div>Prec = C + S (I - A C)</div><div><br></div><div>perhaps with S = I (or some scaling factor). I don't think your definition of Prec makes sense or is the operation that you intend to be applying.</div>
<div><span style="background-color: rgb(0, 0, 255); font-family: verdana,helvetica,sans-serif;"><span style="color: rgb(0, 0, 255);"><span style="background-color: rgb(255, 255, 255);"><br></span></span></span></div><blockquote class="yiv746560470gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><span></span></div><div><span>I hope PCNONE make smoother S = I in the framework you suggested earlier i.e. <br>
</span></div><div>C b + S (b - A C b)~~~~~~ where C is read as CGC. <br></div><div>It seems working well with levels 2, but
when I force RICHARDSON_max_it 0. To my understanding, it should work with RICHARDSON_max_it = 1; </div></blockquote><div><br></div><div>Read through my last message again. I explained that this does not work and that it is caused by the destabilizing effect of the extra multiply without a smoother. You can fix it for easy problems with -mg_levels_ksp_richardson_self_scale.</div>
<div> </div><blockquote class="yiv746560470gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>What if I want to approximate my all coarse matrices with any Krylov iteration ?</div></blockquote><div>
<br></div><div>The methods on each level are independent, you can set them with -mg_coarse_ksp_type gmres -mg_levels_1_ksp_type cg -mg_levels_1_ksp_max_it 100 -mg_levels_2_ksp_type minres ... </div></div><br>
</div><br><br> </div> </div> </blockquote></div> </div></body></html>