[petsc-dev] MatAssembly removes all preallocation info

Matthew Knepley knepley at gmail.com
Mon Sep 25 10:43:28 CDT 2017


On Mon, Sep 25, 2017 at 11:39 AM, Kong, Fande <fande.kong at inl.gov> wrote:

> Hi All,
>
> A matrix is created with the right preallocation, and then MatAssembly is
> called. The preallocation info will be removed. We insert any values then,
> and will encounter an malloc error.
>
> My question is that we was intending to design like this way? Attached
> simple example demonstrates what I am talking about.
>

Yes, this is the intent. Why are you assembling? Could you use
MAT_ASSEMBLY_FLUSH?

  Matt


>
> Fande,
>



-- 
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

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170925/21ee5062/attachment.html>


More information about the petsc-dev mailing list