[petsc-users] Remove Jacobian matrix values less than tolerance

Barry Smith bsmith at mcs.anl.gov
Thu Aug 6 16:55:11 CDT 2015


> On Aug 6, 2015, at 4:16 PM, Juris Vencels <juris.vencels at gmail.com> wrote:
> 
> Hi Users,
> 
> 
> When I construct analytical Jacobian matrix it has many small values of order 1E-16.

Are the values at those locations always that small or at different Newton steps or time-steps will they be larger? Unless there are a huge number of these and you know they are always small then I would not try to take them out. If you don't want them in there then don't put them in orginally; that is don't call MatSetValues() at all for those really small locations and don't allocate space for them.

   Barry

> 
> How can I remove these values that are less than a given tolerance, let's say 1E-10?
> 
> I tried to use MatChop together with MatCopy and MatDuplicate, but none of these functions ignores zeros.
> 
> 
> Thanks!



More information about the petsc-users mailing list