On Mon, Jun 20, 2011 at 11:16 PM, Mohammad Mirzadeh <span dir="ltr">&lt;<a href="mailto:mirzadeh@gmail.com">mirzadeh@gmail.com</a>&gt;</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;">
<div dir="ltr">Matt,<div><br></div><div>I see. Please forgive my ignorance, but I don&#39;t quite understand why you should not be able to set a tolerance for it. Could you please point me to the source file that applies the MAT_IGNORE_ZERO_ENTRIES option to the matrix? I may be able to manually modify it.</div>
</div></blockquote><div><br></div><div>src/mat/impls/aij/seq/aij.c. Search for ignorezeroentries. I think changing it here would be bad design. Its simple</div><div>to process your input matrix to MatSetValues() to chop small values to 0.0</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 dir="ltr"><div>Thanks,</div><div>Mohammad<div><div></div><div class="h5">
<br><br><div class="gmail_quote">On Mon, Jun 20, 2011 at 2:34 PM, Matthew Knepley <span dir="ltr">&lt;<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Jun 20, 2011 at 9:31 PM, Mohammad Mirzadeh <span dir="ltr">&lt;<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>&gt;</span> wrote:<br>


</div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks John -- taht&#39;s helpful. Do you also know how I can change the tolerance for dropping elements?</div></blockquote><div><br></div></div><div>Right now, this only discards entires which are exactly floating point 0.0.</div>



<div><br></div><div>   Matt</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Mohammad<br><br><div class="gmail_quote">

On Mon, Jun 20, 2011 at 1:12 PM, John Mousel <span dir="ltr">&lt;<a href="mailto:john.mousel@gmail.com" target="_blank">john.mousel@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2">See the matrix options available in the man pages. I think the function below is what you are looking for.<br>





<br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetOption.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetOption.html</a></font><br>






<pre width="80"><font size="2"><br style="font-family:arial,helvetica,sans-serif"><a style="font-family:arial,helvetica,sans-serif" href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetOption.html#MatSetOption" target="_blank">MatSetOption</a><span style="font-family:arial,helvetica,sans-serif">(A,MAT_IGNORE_ZERO_ENTRIES,</span><a style="font-family:arial,helvetica,sans-serif" href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE" target="_blank">PETSC_TRUE</a><span style="font-family:arial,helvetica,sans-serif">);</span></font><br>






</pre><br><br>Best Regards,<br><font color="#888888">John</font><div><div></div><div><br><br><br><br><div class="gmail_quote">On Mon, Jun 20, 2011 at 2:42 PM, Mohammad Mirzadeh <span dir="ltr">&lt;<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div dir="ltr">Hi folks,<div><br></div><div>I&#39;ve noticed that MatSetValues explicitly inserts zeros in the matrix if an element is really zero. Is there a way to drop elements (or not save them in the first place) that are below a certain tolerance? I realize one way of doing it is in the application code and when using MatSetValues but I&#39;m just wondering if PETSc has a function for it?</div>








<div><br></div><div>Thanks,</div><div>Mohammad</div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div></div>
</blockquote></div></div><font color="#888888"><br><br clear="all"><br>-- <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>

</font></blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <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>