<div dir="ltr">Hi!<br><br>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).<br>
<br>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<br><br>A_c == P^T*A*P<br><br>and<br><br>A_c != R*A*P<br>
<br>My question is: Why is A_c equal to P^T*A*P when I have set an R which differs from P^T?<br><br>Here is how I extract the matrices from the KSP and PC structures (variable names ksp and pc, respectively):<br><br>* To get A:<br>
Mat A;<br>KSPGetOperators(ksp, &A, 0, 0);<br><br>* To get A_c:<br>KSP ksp_c;<br>PCMGGetCoarseSolve(pc, &ksp_c)<br>Mat A_c;<br>KSPGetOperators(ksp_c, &A_c, 0, 0);<br><br>* To get P:<br>Mat P;<br>PCMGGetInterpolation(pc, 1, &P);<br>
<br>* To get R:<br>Mat R;<br>PCMGGetRestriction(pc, 1, &R);<br><br>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.<br><br>
Petsc version is 3.4.3.<br><br>Best regards<br>Torquil Sørensen<br><br></div>