<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">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">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">PETSC_TRUE</a><span style="font-family: arial,helvetica,sans-serif;">);</span></font><br>
</pre><br><br>Best Regards,<br>John<br><br><br><br><div class="gmail_quote">On Mon, Jun 20, 2011 at 2:42 PM, Mohammad Mirzadeh <span dir="ltr"><<a href="mailto:mirzadeh@gmail.com">mirzadeh@gmail.com</a>></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'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'm just wondering if PETSc has a function for it?</div>
<div><br></div><div>Thanks,</div><div>Mohammad</div></div>
</blockquote></div><br>