[petsc-users] change matrix

Barry Smith bsmith at petsc.dev
Mon Aug 31 13:55:57 CDT 2020


  Kun,

   This is not possible, PETSc matrices have a static size (resizing in parallel is tricky so we don't support it). 

   If it is more efficient to reuse the matrix entries than recompute them you can create a larger matrix and then loop over the old matrix calling MatGetRow() and then call MatSetValues() to copy that row into the new matrix.

  Barry


> On Aug 31, 2020, at 1:51 PM, Kun Jiao via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Hi Petsc Experts,
>  
> Trying to do something like appending some rows (~100 rows) to an already created matrix, but could not find any document about it.
>  
> Could anyone provide some information about it?
>  
> Regards,
> Kun
> 
> Schlumberger-Private

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200831/4ec2afc1/attachment.html>


More information about the petsc-users mailing list