<div dir="ltr"><div>PCComposite is probably the answer</div><div><br></div><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCCOMPOSITE.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCCOMPOSITE.html</a><br>
<div><br></div><div>The multiplicative variant will call one after the other. In order to nest it you may have to register your own custom type rather than using shell; this is doable with</div><div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCRegister.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCRegister.html</a><br>
</div><div><br></div><div>- Peter</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 22, 2014 at 9:43 AM, Qin Lu <span dir="ltr"><<a href="mailto:lu_qin_2000@yahoo.com" target="_blank">lu_qin_2000@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div>
Hello,</div><div> </div><div>I need to implement a 2-stage preconditioner using PETSc linear solver:</div><div> </div><div>1. The first stage uses a user-provided preconditioner routine. It seems I can set it with PCShellSetApply.</div>
<div>2. The second stage uses PETSc's ILU.</div><div> </div><div>Shall I just call this two preconditioners in sequence, or there is a <span><span>particular</span></span> way to hook them up? Is there any sample code for this?</div>
<div> </div><div>Many thanks for your suggestions.</div><div> </div><div>Best Regards, </div><div>Qin</div></div></div></blockquote></div><br></div>