← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1822: 1. scale factor is added to ymport.gengeo

 

------------------------------------------------------------
revno: 1822
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2009-11-25 15:26:00 +0100
message:
  1. scale factor is added to ymport.gengeo
renamed:
  scripts/test/regular-sphere-pack-LSMGegGeo.geo => scripts/test/regular-sphere-pack-LSMGenGeo.geo
modified:
  py/ymport.py
  scripts/test/regular-sphere-pack.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 'py/ymport.py'
--- py/ymport.py	2009-11-24 19:12:10 +0000
+++ py/ymport.py	2009-11-25 14:26:00 +0000
@@ -89,7 +89,7 @@
 		ret.append(utils.facet((nodelistVector3[i[1]],nodelistVector3[i[2]],nodelistVector3[i[3]]),**kw))
 	return ret
 
-def gengeo(fileName="file.geo",moveTo=[0.0,0.0,0.0],**kw):
+def gengeo(fileName="file.geo",moveTo=[0.0,0.0,0.0],scale=1.0,**kw):
 	""" Imports geometry from LSMGenGeo .geo file and creates spheres.
 	moveTo[X,Y,Z] parameter moves the specimen.
 	Remaining **kw arguments are passed to utils.sphere; 
@@ -113,6 +113,6 @@
 	ret=[]
 	for line in lines[7:numSpheres+7]:
 		data = line.split()
-		ret.append(utils.sphere([moveTo[0]+float(data[0]),moveTo[1]+float(data[1]),moveTo[2]+float(data[2])],float(data[3]),**kw))
+		ret.append(utils.sphere([moveTo[0]+scale*float(data[0]),moveTo[1]+scale*float(data[1]),moveTo[2]+scale*float(data[2])],scale*float(data[3]),**kw))
 	return ret
 

=== renamed file 'scripts/test/regular-sphere-pack-LSMGegGeo.geo' => 'scripts/test/regular-sphere-pack-LSMGenGeo.geo'
=== modified file 'scripts/test/regular-sphere-pack.py'
--- scripts/test/regular-sphere-pack.py	2009-11-24 19:12:10 +0000
+++ scripts/test/regular-sphere-pack.py	2009-11-25 14:26:00 +0000
@@ -18,7 +18,7 @@
 rho=1e3
 
 #Add material
-O.materials.append([GranularMat(young=1e8,frictionAngle=0.5,density=rho,label='materialZero')])
+O.materials.append([GranularMat(young=37e9,frictionAngle=0.5,density=rho,label='materialZero')])
 
 #Parameters, which will be passed into spheres and facets creators
 kw={'material':0}
@@ -60,8 +60,8 @@
 """Import regular-sphere-pack.mesh into the YADE simulation"""
 O.bodies.append(ymport.gmsh('regular-sphere-pack.mesh',**kwMeshes))#generates facets from the mesh file
 
-"""Import regular-sphere-pack-LSMGegGeo.geo into the YADE simulation"""
-O.bodies.append(ymport.gengeo('regular-sphere-pack-LSMGegGeo.geo',moveTo=[-7.0,-7.0,-5.9],color=(1,0,1),**kw))
+"""Import regular-sphere-pack-LSMGenGeo.geo into the YADE simulation"""
+O.bodies.append(ymport.gengeo('regular-sphere-pack-LSMGenGeo.geo',moveTo=[-7.0,-7.0,-5.9],scale=15.0,color=(1,0,1),**kw))
 
 
 try: