[petsc-users] Restriction matrix not involved in system matrix coarsening?

Torquil Macdonald Sørensen torquil at gmail.com
Fri Jan 24 13:28:02 CST 2014


Hi!

I'm experimenting with the PCMG preconditioner with two levels. I have
created a system matrix A, an interpolation matrix P and a restriction
matrix R which differs from P^T. In addition, I have included
PCMGSetGalerkin(pc, PETSC_TRUE).

When I extract the system matrix A, interpolation matrix P, restriction
matrix R and coarse system matrix A_c from the KSP and PC structures, and
test them in Matlab, I get

A_c == P^T*A*P

and

A_c != R*A*P

My question is: Why is A_c equal to P^T*A*P when I have set an R which
differs from P^T?

Here is how I extract the matrices from the KSP and PC structures (variable
names ksp and pc, respectively):

* To get A:
Mat A;
KSPGetOperators(ksp, &A, 0, 0);

* To get A_c:
KSP ksp_c;
PCMGGetCoarseSolve(pc, &ksp_c)
Mat A_c;
KSPGetOperators(ksp_c, &A_c, 0, 0);

* To get P:
Mat P;
PCMGGetInterpolation(pc, 1, &P);

* To get R:
Mat R;
PCMGGetRestriction(pc, 1, &R);

Then I output each of these to Matlab format, and check the different
products P^T*A*P and R*A*P there to find out which one coincides with A_c.

Petsc version is 3.4.3.

Best regards
Torquil Sørensen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140124/d1271d1f/attachment.html>


More information about the petsc-users mailing list