← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2518: Fix STLImporter; fix some examples

 

------------------------------------------------------------
revno: 2518
committer: Sergei D. <sega@think>
branch nick: trunk
timestamp: Wed 2010-10-27 18:59:02 +0400
message:
  Fix STLImporter; fix some examples
modified:
  examples/baraban/baraban.py
  examples/dynamic_simulation_tests/ringSimpleViscoelastic.py
  pkg/dem/STLImporter.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/baraban/baraban.py'
--- examples/baraban/baraban.py	2010-10-26 13:41:30 +0000
+++ examples/baraban/baraban.py	2010-10-27 14:59:02 +0000
@@ -16,7 +16,7 @@
 from yade import ymport
 fctIds=O.bodies.append(ymport.stl('baraban.stl',color=(1,0,0),material=facetMat))
 ## Spheres
-sphereRadius = 0.05
+sphereRadius = 0.2
 nbSpheres = (10,10,10)
 #nbSpheres = (50,50,50)
 for i in xrange(nbSpheres[0]):
@@ -26,8 +26,6 @@
             y = (j*2 - nbSpheres[1])*sphereRadius*1.1
             z = (k*2 - nbSpheres[2])*sphereRadius*1.1
             s=utils.sphere([x,y,z],sphereRadius,material=sphereMat)
-            p=utils.getViscoelasticFromSpheresInteraction(tc,en,es)
-            s.mat.kn,s.mat.cn,s.mat.ks,s.mat.cs=p['kn'],p['cn'],p['ks'],p['cs']
             O.bodies.append(s)
 
 ## Timestep 

=== modified file 'examples/dynamic_simulation_tests/ringSimpleViscoelastic.py'
--- examples/dynamic_simulation_tests/ringSimpleViscoelastic.py	2010-09-27 17:47:59 +0000
+++ examples/dynamic_simulation_tests/ringSimpleViscoelastic.py	2010-10-27 14:59:02 +0000
@@ -16,7 +16,7 @@
 es = 0.3
 
 ## Import wall's geometry
-params=utils.getViscoelasticFromSpheresInteraction(10e3,tc,en,es)
+params=utils.getViscoelasticFromSpheresInteraction(tc,en,es)
 facetMat=O.materials.append(ViscElMat(frictionAngle=frictionAngle,**params)) # **params sets kn, cn, ks, cs
 sphereMat=O.materials.append(ViscElMat(density=Density,frictionAngle=frictionAngle,**params))
 
@@ -32,8 +32,6 @@
 					y = cylinderOrigin[1]+2*r*sphereRadius*sin(dfi*a)
 					z = cylinderOrigin[2]+h*2*sphereRadius
 					s=utils.sphere([x,y*cos(cylinderSlope)+z*sin(cylinderSlope),z*cos(cylinderSlope)-y*sin(cylinderSlope)],sphereRadius,material=sphereMat)
-					p=utils.getViscoelasticFromSpheresInteraction(s.state.mass,tc,en,es)
-					s.mat.kn,s.mat.cn,s.mat.ks,s.mat.cs=p['kn'],p['cn'],p['ks'],p['cs']
 					o.bodies.append(s)
 					spheresCount+=1
 	return spheresCount

=== modified file 'pkg/dem/STLImporter.cpp'
--- pkg/dem/STLImporter.cpp	2010-10-13 16:23:08 +0000
+++ pkg/dem/STLImporter.cpp	2010-10-27 14:59:02 +0000
@@ -38,7 +38,7 @@
 		{   
 				iFacet->vertices[j]=v[j]-icc;
 		}
-		// iFacet->postLoad
+		iFacet->postLoad(*iFacet);
 		shared_ptr<Body> b(new Body);
 		b->state->pos=b->state->refPos=icc;
 		b->state->ori=b->state->refOri=Quaternionr::Identity();