Reading Contact and Collision data

The syntax for reading contact and collision data are similar.

The only differences are in the available properties in each case.

# 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()
# ...

See the EDEMpy API reference help for a full list of available properties in each case.

 

(c) 2023 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support