Writing Trajectories


Write a restart file every writeEvery turns in xyz or DASH-specific xml format. A WriteConfig object must be created as shown below. At this point, the write() method can be called to immediately write a configuration, or the WriteConfig can be activated and configurations will be written every writeEvery turns.

Output is performed asynchonously, allowing restarts to be written frequently with minimal performance impact.

If units are set as real and format is xyz, atomic numbers for the xyz for will be guessed from the atomic mass. If the atomic number cannot be guessed, the atom type will be used.


Basic usage

#Create WriteConfig object which will write configurations
#to myRestartFile.xml every 1000 turns.  Multiple configurations
#are written to the same xml file
writeConfig = WriteConfig(state, fn="myRestartFile", writeEvery=1000, handle="writer1", format="xml")

#write a configuration

#active the writer.  Now turns will be written every 100 turns.

Writing one file per config (can be done with any format)

#Adding a * to the file name tells DASH to create
#one file per configuration where the current
#turn is substituted for *
oneFilePerConfig = WriteConfig(state, fn="myRestartFile_*", writeEvery=1000, handle="writer1", format="xml")

Writing xyz files

#Writing xyz
oneFilePerConfig = WriteConfig(state, fn="myRestartFile_*", writeEvery=1000, handle="writer1", format="xyz")


WriteConfig(state, fn, handle, format, writeEvery, groupHandle, unwrapMolecules)


State to output
Output filename. Named argument. File extension is automatically appended.
A name for the object. Named argument.
Write file every writeEvery turns. Named argument.
Group of atoms to output. Named argument. Defaults to all.
Unwrap Molecule objects across periodic boundaries

Table Of Contents

Previous topic

Recording Data

Next topic

Reading trajectories

This Page