[petsc-users] Accessing submatrices without additional memory usage

Michal Derezinski mderezin at ucsc.edu
Wed May 24 01:09:06 CDT 2017


Hi,

I want to be able to perform matrix operations on several contiguous
submatrices of a full matrix, without allocating the memory redundantly for
the submatrices (in addition to the memory that is already allocated for
the full matrix).
I tried using MatGetSubMatrix, but this function appears to allocate the
additional memory.

The other way I found to do this is to create the smallest submatrices I
need first, then use MatCreateNest to combine them into bigger ones
(including the full matrix).
The documentation of MatCreateNest seems to indicate that it does not
allocate additional memory for storing the new matrix.
Is this the right approach, or is there a better one?

Thanks,
Michal Derezinski.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170523/44c5ef32/attachment.html>


More information about the petsc-users mailing list