[petsc-users] Adding rows and columns to a matrix

Barry Smith bsmith at mcs.anl.gov
Thu Sep 3 19:11:14 CDT 2015


  You might also consider the MatNest object. It's job is to help construct matrices that have a natural set of sub matrices such as yours. Also look at MatGetLocalSubMat()

  Barry


> On Sep 3, 2015, at 6:52 PM, David Knezevic <david.knezevic at akselos.com> wrote:
> 
> I need to add Lagrange multipliers to an existing system of equations, which requires me to expand the matrix.
> 
> I figured I would allocate a new larger matrix with the appropriate non-zero structure, and then copy the entries from the smaller matrix over to it. But I was wondering if there might be a better way to do this?
> 
> Thanks,
> David
> 
> 



More information about the petsc-users mailing list