block matrices

Hong Zhang hzhang at mcs.anl.gov
Sun Sep 21 11:50:10 CDT 2008


Manav,

On Sun, 21 Sep 2008, Manav Bhatia wrote:

> Hi,
>
>    I have an application in which I have multiple sparse matrices,
> which together form one bigger matrix. For example: if S1, S2, S3, S4
> and S5 are my sparse matrices, I need to create a matrix B of the
> following form
>
> B = 3 x 3 blocks
>
> row 1 of B = 0, S1, 0
> row 2 of B = S2, 0 , S3
> row 3 of B = S4, S5, 0
>
> If I build the S1... S5 independently, is there a way for me to
> directly embed these matrices into B without having to explicitly copy
> the values from each matrix?

No, we do not have this function.
You can use MatSetValues()
http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetValues.html

to insert a block of values.

Hong

> I would appreciate any help. Please also, let me know if there is an
> example code somewhere about this.
>
> Regards,
> Manav
>
>
>
>




More information about the petsc-users mailing list