← Back to team overview

yade-users team mailing list archive

Re: [Question #235259]: How to count number of interactions

 

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

    Status: Open => Answered

Christian Jakob proposed the following answer:
Maybe the problem is, that the material id can not be used for specify a
material (not sure, if this is the problem)

instead of

frictMatId =
O.materials.append(NormalInelasticMat(density=300.0,poisson=0.5,young=1e9))

try this

myMat = NormalInelasticMat(density=300.0,poisson=0.5,young=1e9)
frictMatId = O.materials.append(myMat)

Then you can set it to your sphere:

ballId=O.bodies.append([sphere(center=(0.5,0.5,0.5),radius=.05,material=myMat)])

Getting number of interactions can be done like this:

counter = 0
for i in O.interactions:
  if i.isReal:
    counter+=1

(did not check)

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


Follow ups