<div class="gmail_quote">On Wed, Apr 13, 2011 at 12:02,  <span dir="ltr">&lt;<a href="mailto:domenico.borzacchiello@univ-st-etienne.fr">domenico.borzacchiello@univ-st-etienne.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":33x">I checked it and noticed that I was using an unnecessary stencil width of<br>
2 (Box) and having 4 DOFs gave me a 4x5^3 = 500 non zero entries per row.<br>
But even if I set it to 1 and Star it&#39;ll result in 4x7 = 28 nnz while I<br>
need 17 at most. This means my matrices will always be double the needed<br>
size (roughly). How can I control this?</div></blockquote></div><div><br></div>You can use <a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/DM/DMDASetBlockFills.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/DM/DMDASetBlockFills.html</a> (named DASetBlockFills in petsc-3.1) with the AIJ matrix format. But the storage costs are quite similar if you store those extra few nonzeros and use the BAIJ format, and then you benefit from faster sparse matrix kernels so the actual run time could be less than using the less regular nonzero structure in AIJ. Also, BAIJ smooths all the components together which makes the smoother stronger, thus you may converge in fewer iterations.