Merge branch 'maint'
[hoomd-blue.git] / doc / user / conversion_scripts.dox
blob1bdc8f549e01739b3eb393e9b86e9456e5917b2c
1 /*
2 Highly Optimized Object-oriented Many-particle Dynamics -- Blue Edition
3 (HOOMD-blue) Open Source Software License Copyright 2009-2014 The Regents of
4 the University of Michigan All rights reserved.
6 HOOMD-blue may contain modifications ("Contributions") provided, and to which
7 copyright is held, by various Contributors who have granted The Regents of the
8 University of Michigan the right to modify and/or distribute such Contributions.
10 You may redistribute, use, and create derivate works of HOOMD-blue, in source
11 and binary forms, provided you abide by the following conditions:
13 * Redistributions of source code must retain the above copyright notice, this
14 list of conditions, and the following disclaimer both in the code and
15 prominently in any materials provided with the distribution.
17 * Redistributions in binary form must reproduce the above copyright notice, this
18 list of conditions, and the following disclaimer in the documentation and/or
19 other materials provided with the distribution.
21 * All publications and presentations based on HOOMD-blue, including any reports
22 or published results obtained, in whole or in part, with HOOMD-blue, will
23 acknowledge its use according to the terms posted at the time of submission on:
24 http://codeblue.umich.edu/hoomd-blue/citations.html
26 * Any electronic documents citing HOOMD-Blue will link to the HOOMD-Blue website:
27 http://codeblue.umich.edu/hoomd-blue/
29 * Apart from the above required attributions, neither the name of the copyright
30 holder nor the names of HOOMD-blue's contributors may be used to endorse or
31 promote products derived from this software without specific prior written
32 permission.
34 Disclaimer
36 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' AND
37 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR ANY
39 WARRANTIES THAT THIS SOFTWARE IS FREE OF INFRINGEMENT ARE DISCLAIMED.
41 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
42 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
43 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
45 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
46 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
47 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 /*! \page page_conversion_scripts File Format Conversion
52 \section sec_hoomd_vmd_plugin Reading and converting HOOMD-blue XML files with VMD
54 As of version 1.8.7 the VMD molecular visualization software supports the HOOMD-blue XML format natively with read
55 and write support through its molfile plugin library and can be used to build systems and convert between
56 MD and visualization codes as well. Here are some examples using this:
58 \subsection sec_hoomd_vmd_structure Read a HOOMD-blue XML file into a VMD molecule
60 Load the structure \c file.xml into VMD, then add the trajectory frames in \c dump.dcd.
61 \code
62   mol new file.xml type hoomd waitfor all
63   mol addfile dump.dcd type dcd wairfor all
64 \endcode
67 \subsection sec_hoomd_vmd_input Converting from a HOOMD-blue XML file to a LAMMPS input file
69 Load \c file.xml into VMD, then use topotools write out \c file.data in the LAMMPS molecular format
70 \code
71   package require topotools 1.0
72   mol new file.xml type hoomd waitfor all
73   topo writelammpsdata file.data molecular
74 \endcode
76 \subsection sec_hoomd_vmd_data Converting from a series of HOOMD XML files to a LAMMPS dump file
78 Load a trajectory \c file*.xml into VMD, one frame at a time.
79 Then use topotools write out \c file.dump in the LAMMPS dump format
80 \code
81   set first 1
82   foreach f [glob file*.xml] {
83      if {$first} {
84          mol new $f type hoomd waitfor all
85          set first 0
86      } else {
87          mol addfile $f type hoomd waitfor all
88      }
89   }
90   animate write lammpstrj file.dump waitfor all
91 \endcode
93 This conversion can also be done into all other formats that have write support in VMD, e.g. psf, pdb, dcd.
94 Since pymol also uses the VMD molfile library, it eventually will also have native support for HOOMD-blue XML files added.
96 \subsection sec_hoomd_vmd_inverse Converting from a LAMMPS input file to HOOMD-blue XML
98 Load the LAMMPS input file \c file.data into VMD, then use topotools write out \c file.xml in the HOOMD-blue XML format.
99 \code
100   package require topotools 1.0
101   topo readlammpsdata file.data molecular
102   animate write hoomd file.xml waitfor all
103 \endcode