← Back to team overview

yade-users team mailing list archive

Re: [Question #242644]: Benchmark

 

Question #242644 on Yade changed:
https://answers.launchpad.net/yade/+question/242644

Martin Nie posted a new comment:
I think that's a great idea.  But it could take a some hours.

Here is the skript:

from yade import pack
from yade import ymport, qt


facetMat=O.materials.append(FrictMat(density=7850,young=210e9,poisson=.25))
sphereMat=O.materials.append(FrictMat(density=7850,young=210e9,poisson=.25))
fctIds=O.bodies.append(ymport.stl('bottich_triangles_unit_meter-binary.stl',color=(1,1,1),wire=True,fixed=True,material=facetMat))


amplitude=((2*pi)/360)*.75
sphereRadius = .01
nbSpheres = (10,10,10)
for i in xrange(nbSpheres[0]):
    for j in xrange(nbSpheres[1]):
        for k in xrange(nbSpheres[2]):
             x = (i*2 - nbSpheres[0])*sphereRadius*1.15
             y = (j*2 - nbSpheres[1])*sphereRadius*1.1
             z = (k*2 - nbSpheres[2])*sphereRadius*1.15
             s=sphere([x+.1,y+.1,z+.15],sphereRadius,sphereMat,color=[1,1,6])
             O.bodies.append(s)
#sp=pack.SpherePack()
#sp.makeCloud((-0.2,-.2,.1),(.2,.2,.4),rMean=0.01,rRelFuzz=0,num=10000)
#sp.toSimulation()


O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      # handle sphere+sphere and facet+sphere collisions
      [Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom()],
      [Ip2_FrictMat_FrictMat_FrictPhys()],
      [Law2_L3Geom_FrictPhys_ElPerfPl()]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=0.75),
   HarmonicRotationEngine(ids=fctIds,rotationAxis=[0,1,0],zeroPoint=(0,0,0),rotateAroundZero=True,A=amplitude,f=30,dead=False,label='auslenkung',fi=pi/2),

   CombinedKinematicEngine(ids=fctIds,label='comb',dead=True) + HarmonicRotationEngine(ids=fctIds,rotationAxis=[1,0,0],zeroPoint=(0,0,0),rotateAroundZero=True,A=amplitude,f=30,dead=False,label='xRot',fi=0) 
+ HarmonicRotationEngine(ids=fctIds,rotationAxis=[0,1,0],zeroPoint=(0,0,0),rotateAroundZero=True,A=amplitude,f=30,dead=False,label='yRot',fi=pi/2),

   
   #VTKRecorder(fileName='paraview/3d-vtk-',recorders=['all'],virtPeriod=0.05),
   qt.SnapshotEngine(fileBase='video/3d-',virtPeriod=0.005,label='snapshot'),
   PyRunner(command='finish()',virtPeriod=1),
   PyRunner(command='status()',iterPeriod=1000),
   PyRunner(command='finish_auslenkung()',virtPeriod=0.0083, nDo=2),

]
O.dt=.5*utils.PWaveTimeStep()



def status():
	print 'iteration:' + str(O.iter)

def finish():
	print 'finished'
	utils.makeVideo(snapshot.snapshots,'video/3d.mpeg',fps=10,bps=10000)
	O.pause()
	

def finish_auslenkung():
	print 'auslenkung'	
	auslenkung.dead=True
	comb.dead=False
	

print 'run'
O.run()

You can find the bowl here: 
https://dl.dropboxusercontent.com/u/44982717/bottich_triangles_unit_meter-binary.stl

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.