[petsc-users] Will unassigned slots of Mat Created by MatCreateAIJ be removed during MatAssemblyBegin - End?

Matthew Knepley knepley at gmail.com
Thu Mar 17 19:33:11 CDT 2016


On Thu, Mar 17, 2016 at 7:20 PM, Seungbum Koo <doougsini at gmail.com> wrote:

> I used to create matrix by calling MatCreateAIJ without knowing the
> exact nonzero pattern of the matrix. So I preallocate maximum nonzeros that
> can appear when creating a matrix.
>
> After setting nonzero values by MatSetValues I call MatAssemblyBegin and
> MatAssemblyEnd for actual linear algebra. Now, will the unassigned, or
> assigned by zero preallocated slots in matrix be removed? Or Will it stay
> with containing zeros?
>

If you explicitly put a 0 in there, it will stay. However, extra space you
allocated that is not filled up will be removed on MatAssembly.

  MAtt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160317/11261c0d/attachment.html>


More information about the petsc-users mailing list