[petsc-users] combine two matrices with different non-zero structure

Smith, Barry F. bsmith at mcs.anl.gov
Mon Jan 29 22:12:44 CST 2018


  Marius,

    We don't provide a way to insert a "generic" sparse matrix into a bigger matrices (dense matrices coming from element stiffness matrices yes) so I don't see any simple solution. Does the submatrix you pull out have any particular structure, what does it represent?

  Barry

> On Jan 29, 2018, at 7:34 PM, Marius Buerkle <mbuerkle at web.de> wrote:
> 
> Hi !
>  
> I have the followng problem. I create a Submatrix containing a subset of row/columns of the original matrix. After some matrix multiplications the non-zero strucutre of the resulting matrix changed. Now I want to insert this submatix back into the original one keeping only the non-zero entries which are present in the original matrix discarding the others which accumulated due to the matrix multiplications. Is there an easy or also not so easy way to do this ?
>  
> Best,
> Marius



More information about the petsc-users mailing list