← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1810: Adaptation examples/STLImporterTest.py for new viscoelastic classes.

 

------------------------------------------------------------
revno: 1810
committer: Sergei D. <sega@think>
branch nick: trunk
timestamp: Sun 2009-11-22 18:59:02 +0300
message:
  Adaptation examples/STLImporterTest.py for new viscoelastic classes.
modified:
  examples/STLImporterTest.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 'examples/STLImporterTest.py'
--- examples/STLImporterTest.py	2009-09-01 08:51:57 +0000
+++ examples/STLImporterTest.py	2009-11-22 15:59:02 +0000
@@ -10,7 +10,7 @@
 
 ## Import wall's geometry
 params=utils.getViscoelasticFromSpheresInteraction(10e3,tc,en,es)
-imported = utils.import_stl_geometry('baraban.stl',frictionAngle=frictionAngle,physParamsClass="SimpleViscoelasticBodyParameters",**params) # **params sets kn, cn, ks, cs
+imported = utils.import_stl_geometry('baraban.stl',frictionAngle=frictionAngle,materialClass="SimpleViscoelasticMat",**params) # **params sets kn, cn, ks, cs
 
 ## Spheres
 sphereRadius = 0.2
@@ -22,30 +22,20 @@
             x = (i*2 - nbSpheres[0])*sphereRadius*1.1
             y = j*sphereRadius*2.2
             z = (k*2 - nbSpheres[2])*sphereRadius*1.1
-            s=utils.sphere([x,y,z],sphereRadius,density=Density,frictionAngle=frictionAngle,physParamsClass="SimpleViscoelasticBodyParameters")
-            p=utils.getViscoelasticFromSpheresInteraction(s.phys['mass'],tc,en,es)
-            s.phys['kn'],s.phys['cn'],s.phys['ks'],s.phys['cs']=p['kn'],p['cn'],p['ks'],p['cs']
+            s=utils.sphere([x,y,z],sphereRadius,density=Density,frictionAngle=frictionAngle,materialClass="SimpleViscoelasticMat")
+            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)
 
 ## Timestep 
 O.dt=.2*tc
 
-## Initializers 
-O.initializers=[
-	## Create bounding boxes. They are needed to zoom the 3d view properly before we start the simulation.
-	BoundingVolumeMetaEngine([InteractingSphere2AABB(),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()])
-	]
-
 ## Engines 
 O.engines=[
 	## Resets forces and momenta the act on bodies
 	BexResetter(),
 	## Associates bounding volume to each body.
-	BoundingVolumeMetaEngine([
-		InteractingSphere2AABB(),
-		InteractingFacet2AABB(),
-		MetaInteractingGeometry2AABB()
-	]),
+	BoundingVolumeMetaEngine([ InteractingSphere2AABB(), InteractingFacet2AABB() ]),
 	## Using bounding boxes find possible body collisions.
 	InsertionSortCollider(),
 	## Create geometry information about each potential collision.
@@ -54,9 +44,11 @@
 		InteractingFacet2InteractingSphere4SpheresContactGeometry()
 	]),
 	## Create physical information about the interaction.
-	InteractionPhysicsMetaEngine([SimpleViscoelasticRelationships()]),
+	InteractionPhysicsMetaEngine([
+		Ip2_SimleViscoelasticMat_SimpleViscoelasticMat_SimpleViscoelasticPhys()
+	]),
     ## Constitutive law
-	ConstitutiveLawDispatcher([ef2_Spheres_Viscoelastic_SimpleViscoelasticContactLaw()]),
+	ConstitutiveLawDispatcher([ Law2_Spheres_Viscoelastic_SimpleViscoelastic() ]),
 	## Apply gravity
 	GravityEngine(gravity=[0,-9.81,0]),
 	## Cundall damping must been disabled!
@@ -66,7 +58,6 @@
 ]
 
 from yade import qt
-#qt.Controller()
 qt.View()
 O.run()