block matrices

Barry Smith bsmith at mcs.anl.gov
Sun Jan 6 07:40:29 CST 2008


Gideon,

   It really depends on what you want to use this new matrix for? If  
you wish to do
matrix vector products with it then I would suggest making a shell  
matrix that then
calls the matrix vector product on each part.  In other words, if  
possible you probably
want to avoid explicitly constructing this entire new matrix, unless  
you really need
it.

    Barry


On Jan 5, 2008, at 7:54 PM, Gideon Simpson wrote:

> Suppose I have two sparse matrices A and Q and now I want to  
> construct a block diagonal matrix, K,
>
> K = 	[A,0]
> 	[0,Q]
>
> What is the "right" way to do this is?
>
>
> -Gideon Simpson
>  Department of Applied Physics and Applied Mathematics
>  Columbia University
>
>




More information about the petsc-users mailing list