<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 24, 2017 at 4:21 PM, Matteo Semplice <span dir="ltr"><<a href="mailto:matteo.semplice@unito.it" target="_blank">matteo.semplice@unito.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<br>
The manual for DMCreateMatrix says "Notes: This properly preallocates the number of nonzeros in the sparse matrix so you do not need to do it yourself", so I got the impression that one does not need to call the preallocation routine for the matrix and indeed in most examples listed in the manual page for DMCreateMatrix this is not done or (KSP tutorial ex4) it is called declaring 0 entries per row.<br>
<br>
However, if read in a mesh in a DMPlex ore create a DMDA and then call DMCreateMatrix, the resulting matrix errors out when I call MatSetValues. I have currently followed the suggestion of the error message and call MatSetOption(A, MAT_NEW_NONZERO_ALLOCATION_ERR<wbr>, PETSC_FALSE), but I'd like to fix this properly.<br></blockquote><div><br></div><div>It sounds like your nonzero pattern does not obey the topology. What nonzero pattern are you trying to input?</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How should I interpret that note in the manual?<br>
<br>
Thanks,<br>
<br>
    Matteo<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>