On Sat, Jan 28, 2012 at 10:11 AM, Stefano Zampini <span dir="ltr"><<a href="mailto:stefano.zampini@gmail.com">stefano.zampini@gmail.com</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">
Hi Jed,<br><br>you can use any code which calls the following sequence<br><br>ierr = MatCreate(PETSC_COMM_SELF,&mat);CHKERRQ(ierr);<br>ierr = MatSetSize(mat,n,m,n,m);CHKERRQ(ierr);<br>ierr = MatSetType(mat,MATSEQDENSE);CHKERRQ(ierr);<br>
-> Then a loop to set values<br>ierr = MatAssemblyBegin(mat);CHKERRQ(ierr);<br>ierr = MatAssemblyEnd(mat);CHKERRQ(ierr);<br>
<br>If you don't insert a "dummy" call to MatSeqDenseSetPreallocation(mat,PETSC_NULL) before doing the insertion loop, it will give an error.<br></blockquote><div><br></div><div>I think MatSetUpPreallocation() would work. If we are requiring this, what about having it called in</div>
<div>MatSetFromOptions().</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">Stefano<div class="HOEnZb"><div class="h5">
<br><br><div class="gmail_quote">2012/1/28 Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span><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 Sat, Jan 28, 2012 at 05:40, Stefano Zampini <span dir="ltr"><<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm getting errors when not preallocating for MATSEQDENSE matrices. Is it what you want with dense matrices too?</blockquote></div><br></div><div>What can I run to see the error?</div>
</blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>Stefano<br>
</font></span></blockquote></div><br><br clear="all"><div><br></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>