[petsc-users] Combining preconditioners

Qin Lu lu_qin_2000 at yahoo.com
Sat Jun 28 12:43:53 CDT 2014


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?

In other words, does PCCOMPOSITE require that the ranks of all preconditioner matrices be the same as the full matrix?

2. If I use PCFIELDSPLIT, does it also need PCCOMPOSITE to define multiple preconditioners?

Thanks  a lot,
Qin


________________________________
 From: Barry Smith <bsmith at mcs.anl.gov>
To: Qin Lu <lu_qin_2000 at yahoo.com> 
Cc: petsc-users <petsc-users at mcs.anl.gov> 
Sent: Friday, June 27, 2014 11:41 PM
Subject: Re: [petsc-users] Combining preconditioners
 


On Jun 27, 2014, at 11:22 PM, Qin Lu <lu_qin_2000 at yahoo.com> wrote:

> Hello,
> 
> 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:
> 
> 1. Shall I use PCShellSetApply to set the user defined preconditioner, and then use PCCompositeAddPC to combine the 2 preconditioners?

   Yes

> 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?

   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.

   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.

   Barry


> 
> Many thanks for your help.
> 
> Best Regards,
> Qin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140628/da04d3eb/attachment.html>


More information about the petsc-users mailing list