← Back to team overview

yade-dev team mailing list archive

Re: Mathr::ZERO_TOLERANCE vs Mathr::EPSILON

 

Hi Jérôme,
I don't know, but I guess they were introduced independently by different authors. I actually don't know why we would need to define tolerance at all, unless in very specific cases.

For instance I judge that a line like this (ViscoelasticPM.cpp) is not only useless but actually wrong:
if (std::abs(cn1) <= Mathr::ZERO_TOLERANCE ) cn1=0;

If it's small let it be small. No need to make it zero. And since cn1 is not dimensionless it implies that currently the accuracy depends on a specific choice of units...

Bruno




Bruno

On 11/15/18 3:54 PM, Jerome Duriez wrote:
Hello,

Out of curiosity, why do we have both Mathr::ZERO_TOLERANCE and Mathr::EPSILON in the code [*] ?

I would understand they're both intended to give an expected magnitude of rounding errors. (Note that ZERO_TOLERANCE is hardcoded as 1e-20, while EPSILON is ~ 2e-16 here)

Both are used throughout the code (EPSILON more often ?)


Thanks,

Jérôme



[*] https://github.com/yade/trunk/blob/3269232e4982c1aa527581a200a0224555b09a1e/lib/base/Math.cpp

------
Chargé de Recherche / Research Associate
Irstea, RECOVER
3275 route de Cezanne – CS 40061 13182 Aix-en-Provence Cedex 5 FRANCE
+33 (0)4 42 66 99 21


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp




Follow ups

References