yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #01380
Re: Be carefull with "normalize"
-
To:
yade-users@xxxxxxxxxxxxxxxxxxx
-
From:
Janek Kozicki <janek_listy@xxxxx>
-
Date:
Wed, 4 Feb 2009 18:28:14 +0100
-
Face:
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEUBAQEtLS1KSkpRUVFXV1dYWFhjY2Nzc3N3d3eHh4eKioqdnZ24uLjLy8vc3NxVIagyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AIVEzgS1fgQtQAAAjRJREFUOMtt1DFv00AUAOAzFQNbjigSyoQaRaBMhKgLUyKXpVNNeUpk9vyDqFJhQ1kiBuaqAwJCqvPtSLY7RlTn5+5IdnYkkt/AOyfxXVLe5vf53Z1875kd34tOEax8djmj6GyjhB5bxz50GdsVZr9fqRjZwAtKOJw5Wqs2MMZ16ALHsaDncF7xAHix1oEFHAB8f+pRjcO4gfZDykcYzbiucRolOLUJ6kjA0xtVt+A6TySlM0RajIpK6DzwKZ/nOYbF/gclHMo1ZOHYY/+Ha+AWuM+3oMS4eeqYzZ8FiCltgUqI8cd2wwAVpJk+8LWYjBtnJdQpHQqJMd4Oxt4bU9ESiFGc5hkqaH74asAX4iabP5I5gZ+qjgGlJCqZa3h3lxhoeVcSE1qLQC4sqKOK9MGW9E3izFqqHokoztLFEgXg31sbZEKnWi2T74A4NxfVQqlkjKtcAWD+zcArFEES01dR0E/nnV0IgugmDd/2L84sOAouRBBHEc7gtc8teDkRlE0iNQPo2w3Xhh/D4TCIQ4LRLoTvgwjj6RRgavdurxYGMaIuGOyAW/PpNlCcU9/93AHenAWYjPoAwa+G3e3to/MgFNTAEKvKDjzuCzHTnY3qqdXtx24VijzQfZ0yewZ5cwRFQaa+mIYr1uI0I76+3W4xhlvoVRwOA0Fdl64HlJnxP6T8YpX/Lga4Wv4A3ErrU5oTfN7Mu/llXMl8RXEPji/lQkN3H7qXqgC2By47EXeU/7PJ/wPxRKMnuZwIeAAAAABJRU5ErkJggg==
-
In-reply-to:
<4989CBAD.6030504@univ-nantes.fr>
Luc Sibille said: (by the date of Wed, 04 Feb 2009 18:09:01 +0100)
> Hi,
>
> Is the "normalize" function from wm3 used currently in Yade? I mean
> not in specific packages your are developing at the present time but in
> some basic and usual computation made in Yade.
> I think for instance to the computation of the normal vector defining
> the intergranular contact plane (for the DEM), or something else. If yes
> it could a real problem...
>
> Bruno have you got an idea of the default value of the "tolerance"
> value? The reason for this check could be to avoid a division by zero
> or "something" to close to zero.
see:
lib/miniWm3/Wm3Vector3.inl line 301
lib/miniWm3/Wm3Math.cpp line 29:
template<> const double Math<double>::ZERO_TOLERANCE = 1e-20;
In my snow grains simulation I'm dealing with really small triangles,
because the base unit is meter. And the snow grain average diameter is
0.001m and the size of triangles that form a polyhedron representing
the whole grain is about 0.000001m (but smaller are possible).
I was calculating normals for those triangles (it's necessary for
collision detection between polyhedrons), and suddenly some triangles
were disappearing. Finally I've found the reason - the length of
cross product was less than 1e-20, for example: 1.221342351454256e-21
(we have 16 digits of precision with double).
This function Normalize() is used everywhere in yade. But I don't know where :)
We could try 'grep Normalize ./* -R' to see where it is used.
For example I don't see it in ElasticContactLaw.
If someone is making simulations with spheres smaller than... I don't
know, maybe 0.00001m then maybe he has a problem...
--
Janek Kozicki |
References