2
------- To view a lammps trajectory in VMD --------
5
1) Build a PSF file for use in viewing with VMD.
7
This step works with VMD 1.9 and topotools 1.2.
8
(Older versions, like VMD 1.8.6, don't support this.)
12
b) Menu Extensions->Tk Console
15
(I assume that the the DATA file is called "system.data")
17
topo readlammpsdata system.data full
18
animate write psf system.psf
22
Later, to Load a trajectory in VMD:
25
Select menu: File->New Molecule
26
-Browse to select the PSF file you created above, and load it.
27
(Don't close the window yet.)
28
-Browse to select the trajectory file.
29
If necessary, for "file type" select: "LAMMPS Trajectory"
32
---- A note on trajectory format: -----
33
If the trajectory is a DUMP file, then make sure the it contains the
34
information you need for pbctools (see below. I've been using this
35
command in my LAMMPS scripts to create the trajectories:
37
dump 1 all custom 5000 DUMP_FILE.lammpstrj id mol type x y z ix iy iz
39
It's a good idea to use an atom_style which supports molecule-ID numbers
40
so that you can assign a molecule-ID number to each atom. (I think this
41
is needed to wrap atom coordinates without breaking molecules in half.)
43
Of course, you don't have to save your trajectories in DUMP format,
44
(other formats like DCD work fine) I just mention dump files
45
because these are the files I'm familiar with.
47
3) ----- Wrap the coordinates to the unit cell
48
(without cutting the molecules in half)
51
b) Load the trajectory in VMD (see above)
52
c) Menu Extensions->Tk Console
53
d) Try entering these commands:
55
pbc wrap -compound res -all
59
Sometimes the solvent or membrane obscures the view of the solute.
60
It can help to shift the location of the periodic boundary box
61
To shift the box in the y direction (for example) do this:
63
pbc wrap -compound res -all -shiftcenterrel {0.0 0.15 0.0}
64
pbc box -shiftcenterrel {0.0 0.15 0.0}
66
Distances are measured in units of box-length fractions, not Angstroms.
68
Alternately if you have a solute whose atoms are all of type 1,
69
then you can also try this to center the box around it:
71
pbc wrap -sel type=1 -all -centersel type=2 -center com
74
You should check if your periodic boundary conditions are too small.
76
select Graphics->Representations menu option
77
click on the "Periodic" tab, and
78
click on the "+x", "-x", "+y", "-y", "+z", "-z" checkboxes.
80
5) Optional: If you like, change the atom types in the PSF file so
81
that VMD recognizes the atom types, use something like:
83
sed -e 's/ 1 1 / C C /g' < system.psf > temp1.psf
84
sed -e 's/ 2 2 / H H /g' < temp1.psf > temp2.psf
85
sed -e 's/ 3 3 / P P /g' < temp2.psf > system.psf
87
(If you do this, it might effect step 2 above.)