← Back to team overview

yade-users team mailing list archive

[Question #677941]: polyhedra collison simulation did not work

 

New question #677941 on Yade:
https://answers.launchpad.net/yade/+question/677941

hello
i was tried to simulation polyhedra collison by many polyhedra in a box, my code is as below:

from yade import pack, polyhedra_utils,plot

polyMat = PolyhedraMat()
O.materials.append(polyMat)

sp=pack.SpherePack()
nSpheres=sp.makeCloud((0,0,0),(2,2,2),rMean=.1,periodic=True)

#replace the sphere with polyhedra
for center,radius in sp:
    # note: new polyhedron for each cycle
    t = polyhedra_utils.polyhedra(polyMat,(radius,radius,radius))
    t.state.pos = center # sets polyhedron position according to sphere position
    O.bodies.append(t)

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Polyhedra_Polyhedra_PolyhedraGeom(),Ig2_Facet_Polyhedra_PolyhedraGeom()],
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()],
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
   # call the checkUnbalanced function (defined below) every 2 seconds
   PyRunner(command='checkUnbalanced()',realPeriod=2),
   # call the addPlotData function every 200 steps
   PyRunner(command='addPlotData()',iterPeriod=100)
]
O.dt=.5*PWaveTimeStep()

# enable energy tracking; any simulation parts supporting it
# can create and update arbitrary energy types, which can be
# accessed as O.energy['energyName'] subsequently
O.trackEnergy=True

# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
   if unbalancedForce()<.05:
      O.pause()
      plot.saveDataTxt('bbb.txt.bz2')

def addPlotData():
   plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)

plot.plots={'i':('unbalanced',None,O.energy.keys)}

# show the plot on the screen, and update while the simulation runs
plot.plot()

O.saveTmp()
##end
but when i click the start button, everything dissappear and send me a warn: WARN /usr/local/myYade/trunk/pkg/common/InsertionSortCollider.cpp:242 action: verletDist is set to 0 because no spheres were found. It will result in suboptimal performances, consider setting a positive verletDist in your script.
i don't where is wrong in my code. i would appreciate it if you can help me

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