[petsc-users] assemble block matrices

Shao-Ching Huang huangsc at gmail.com
Wed Oct 27 18:09:25 CDT 2010


Hi,

I need to solve M*x=f, where matrix M consists of 4 blocks:
[ A B;
 C D ]

I already have old code to build petsc sparse matrices A, B, C and D
and the RHS vectors f1 and f2
(such that f=[f1; f2]), each having global indices starting from 0.

My question is: is there already API(s) that I can easily assemble
matrices A,B,C and D into M? Or do I have to build M from scratch?

Thanks,

Shao-Ching


More information about the petsc-users mailing list