<div class="gmail_quote">On Sat, Jan 28, 2012 at 10:11, Stefano Zampini <span dir="ltr"><<a href="mailto:stefano.zampini@gmail.com">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">
<div id=":4sy">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></div></blockquote><div><br></div><div>I couldn't reproduce this with a modified src/ksp/ksp/examples/tutorials/ex2.c</div>
<div><br></div><div>MatSetUpPreallocation() should be sufficient in other cases.</div></div>