mixed matrix type?
sdettrick at gmail.com
Wed May 21 11:14:41 CDT 2008
I have a sparse N*N matrix generated from a DA and a 5 point stencil,
with a total of approx 5*N non-zero entries. Now I would like to
extend this matrix by adding a smaller M*M dense matrix to the bottom
right hand side, i.e. so that there is a dense square in the bottom
right hand corner of the otherwise sparse matrix. The total number of
new non-zero entries, M*M, is comparable to the total number of old
entries, 5*N. On top of this, there would be a small number of non-
zero entries in the new upper-right and lower-left rectangular
portions of the matrix, due to coupling of the two systems. The new
total matrix size (including zeroes) would be (N+M)*(N+M).
Can anybody recommend a Mat type to store the new matrix?
One possibility I was thinking of was to establish the original sparse
Mat with a DA in a sub-communicator (with half the CPUs), and get the
ownership range with MatGetOwnershipRange. Then in the
petsc_comm_world communicator, the complete matrix could be
constructed (by element-wise copying the old one I suppose), and the
ownership range could be maintained manually.
Does this sound like a reasonable strategy?
I would very much appreciate any suggestions or advice.
More information about the petsc-users