------------------------------------------------------------ revno: 2507 committer: Janek Kozicki <cosu...@berlios.de> branch nick: yade timestamp: Wed 2010-10-20 19:46:55 +0200 message: Added a throw condition if two spheres have zero distance. Works in #ifdef YADE_DEBUG only. modified: pkg/dem/Ig2_Sphere_Sphere_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/Ig2_Sphere_Sphere_ScGeom.cpp' --- pkg/dem/Ig2_Sphere_Sphere_ScGeom.cpp 2010-10-20 11:31:49 +0000 +++ pkg/dem/Ig2_Sphere_Sphere_ScGeom.cpp 2010-10-20 17:46:55 +0000 @@ -32,6 +32,9 @@ else { scm=shared_ptr<ScGeom>(new ScGeom()); c->geom=scm; } Real norm=normal.norm(); normal/=norm; // normal is unit vector now +#ifdef YADE_DEBUG + if(norm==0) throw runtime_error(("Zero distance between spheres #"+lexical_cast<string>(c->getId1())+" and #"+lexical_cast<string>(c->getId2())+".").c_str()); +#endif Real penetrationDepth=s1->radius+s2->radius-norm; scm->contactPoint=se31.position+(s1->radius-0.5*penetrationDepth)*normal;//0.5*(pt1+pt2); scm->penetrationDepth=penetrationDepth;
_______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : yade-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp