← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2514: - more debug info for quaternions with nan angle.

 

------------------------------------------------------------
revno: 2514
committer: bchareyre <bchareyre@dt-rv020>
branch nick: yade
timestamp: Tue 2010-10-26 16:59:45 +0200
message:
  - more debug info for quaternions with nan angle.
modified:
  pkg/dem/ScGeom.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/dem/ScGeom.cpp'
--- pkg/dem/ScGeom.cpp	2010-10-26 14:09:37 +0000
+++ pkg/dem/ScGeom.cpp	2010-10-26 14:59:45 +0000
@@ -94,10 +94,10 @@
 		if (creep) delta = delta * twistCreep;
 		AngleAxisr aa(delta); // axis of rotation - this is the Moment direction UNIT vector; // angle represents the power of resistant ELASTIC moment
 		//Eigen::AngleAxisr(q) returns nan's when q close to identity, next tline fixes the pb.
-// #define Q_DEBUG
+#define Q_DEBUG
 #ifdef Q_DEBUG
 		if (isnan(aa.angle())) {
-			cerr<<"NaN found after quaternion product"<<endl;
+			cerr<<"NaN angle found in angleAxisr(q), for quaternion "<<delta<<", after quaternion product"<<endl;
 			cerr<<"rbp1.ori * (initialOrientation1.conjugate())) * (initialOrientation2 * (rbp2.ori.conjugate()) is:"<<endl;
 			cerr<<rbp1.ori<<" * "<<initialOrientation1.conjugate()<<" * "<<initialOrientation2<<" * "<<rbp2.ori.conjugate()<<endl<<"with sub-products :"<<endl<<rbp1.ori * (initialOrientation1.conjugate())<<" * "<<initialOrientation2 * (rbp2.ori.conjugate())<<endl;
 		}