<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 26 April 2016 at 16:50, Gautam Bisht <span dir="ltr"><<a href="mailto:gbisht@lbl.gov" target="_blank">gbisht@lbl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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></blockquote><div><br></div><div>You are always free to over-ride the method<br></div><div> dm->ops->creatematrix<br></div><div>with your own custom code to create <br>and preallocate the matrix.<br><br></div>You will need to add<br></div><div class="gmail_quote"> #include <petsc/private/dmimpl.h><br></div><div class="gmail_quote">into your source file to expose the contents of the DM object.<br></div><div class="gmail_quote"><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span><font color="#888888"><div><br></div><div>-Gautam.</div></font></span></div><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>Gautam Bisht <<a href="mailto:gbisht@lbl.gov" target="_blank">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>> 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>
</div></div></blockquote></div><br></div></div>