<div dir="ltr">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 DMComposite?<div><br></div><div>-Gautam.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 30, 2014 at 3:48 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Gautam Bisht <<a href="mailto:gbisht@lbl.gov">gbisht@lbl.gov</a>> writes:<br>
<br>
> Hi,<br>
><br>
> The comment on line 419 of SNES ex 28.c<br>
</span>> <<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex28.c.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex28.c.html</a>><br>
<span class="">> says<br>
> that the approach used in this example is not the best way to allocate<br>
> off-diagonal blocks. Is there an example that shows a better way off<br>
> allocating memory for off-diagonal matrix blocks when using DMComposite?<br>
<br>
</span>The problem is that the allocation interfaces specialize on the matrix<br>
type.  Barry wrote a DMCompositeSetCoupling(), but there are no<br>
examples.  This is something that PETSc needs to improve.  I have been<br>
unsuccessful at conceiving a _simple_ yet flexible/extensible solution.<br>
</blockquote></div><br></div>