← Back to team overview

yade-dev team mailing list archive

[svn] r1878 - in trunk: pkg/common/DataClass scripts/test

 

Author: eudoxos
Date: 2009-07-18 23:07:49 +0200 (Sat, 18 Jul 2009)
New Revision: 1878

Modified:
   trunk/pkg/common/DataClass/VelocityBins.cpp
   trunk/scripts/test/gts-horse.py
Log:
Fix small bug in Velocity bins related to max sweep length (should improve performance as well). Still some incorrect things WRT bboxes, it seems.


Modified: trunk/pkg/common/DataClass/VelocityBins.cpp
===================================================================
--- trunk/pkg/common/DataClass/VelocityBins.cpp	2009-07-18 11:07:40 UTC (rev 1877)
+++ trunk/pkg/common/DataClass/VelocityBins.cpp	2009-07-18 21:07:49 UTC (rev 1878)
@@ -49,8 +49,8 @@
 			bin.binMaxVelSq=(i==0       ? currMaxVelSq : refMaxVelSq/pow(binCoeff*binCoeff,(int)i));
 			bin.binMinVelSq=(i==nBins-1 ? 0.           : refMaxVelSq/pow(binCoeff*binCoeff,(int)(i+1)));
 			bin.maxDist=(i==0 ?
-				(refMaxVelSq==0 ? 0: sqrt(currMaxVelSq/refMaxVelSq)*abs(refSweepLength)) :
-				abs(refSweepLength)/pow(binCoeff,(int)i)
+				(refMaxVelSq==0 ? 0: refSweepLength) :
+				refSweepLength/pow(binCoeff,(int)i)
 			);
 			bin.currDistSq=0; bin.currMaxVelSq=0; bin.nBodies=0;
 		}

Modified: trunk/scripts/test/gts-horse.py
===================================================================
--- trunk/scripts/test/gts-horse.py	2009-07-18 11:07:40 UTC (rev 1877)
+++ trunk/scripts/test/gts-horse.py	2009-07-18 21:07:49 UTC (rev 1878)
@@ -33,7 +33,7 @@
 O.engines=[
 	BexResetter(),
 	BoundingVolumeMetaEngine([InteractingSphere2AABB(),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()]),
-	InsertionSortCollider(),
+	InsertionSortCollider(label='collider'),
 	InteractionDispatchers(
 		[ef2_Sphere_Sphere_Dem3DofGeom(),ef2_Facet_Sphere_Dem3DofGeom()],
 		[SimpleElasticRelationships()],
@@ -42,6 +42,12 @@
 	GravityEngine(gravity=[0,0,-1e4]),
 	NewtonsDampedLaw(damping=.1)
 ]
-
+#collider['sweepLength']=.2*dim0/30.
+#collider['nBins']=10
+#collider['binCoeff']=2
 O.dt=1.5*utils.PWaveTimeStep()
 O.saveTmp()
+O.timingEnabled=True
+from yade import timing
+O.run(10000,True)
+timing.stats()