Read Contact, Bond, and Collision data

You use the same syntax for reading contact and collision data. The only differences are in the available properties in each case.

To read contact, bond, and collision data:
Use the following command:
# Looking at the last timestep
timestep = deck.timestep[deck.numTimesteps - 1]
# Get contact data for particle-particle contacts
surf_contacts = timestep.contact.surfSurf
surf_contacts.getIds()
surf_contacts.getPositions()
surf_contacts.getNormalForce()
surf_contacts.getNormalOverlap()
surf_contacts.getTangentialForce()
surf_contacts.getTangentialOverlap()
# ...
# The same information is available for particle-geometry contacts
geom_contacts = timestep.contact.surfGeom
geom_contacts.getIds()
geom_contacts.getPositions()
# ...
# Bonds are very similar
bonds = timestep.bond
bonds.getIds()
bonds.getPositions()
# Bonds have some additional properties, however
bonds.getState()
bonds.getNormalTorque()
bonds.getTangentialTorque()
# ...
# The syntax for collisions is the same as contacts, with some additional information
surf_collisions = timestep.collision.surfSurf
surf_collisions.getIds()
surf_collisions.getPositions()
surf_collisions.getNormalEnergy()
surf_collisions.getFirstRadius()
surf_collisions.getSecondRadius()
# ...
# And again for particle-geometry collisions
geom_collisions = timestep.collision.surfGeom
geom_collisions.getIds()
geom_collisions.getPositions()
# ...

For more information about the list of available properties, see the EDEMpy API Reference Help included in the EDEM installation folder.