File Conversion Scripts
A number of file conversion scripts for converting between HOOMD's XML format and other formats are provided in the hoomd/bin directory. These scripts should already be in your PATH and executable from the command line.HOOMD XML -> LAMMPS input
hoomd2lammps_input.py converts a HOOMD XML file to the LAMMPS input format. It handles positions, velocities, and bonds (if present in the XML file). To run, execute the script on the command line: hoomd2lammps_input.py input_file.xml output_file.data
Here is the output of the above command when run on share/hoomd/demos/micelle.xml:
Found 9500 particles
Mapped particle types:
{'A': 1, 'B': 2}
Found 9000 bonds
Mapped bond types:
{'polymer': 1}
The script notifies you how many particles, velocities and bonds it reads. Types must be handled in a special way: HOOMD reads types by name, but LAMMPS requires a positive integer from 1 to the number of types. hoomd2lammps_input.py scans the input XML and automatically assigns an integer to every type in the order in which they first appear. The output
Mapped particle types:
{'A': 1, 'B': 2}
HOOMD XML -> LAMMPS dump
hoomd2lammps_dump.py converts a series of HOOMD XML files into the LAMMPS dump format. The output file will be formatted as if generated from the LAMMPS command dump 1 all atom. The use of scaled coordinates in the output can be disabled on the command line by specifying the option --noscale.Say you have an entire series of dump files from dump.xml in the current working directory. Then
hoomd2lammps_dump.py -o dump.lammpstrj *.xml
The particle type name to type id handling is the same as in hoomd2lammps_input.py: HOOMD XML -> LAMMPS input
Other formats
If you need to convert to a different format, open one of the existing scripts and see if it can be modified for your needs. The scripts are written in python and the code is easy to read and modify.Generated on Tue Mar 24 17:40:34 2009 for HOOMD by
1.5.7.1


