I am currently trying to code the CA-CG method within the PETSc framework. A mandatory step in this process is the implementation of the "matrix powers kernel" algorithm for a generic sparse matrix.

This requires the computation of the index set obtained exploring the graph associated with the sparse matrix for s-steps, starting from the index set of the local rows "owned" by each process.

Is there a clean way to retrieve this kind of information using the PETSc API?


Use MatIncreaseOverlap() just like PCASM (additive Schwarz preconditioner) to get the overlapping region, then MatGetSubMatrices() (also like PCASM) to pull out the overlapping part of the matrix.

For further technical discussion of implementation, we encourage you to subscribe to petsc-dev@mcs.anl.gov or just email petsc-maint@mcs.anl.gov.

| cite | improve this answer | |
  • $\begingroup$ Many thanks! That worked out exactly as expected. $\endgroup$ – Massimiliano Aug 22 '12 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.