Reading trajectories


Trajectories in xml format can be read in as follows:

First load the file. Every State object has a readConfig member.


A file can store one or many configurations. To iterate to the first configuration

Or to iterate to the last configuration


To move by a certain number of trajectories

#advance by 3 snapshots within this xml file

#move backwards by 3 snapshots within this xml file

Calling these commands again will iterate forwards or backwards over the set of trajectories. next and prev methods will return True if a valid configuration has been read or False if you are at the end of the series of trajectories.

It is important that you initialize fixes after the configuration has been read such that bonds, angles, etc, are property read in. This restriction will be removed in future releases.

Other ways to read trajectories

One can also read in LAMMPS trajectories using the LAMMPS reader, or manually assign atom configurations using the python interface.

Table Of Contents

Previous topic

Writing Trajectories

Next topic


This Page