← Back to team overview

yade-users team mailing list archive

[Question #680876]: an error when i run my script

 

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

hello
i was simulating the interaction between sphere and polyhedra, and the boundary is consist of facet and wall, when i run the code, an error appear: 
 FATAL /usr/local/myYade/trunk/pkg/common/InteractionLoop.cpp:143 action: None of given Law2 functors can handle interaction #7+373, types geom:PolyhedraGeom=10 and phys:FrictPhys=3 (LawDispatcher::getFunctor2D returned empty functor)

below is my code:
from yade import polyhedra_utils,pack,plot,utils
import random

m  = PolyhedraMat(young=1e10,poisson=.05)
n = FrictMat(young=1e9,poisson=.2)

O.materials.append((m,n))

#the boundary of particle flow
v1=((0,0,0),(0,0,10),(100,0,10))
v2=((0,0,0),(100,0,0),(100,0,10))
v5=((100,10,0),(0,10,10),(100,10,10))
v6=((100,10,0),(0,10,10),(0,10,0))
v7=((0,0,0),(0,10,10),(0,0,10))
v8=((0,0,0),(0,10,10),(0,10,0))
v9=((0,0,0),(100,10,0),(0,10,0))
v10=((0,0,0),(100,10,0),(100,0,0))

O.bodies.append(utils.facet(v1,material=m))
O.bodies.append(utils.facet(v2,material=m))
O.bodies.append(utils.facet(v5,material=m))
O.bodies.append(utils.facet(v6,material=m))
O.bodies.append(utils.facet(v7,material=m))
O.bodies.append(utils.facet(v8,material=m))
O.bodies.append(utils.facet(v9,material=m))
O.bodies.append(utils.facet(v10,material=m))


O.bodies.append(utils.wall(10, axis=0, sense=-1, material=m))





#polyhedra_utils.fillBox((0,0,0),(10,10,20),m,seed=1)

#sphere particles mixed with polyhedra
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(10,10,70),psdSizes=[1,2,3],psdCumm=(0.5,0.8,1),seed=1)

for center,radius in sp:
    if radius >= 1:
        t = polyhedra_utils.polyhedra(m,(radius,radius,radius))
        t.state.pos = center # sets polyhedron position according to sphere position
        O.bodies.append(t)
    else:
        t = sphere(center,radius,material=m)
        O.bodies.append(t)

O.engines = [
    ForceResetter(),
    InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Polyhedra_Aabb(), Bo1_Wall_Aabb(), Bo1_Facet_Aabb()]),
    InteractionLoop(
        [Ig2_Wall_Polyhedra_PolyhedraGeom(), Ig2_Polyhedra_Polyhedra_ScGeom(),
         Ig2_Facet_Polyhedra_PolyhedraGeom(),Ig2_Sphere_Polyhedra_ScGeom(),Ig2_Wall_Sphere_ScGeom(),
         Ig2_Facet_Sphere_ScGeom(),Ig2_Sphere_Sphere_ScGeom()],
        [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_FrictMat_PolyhedraMat_FrictPhys()],  
        [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric(),Law2_ScGeom_FrictPhys_CundallStrack()]  # contact law -- apply forces
    ),
    # GravityEngine(gravity=(0,0,-9.81)),
    NewtonIntegrator(damping=0.5, gravity=(0, 0, -9.81)),
    PyRunner(command='checkUnbalanced()', realPeriod=3, label='checker')
]
O.dt=1e-3

# 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')
      # plot.saveGnuplot('bbb') is also possible

# collect history of data which will be plotted
def addPlotData():
   # each item is given a names, by which it can be the unsed in plot.plots
   # the **O.energy converts dictionary-like O.energy to plot.addData arguments
   plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)

# define how to plot data: 'i' (step number) on the x-axis, unbalanced force
# on the left y-axis, all energies on the right y-axis
# (O.energy.keys is function which will be called to get all defined energies)
# None separates left and right y-axis
plot.plots={'i':('unbalanced',None,O.energy.keys)}

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

O.saveTmp()


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.