Reading trajectories

Overview

Trajectories in xml format can be read in as follows:

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

state.readConfig.loadFile('myRestart.xml')

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

state.readConfig.next()

Or to iterate to the last configuration

state.readConfig.prev()

To move by a certain number of trajectories

#advance by 3 snapshots within this xml file
state.readConfig.moveBy(3)

#move backwards by 3 snapshots within this xml file
state.readConfig.moveBy(-3)

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

Atoms

This Page