[petsc-dev] How to get L and D from cholesky factorisation ?

Franck Houssen franck.houssen at inria.fr
Thu Aug 24 09:46:23 CDT 2017


How to get L (as a Mat) and D (probably as a Vec) from cholesky factorisation ? 

I googled and looked in the doc but didn't find any obvious answer. I am not sure to get the steps to follow: is there a dedicated example ? 

To make it short, I have: 
PCSetType(pc, PCCHOLESKY); // LDLt 
PCFactorSetMatSolverPackage(pc, "mumps"); 
PCFactorGetMatrix(pc, &f); 
MatGetInertia(f, ....); // OK ! 

Now, I would like to get/see L and D: how to get them ? 

>From petsc/src/ksp/ksp/examples/tutorials/ex52.c, I would say MatGetDiagonal(f, D) returns D: correct ? If so, how to get L as well ? 

A related question would be : how to get L and U from a PCLU factorisation ? 

Franck 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170824/fee54fc0/attachment.html>


More information about the petsc-dev mailing list