<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div><span>About 1, I don't get it. How does PETSc know what unknowns the first preconditioner solves? i.e., how does PETSc know the first preconditioner solves the unknowns with odd index rather than with even index? This info is necessary for updating the full residual, probably through a restriction (mapping) matrix/vector?</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Thanks,</span></div><div style="color: rgb(0,
0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Qin</span></div><div><br></div> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Barry Smith <bsmith@mcs.anl.gov><br> <b><span style="font-weight: bold;">To:</span></b> Qin Lu <lu_qin_2000@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> petsc-users <petsc-users@mcs.anl.gov> <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, June 28, 2014 12:53 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [petsc-users]
Combining preconditioners<br> </font> </div> <div class="y_msg_container"><br><br clear="none">On Jun 28, 2014, at 12:43 PM, Qin Lu <<a shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com" href="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>> wrote:<br clear="none"><br clear="none">> 1. About using PCCOMPOSITE: I didn't state correctly in my first email. Actually, the rank of first preconditioner matrix is, say, half of the rank of the full matrix (the latter is used as the second preconditioner matrix), and the first preconditioner solves half of the unknowns (say, unknowns with odd index), how can I let PETSc know this info, so that the solution of the first preconditioner can be applied to the full matrix and update the full residual before applying the second preconditioner?<br clear="none">> <br clear="none">> In other words, does PCCOMPOSITE require that the ranks of all preconditioner matrices be the same as the full
matrix?<br clear="none"><br clear="none"> No. You don’t have to tell it anything special. <br clear="none">> <br clear="none">> 2. If I use PCFIELDSPLIT, does it also need PCCOMPOSITE to define multiple preconditioners?<br clear="none"><br clear="none"> No field split is a different way of handling multiple preconditioners<br clear="none"><br clear="none"> Barry<div class="qtdSeparateBR"><br><br></div><div class="yqt6301447027" id="yqtfd13384"><br clear="none"><br clear="none">> <br clear="none">> Thanks a lot,<br clear="none">> Qin<br clear="none">> <br clear="none">> From: Barry Smith <<a shape="rect" ymailto="mailto:bsmith@mcs.anl.gov" href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br clear="none">> To: Qin Lu <<a shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com" href="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>> <br clear="none">> Cc: petsc-users <<a
shape="rect" ymailto="mailto:petsc-users@mcs.anl.gov" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> <br clear="none">> Sent: Friday, June 27, 2014 11:41 PM<br clear="none">> Subject: Re: [petsc-users] Combining preconditioners<br clear="none">> <br clear="none">> <br clear="none">> On Jun 27, 2014, at 11:22 PM, Qin Lu <<a shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com" href="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>> wrote:<br clear="none">> <br clear="none">> > Hello,<br clear="none">> > <br clear="none">> > I would like to combine two preconditioners in PETSc linear solver. The first preconditioner is user defined, the second one is just PETSc ILU, and the residual is updated after application of each preconditioner (the multiplicative form). There are two questions:<br clear="none">> > <br clear="none">> > 1. Shall I use PCShellSetApply to set the user
defined preconditioner, and then use PCCompositeAddPC to combine the 2 preconditioners?<br clear="none">> <br clear="none">> Yes<br clear="none">> <br clear="none">> > 2. The user defined preconditioner only applies to part of the components of the unknowns, in other words, the rank of the first preconditioner matrix is less than the rank of the full matrix. How can I let PETSc know how to update the residual after the application of the first preconditioner? Can I define a routine of residual updating for PETSc?<br clear="none">> <br clear="none">> At first just use PCCOMPOSITE and let PETSc compute the residual by doing the usual complete matrix-vector product. Usually the cost of the matrix vector product is much less then a preconditioner so it is not worth optimizing.<br clear="none">> <br clear="none">> If the composed preconditioner works very well and the shell PC affects only a small percentage of
the components of the problem then you can switch to PCFIELDSPLIT which does support only updating a portion of the residual.<br clear="none">> <br clear="none">> Barry<br clear="none">> <br clear="none">> <br clear="none">> > <br clear="none">> > Many thanks for your help.<br clear="none">> > <br clear="none">> > Best Regards,<br clear="none">> > Qin<br clear="none">> <br clear="none">> <br clear="none"></div><br><br></div> </div> </div> </div></body></html>