Output collsions particles-walls and particle-particle per cycle

Asked by rox212

Hi! I want to know if it is possible to access the total number of collisions of particles with:
1) walls (top and bottom walls if possible)
2) other particles
I want to access these parameters at each cycle or time step.

I am using Yade 2018b with following engines:

And I am using the following engines with integrators/laws:

O.engines = [
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()],label='collider'),
  InteractionLoop(
    [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
    [Ip2_FrictMat_FrictMat_FrictPhys(label='frict')],
    [Law2_ScGeom_FrictPhys_CundallStrack(traceEnergy=True,label='cundall')],
  ),
    GravityEngine(gravity=(0,0,-9.8)),
    NewtonIntegrator(damping=dampingCoeffCundall,label='newtonInt'),
    TranslationEngine(translationAxis=[0,0,1],velocity=velocityDamp,ids=idTop,dead=False,label='translat'),
    TranslationEngine(translationAxis=[0,0,1],velocity=velocityDamp,ids=idWalls,dead=False,label='translatbottom'),
    TranslationEngine(translationAxis=[0,0,1],velocity=velocityDamp,ids=idBottom,dead=False,label='translatBottom'),
    HarmonicMotionEngine(A=amplitude, f=frequency , fi = initialPhase, ids = idTop, label='combEngine',dead=True),
    HarmonicMotionEngine(A=amplitude, f=frequency , fi = initialPhase, ids = idWalls, label='combEngine1',dead=True),
    HarmonicMotionEngine(A=amplitude, f=frequency , fi = initialPhase, ids = idBottom, label='combEngine2',dead=True),
]

Thank you for your help!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
rox212
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
How do you distinguish a collision from a contact?
Bruno

Revision history for this message
rox212 (rox212) said :
#2

I do not understand the question, a collision implies a contact.
I just want to know if there is a way in yade to access total particles collisions in a specific interval of simulation time.
By "hand" is inefficient to do that since it is a double loop in the positions given a cut-off and check out if there has been a collision (like the equations used in an Event-Driven MD).

Is it possible in yade to check how many contacts/collisions had happened in a specific interval?

Revision history for this message
Jan Stránský (honzik) said :
#3

Hello,

number of interactions/contacts of one specific body (e.g. a wall) you can do
len(body.intrs()) # [1]

For more "overall" interaction statistics, you can loop over interactions [2].
E.g. to get total number of sphere-sphere (meaning of particle-particle?) interactoins:
### maybe better to put the code in a function
nSphSph = 0
for i in O.interactions:
    shape1 = O.bodies[i.id1].shape
    shape2 = O.bodies[i.id2].shape
    if type(shape1) is Sphere and type(shape2) is Sphere:
        nSphSph += 1
###

Cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Body.intrs
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Omega.interactions

Revision history for this message
rox212 (rox212) said :
#4

Thank you very much! This was really helpful.