Read Particle Data

You can read particle information (positions, velocities, and so on) for a given particle type in a given Time Step which is contained in a ParticleType object.

To read particle data:
Use the following command to read particle information:
# The last timestep's index is one less than the number of timesteps
last_timestep = deck.numTimesteps - 1
# A particle type can be referred to either by name or by its index
particle_type = "New Particle 1"
particle_data = deck.timestep[last_timestep][particle_type] 
This object can then be used to get particle data in the form of NumPy arrays:
positions = particle_data.getPositions()
velocities = particle_data.getVelocities()
ang_velocities = particle_data.getAngularVelocities()
orientations = particle_data.getOrientation()
scales = particle_data.getScales()
ids = particle_data.getIds()
count = particle_data.numParticles

You can use this object to get particle data in the form of NumPy arrays as follows:

positions = particle_data.getPositions()
velocities = particle_data.getVelocities()
ang_velocities = particle_data.getAngularVelocities()
orientations = particle_data.getOrientation()
scales = particle_data.getScales()
ids = particle_data.getIds()
count = particle_data.numParticles