[petsc-users] transformation of Mat into BlockMat

alena kopanicakova alena.kopanicakova13 at gmail.com
Fri Sep 30 00:46:40 CDT 2016


Hello,

I have parallel matrix, let's say

a b
c d

I would like to extend it to block matrix with structure as (bs = 3):

a 0 0 b 0 0
0 a 0 0 b 0
0 0 a 0 0 b
c 0 0 d 0 0
0 c 0 0 d 0
0 0 c 0 0 d

Result is basically kron. product with ident.
At the moment, I am just creating new mat with size bs-times bigger than
initial and MatSetValues to proper places. It seems, that this is very
inefficient and time consuming.
I wonder, is there any trick, how to perform assembly efficiently?

thanks for suggestions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160930/9dffbd43/attachment.html>


More information about the petsc-users mailing list