[petsc-users] transformation of Mat into BlockMat

Jed Brown jed at jedbrown.org
Fri Sep 30 07:58:02 CDT 2016


alena kopanicakova <alena.kopanicakova13 at gmail.com> writes:

> 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.

MatCreateMAIJ

> 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?

http://www.mcs.anl.gov/petsc/documentation/faq.html#efficient-assembly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160930/bcf465c6/attachment.pgp>


More information about the petsc-users mailing list