← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2085: fix bug in utils.py; consistent signs in ViscoelasticPM

 

------------------------------------------------------------
revno: 2085
committer: Sergei D. <sega@think>
branch nick: trunk
timestamp: Wed 2010-03-17 22:04:09 +0300
message:
  fix bug in utils.py; consistent signs in ViscoelasticPM
modified:
  pkg/dem/meta/ViscoelasticPM.cpp
  py/utils.py


--
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/meta/ViscoelasticPM.cpp'
--- pkg/dem/meta/ViscoelasticPM.cpp	2009-12-13 20:11:31 +0000
+++ pkg/dem/meta/ViscoelasticPM.cpp	2010-03-17 19:04:09 +0000
@@ -71,12 +71,12 @@
 	//Vector3r _c1x_	=  geom->radius1*geom->normal;
 	//Vector3r _c2x_	= -geom->radius2*geom->normal;
 	//Vector3r relativeVelocity		= (de2->velocity+de2->angularVelocity.Cross(_c2x_)) - (de1->velocity+de1->angularVelocity.Cross(_c1x_));
-	Vector3r relativeVelocity = (de2.vel+de2.angVel.Cross(c2x)) - (de1.vel+de1.angVel.Cross(c1x));
+	Vector3r relativeVelocity = (de1.vel+de1.angVel.Cross(c1x)) - (de2.vel+de2.angVel.Cross(c2x)) ;
 	Real normalVelocity	= geom.normal.Dot(relativeVelocity);
 	Vector3r shearVelocity	= relativeVelocity-normalVelocity*geom.normal;
-	shearForce -= (phys.ks*dt+phys.cs)*shearVelocity;
+	shearForce = (phys.ks*dt+phys.cs)*shearVelocity;
 
-	phys.normalForce = ( phys.kn * geom.penetrationDepth - phys.cn * normalVelocity ) * geom.normal;
+	phys.normalForce = ( phys.kn * geom.penetrationDepth + phys.cn * normalVelocity ) * geom.normal;
 	phys.prevNormal = geom.normal;
 
 	Real maxFs = phys.normalForce.SquaredLength() * std::pow(phys.tangensOfFrictionAngle,2);

=== modified file 'py/utils.py'
--- py/utils.py	2010-03-15 14:35:44 +0000
+++ py/utils.py	2010-03-17 19:04:09 +0000
@@ -237,7 +237,7 @@
 	b.dynamic=dynamic
 	return b
 
-def facetBox(center,extents,orientation=Quaternion.IDENTITY,wallMask=63,**kw):
+def facetBox(center,extents,orientation=Quaternion().IDENTITY,wallMask=63,**kw):
 	"""
 	Create arbitrarily-aligned box composed of facets, with given center, extents and orientation.
 	If any of the box dimensions is zero, corresponding facets will not be created. The facets are oriented outwards from the box.