← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2266: 1. Tentative fix for the clumps bug

 

Anton Gladky said:     (by the date of Wed, 2 Jun 2010 07:32:59 +0200)

> > -       state->ori=Quaternionr(R_g2c);
> > +       state->ori=Quaternionr(R_g2c); state->ori.normalize();
> >
> >
> You cannot imagine, how many __hours__ I spent, trying to solve the problem

heh. in Lattice model I was using quaternions rather extensively. And
I ended up adding .normalize after every second or third
multiplication, because the numerical errors were building up quickly.

I wish there was some flag telling the quaternion to be a UNIT
quaternion. The library should take care of all that normalizing.
After all inside its own routines it is calculating length quite
frequently. Just add a check if != 1.0 and if so, then perform
a .normalize action.

this kind of "error" can be actually quite abundant all over the
code. Might be interesting to try doing it always when returning from
a wrapper call to quaternion multiplication and see if e.g. a triaxial
results are different.

-- 
Janek Kozicki                               http://janek.kozicki.pl/  |



Follow ups

References