[petsc-users] How to efficiently assemble this matrix?

Jed Brown jed at jedbrown.org
Thu Jul 17 08:54:37 CDT 2014


Italo Tasso <bichinhoverde at spwinternet.com.br> writes:

> I have two matrices: matrix A is 4n x 4n and matrix C is n x n. I want to
> set the values of A using the values of C, like this:
>
> A[4i+k][4j+k] = C[i][j]
> 0 < i < n
> 0 < j < n
> 0 < k < 3

MatCreateMAIJ(C,4,&A)

will create this linear operator in O(1) time and space (just
referencing C).  Is that what you want?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140717/ca3a9779/attachment.pgp>


More information about the petsc-users mailing list