[petsc-users] Global matrix from global sub-matrices
Matthew Knepley
knepley at gmail.com
Tue May 5 15:40:46 CDT 2015
On Tue, May 5, 2015 at 3:34 PM, Bikash Kanungo <bikash at umich.edu> wrote:
> Hi,
>
> I have four global matrices: A (mxm), B (mxn), C (nxm) and D (nxn). All of
> these are of type MATMPIAIJ (sparse parallel matrix) created using number
> of global rows and columns. I want to construct an (m+n)x(m+n) global
> matrix called M which would have A, B, C and D as its sub-matrices in
> clockwise fashion starting from A at the upper-left. What can be the best
> way to construct M from A, B, C and D sub-matrices?
>
There are at least two ways:
1) Use
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetLocalSubMatrix.html
to get a view
into the matrix for each submatrix A, B, C, D
2) Use
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateNest.html
Thanks,
Matt
> Thanks,
> Bikash
>
> --
> Bikash S. Kanungo
> PhD Student
> Computational Materials Physics Group
> Mechanical Engineering
> University of Michigan
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150505/70defe65/attachment-0001.html>
More information about the petsc-users
mailing list