[petsc-users] MatSetValues and Zero enteries

Mohammad Mirzadeh mirzadeh at gmail.com
Mon Jun 20 16:31:54 CDT 2011


Thanks John -- taht's helpful. Do you also know how I can change the
tolerance for dropping elements?

Mohammad

On Mon, Jun 20, 2011 at 1:12 PM, John Mousel <john.mousel at gmail.com> wrote:

> See the matrix options available in the man pages. I think the function
> below is what you are looking for.
>
>
> http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetOption.html
>
>
> MatSetOption <http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetOption.html#MatSetOption>(A,MAT_IGNORE_ZERO_ENTRIES,PETSC_TRUE <http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE>);
>
>
>
> Best Regards,
> John
>
>
>
>
> On Mon, Jun 20, 2011 at 2:42 PM, Mohammad Mirzadeh <mirzadeh at gmail.com>wrote:
>
>> Hi folks,
>>
>> 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?
>>
>> Thanks,
>> Mohammad
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110620/96c98c1f/attachment.htm>


More information about the petsc-users mailing list