[petsc-users] extract preconditioner matrix

Barry Smith bsmith at petsc.dev
Wed Dec 14 20:33:50 CST 2022



> On Dec 14, 2022, at 9:10 PM, 김성익 <ksi2443 at gmail.com> wrote:
> 
> Hello,
> 
> 
> 
> I tried to find the way to adapt my own preconditioner.
> In other words, I want to apply and solve a new preconditioner rather than using the existing one in Petsc.
> 
> So, my questions are as below
> 1. Is this possible to adapt my own preconditioner??

   There are a variety of ways to provide your own preconditioner; you can use https://petsc.org/release/docs/manualpages/PC/PCSHELL/ and take the preconditioner completely in your own hands. But often one builds a preconditioner by combining multiple simpler preconditioners: for example PCFIELDSPLIT discuss in https://petsc.org/release/docs/manual/ksp/, even block Jacobi https://petsc.org/release/docs/manualpages/PC/PCBJACOBI/#pcbjacobi is built up with smaller preconditioners.  

  What particular type of preconditioner are you planning to build? Other users may have ideas on how to do it.
> 
> 2. Also is it possible to extract preconditioner matrix created in Petsc?

I'm not sure what you mean by this. Preconditioners are very rarely represented directly by a matrix (that would be too inefficient). Rather one provides functions that apply the action of the preconditioner. As noted above one provides such functions in PETSc using https://petsc.org/release/docs/manualpages/PC/PCSHELL/.  


> 
> 3. Is this possible to separate preconditioning & solving procedure to check the result of each process in Petsc??

   The KSP and the PC work together to provide an over all good solver. One can focus on the preconditioner's quality by using it with several different Krylov methods. For example the KSPRICHARDSON (-ksp_typre richardson) does essentially nothing so the convergence (or lack of convergence) is determined by the preconditioner only. For non positive definite matrices https://petsc.org/release/docs/manualpages/KSP/KSPBCGS/#kspbcgs is generally weaker than  https://petsc.org/release/docs/manualpages/KSP/KSPGMRES/#kspgmres so how your preconditioner works with these two different KSP methods can help you evaluate the preconditioner.

  Feel free to ask more detailed questions as you use the PETSc solvers,

  Barry

> 
> 
> Thanks,
> Hyung Kim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221214/622f2e27/attachment.html>


More information about the petsc-users mailing list