On Fri, Feb 10, 2012 at 3:08 PM, Dmitry Karpeev <span dir="ltr"><<a href="mailto:karpeev@mcs.anl.gov">karpeev@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div><div class="h5">On Fri, Feb 10, 2012 at 12:13 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div class="gmail_quote">On Fri, Feb 10, 2012 at 00:05, Dmitry Karpeev <span dir="ltr"><<a href="mailto:karpeev@mcs.anl.gov" target="_blank">karpeev@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>I don't think so.  Preallocating doesn't set any values and seems to leave the matrix marked !assembled.</div>

<div>MatDuplicate for such a matrix will fail.  Assemblying it before setting values (just to force an assembled flag)</div><div>will squeeze out the extra values, won't it?  I think it would just be reasonable to allow to duplicate unassembled</div>





<div>matrices, or, better yet, have a matrix be "assembled" by default until MatSetValues has been called.</div><div>But I'm not sure whether either solution will break something else.</div></blockquote></div>



<br></div><div>Are you calling DMSetMatrixPreallocateOnly()?</div><div><br></div></blockquote></div></div><div>What I'm talking about is an implementation issue, rather than a question of what the user should expect from the DMGetMatrix API: I have a matrix that has been preallocated by libMesh based on its mesh connectivity, but it </div>


<div>has not been assembled. If I didn't want to return it in DMGetMatrix, but rather to duplicate it, Id be out of luck:</div><div>that matrix is not "assembled", hence, cannot be duplicated.  This, in fact, has little to do with the DM interface.</div>


<div>The question is: should we be able to duplicate such "unassambled" matrices? Or should they even be call "unassembled"?</div></div></blockquote><div><br></div><div>In fact, preallocated matrices, obtained from DMGetMatrix, can be copied. If that solves the problem, we are done.</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"><div class="gmail_quote"><span class="HOEnZb"><font color="#888888"><div>Dmitry.</div>
</font></span></div></blockquote></div>-- <br>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<br>