Dynamic allocation of Non zeros?

Matthew Knepley knepley at gmail.com
Thu Nov 1 18:05:07 CDT 2007

The short answer is that preallocation looks exactly like an assembly, but
individual values are not calculated, just sizes. You can look at the routines
I have for this for the Mesh class in preallocateOperator() in


On Nov 1, 2007 4:17 PM, Berend van Wachem <berend at chalmers.se> wrote:
> Hi Barry,
> >     Perhaps you could describe how your matrix entries are generated and
> > we can suggest a
> > preallocation scheme?
> Are there examples of preallocation schemes for PETSc? For instance, if
> I would like to solve Poisson equation on an irregular grid (9 point
> stencil in 2d and 27 in 3d) on n processors?
> Thanks,
> Berend.

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

More information about the petsc-users mailing list