← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2535: fix Bug 672623; fix some examples

 

------------------------------------------------------------
revno: 2535
committer: Sergei D. <sega@think>
branch nick: trunk
timestamp: Tue 2010-11-09 13:57:08 +0300
message:
  fix Bug 672623; fix some examples
modified:
  examples/ring2d/ringSimpleViscoelastic.py
  pkg/dem/NozzleFactory.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 'examples/ring2d/ringSimpleViscoelastic.py'
--- examples/ring2d/ringSimpleViscoelastic.py	2010-11-07 08:55:43 +0000
+++ examples/ring2d/ringSimpleViscoelastic.py	2010-11-09 10:57:08 +0000
@@ -71,13 +71,19 @@
 
 ]
 
+# FIXME: why this not worked properly?
+#for b in O.bodies:
+    #if isinstance(b.shape.name,Sphere):
+		 #b.state.blockedDOFs=['z']
+
 for b in o.bodies:
-    if isinstance(b.shape.name,Sphere):
-		 b.state.blockedDOFs=['z']
-
-o.dt=0.02*tc
-
-o.saveTmp('init');
+	if b.shape.name=='Sphere':
+		b.state.blockedDOFs=['z']
+
+
+O.dt=0.02*tc
+
+O.saveTmp('init');
 
 from yade import qt
 renderer=qt.Renderer()

=== modified file 'pkg/dem/NozzleFactory.cpp'
--- pkg/dem/NozzleFactory.cpp	2010-10-13 16:23:08 +0000
+++ pkg/dem/NozzleFactory.cpp	2010-11-09 10:57:08 +0000
@@ -60,8 +60,8 @@
 		}
 		// pick random initial velocity (normal with some variation)
 		// preliminary version that randomizes valocity magnitude but always makes initVel exactly aligned with normal
-		//Vector3r initVel=normal*(vMin+randomUnit()*(vMax-vMin)); // TODO: compute from vMin, vMax, vAngle, normal;
-		Vector3r initVel= normal*100;
+		Vector3r initVel=normal*(vMin+randomUnit()*(vMax-vMin)); // TODO: compute from vMin, vMax, vAngle, normal;
+		//Vector3r initVel= normal*100;
 
 		// create particle
 		int mId=(materialId>=0 ? materialId : scene->materials.size()+materialId);
@@ -76,7 +76,7 @@
 		state->vel=initVel; 
 		Real vol=(4/3.)*Mathr::PI*pow(r,3);
 		state->mass=vol*material->density;
-		 state->inertia=(2./5.)*vol*r*r*Vector3r::Ones();
+		state->inertia=(2./5.)*vol*r*r*material->density*Vector3r::Ones();
 
 		b->shape=sphere; 
 		b->state=state;