[petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

Gautam Bisht gbisht at lbl.gov
Tue Apr 26 09:50:48 CDT 2016

I want to follow up on this old thread. If a user knows the exact fill
pattern of the off-diagonal block (i.e. d_nz+o_nz  or d_nnz+o_nnz ), can
one still not preallocate memory for the off-diagonal matrix when using


On Tue, Sep 30, 2014 at 3:48 PM, Jed Brown <jed at jedbrown.org> wrote:

> Gautam Bisht <gbisht at lbl.gov> writes:
> > Hi,
> >
> > The comment on line 419 of SNES ex 28.c
> > <
> http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex28.c.html
> >
> > says
> > that the approach used in this example is not the best way to allocate
> > off-diagonal blocks. Is there an example that shows a better way off
> > allocating memory for off-diagonal matrix blocks when using DMComposite?
> The problem is that the allocation interfaces specialize on the matrix
> type.  Barry wrote a DMCompositeSetCoupling(), but there are no
> examples.  This is something that PETSc needs to improve.  I have been
> unsuccessful at conceiving a _simple_ yet flexible/extensible solution.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160426/03642766/attachment.html>

More information about the petsc-users mailing list