← Back to team overview

yade-users team mailing list archive

Re: [Question #403764]: How to stop YADE from exiting automatically on PBS?

 

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

    Status: Answered => Open

Matt Kesseler is still having a problem:
Here is the YADE script.

from yade import pack,bodiesHandling,utils,export
from math import tan,sin,cos,sqrt

internalfrictionangle=28*(pi/180)
externalfrictionangle=20*(pi/180)
width=0.1
rampangle=40*(pi/180)
shutterheight=0.2
radius=0.01
cwidth=width
insertradius=0.2464
shutterpoint=1.448+insertradius*tan(rampangle/2)
ramplength=shutterpoint+shutterheight/tan(rampangle)
runofflength=1.7
generationheight=1.25*cos(rampangle)*shutterheight
damp=0.01

finish=6000000
interval=1000

O.materials.append(FrictMat(density=8050,young=210e6,poisson=0.25,frictionAngle=externalfrictionangle,label='steel'))

#shutter plate(physical)
O.bodies.append(geom.facetBox((cwidth/2,cos(rampangle)*shutterpoint-sin(rampangle)*shutterheight/2,sin(rampangle)*shutterpoint+cos(rampangle)*shutterheight/2),(cwidth/2,shutterheight/2,0), orientation=Quaternion((1,0,0),rampangle-90*(pi/180)),wallMask=63,color=(1,1,1),wire=False))

#shutter wall(for generation)
O.bodies.append(wall((0,cos(rampangle)*shutterpoint-sin(rampangle)*shutterheight,0),axis=1,sense=0,color=(1,1,1)))

O.bodies.append(wall((0,cos(rampangle)*shutterpoint+cos(rampangle)/tan(rampangle)*shutterheight,0),axis=1,sense=0,color=(1,1,1)))

#ramp surface
O.bodies.append(geom.facetBox((cwidth/2,cos(rampangle)*ramplength/2,sin(rampangle)*ramplength/2),(cwidth/2,ramplength/2,0), orientation=Quaternion((1,0,0),rampangle),wallMask=63,color=(1,1,1),wire=False))

#runoff zone
O.bodies.append(geom.facetBox((cwidth/2,-(runofflength+insertradius*tan(rampangle/2))/2,0),(cwidth/2,(runofflength+insertradius*tan(rampangle/2))/2,0),orientation=Quaternion((1,0,0),0),wallMask=63,color=(1,1,1),wire=False))

#curved transition (circular for now)
O.bodies.append(geom.facetCylinder((cwidth/2,-insertradius*tan(rampangle/2),insertradius),insertradius,cwidth,orientation=Quaternion((0,1,0),pi/2),segmentsNumber=16, wallMask=7,angleRange=(0,rampangle),closeGap=False,radiusTopInner=0.999*insertradius,radiusBottomInner=0.999*insertradius,color=(1,1,1),wire=False))

#invisible sidewalls
O.bodies.append(wall((0,0,0),axis=0,sense=0,color=(1,1,1)))
O.bodies.append(wall((cwidth,0,0),axis=0,sense=0,color=(1,1,1)))

O.materials.append(FrictMat(density=1730,young=65e6,poisson=0.2,frictionAngle=internalfrictionangle,label='sand'))

#particle generation
# sphere packing is not equivalent to particles in simulation, it contains only the pure geometry
sp=pack.SpherePack()
# generate randomly spheres with uniform radius distribution
sp.makeCloud((0,cos(rampangle)*shutterpoint-sin(rampangle)*shutterheight,sin(rampangle)*shutterpoint+cos(rampangle)*shutterheight),(cwidth,cos(rampangle)*shutterpoint+cos(rampangle)/tan(rampangle)*shutterheight,generationheight+sin(rampangle)*shutterpoint+cos(rampangle)*shutterheight),rMean=radius,rRelFuzz=0)
# add the sphere pack to the simulation
sp.toSimulation()

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
      [Ip2_FrictMat_FrictMat_FrictPhys()],
      [Law2_ScGeom_FrictPhys_CundallStrack()]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=damp),
   PyRunner(command='addData()',iterPeriod=interval),
   PyRunner(command='finish()',iterPeriod=finish),
   PyRunner(command='vtk()',iterPeriod=interval),
]
#O.dt=.5*PWaveTimeStep()
O.dt=5e-7

vtkExporter = export.VTKExporter('/panfs/panasas01.panfs.cluster/evxmk9/YADE/test-data/data')
vtkExporter.exportFacets(what=[('pos','b.state.pos')])

def vtk():
   vtkExporter.exportSpheres(what=[('dist','b.state.pos.norm()'),('particleVelocity','b.state.vel')])

O.run()

def finish():
   O.pause()

#def checkUnbalanced():

#O.trackEnergy=True

def addData():
   print O.iter
   for b in O.bodies:
      if isinstance(b.shape,Sphere): b.shape.color=scalarOnColorScale(b.state.vel.norm(),0,2.5)
   if O.iter==900000:
      for b in O.bodies:
         if isinstance(b.shape,Sphere):
            if b.state.pos[2]>(sin(rampangle)*shutterpoint+cos(rampangle)*shutterheight):
               O.bodies.erase(b.id)
   if O.iter==1000000:
      for b in O.bodies:
         if b.id<4:
            O.bodies.erase(b.id)

O.saveTmp()

Again this code did not exit automatically and functioned normally when
I used it on my local PC or on the local server of the HPC (so without
using PBS).

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.