[lammps-users] Extra bonds in VMD

Dear all,

I have been trying to make a simple simulation of two water molecules, and visualize it in VMD. You can find my input file as well as my data file below. When the simulation is done, I visualize the dump file using the “LAMMPS Trajectory” option in VMD, but I observe extra bonds. I have also attached an image of what I see in VMD. I have even asked LAMMPS to output the bonds and I am sure these extra bonds do not actually exist, but the image I get is ugly. Can anyone help in this regard.

Thanks,

Meysam

input file

water

atom_style full
units metal
boundary p p f
read_data water.dat
bond_style harmonic
angle_style harmonic
pair_style lj/cut/coul/long 10.0 20.0
group water type 1 2
pair_coeff 1 2 lj/cut/coul/long — – -
pair_coeff 2 2 lj/cut/coul/long — ---
pair_coeff 1 1 lj/cut/coul/long — ---
bond_coeff 1 — ---
angle_coeff 1 – —
kspace_style pppm 1.0e-4
kspace_modify mesh 20 20 20 slab 2.0
neighbor 3.5 bin
neigh_modify every 1 delay 0 one 400000 check yes page 5000000
velocity all create 0 12345
thermo 10
thermo_style custom temp pe etotal evdwl ecoul press pxx pyy pzz
fix 2 all nvt 300.0 300.0 10.0 drag 0.5
fix 3 all temp/rescale 100 300.0 300.0 0.01 1.0
timestep 0.00001
dump 1 all atom 100 dump.water
run&n bsp; 1000
data file
Water
6 atoms
4 bonds
2 angles
0 dihedrals
0 impropers
2 atom types
1 bond types
1 angle types
0 dihedral types
0 improper types
-1E+002 1E+002 xlo xhi
-1E+002 1E+002 ylo yhi
-2E+002 2E+002 zlo zhi
Masses
1 15.999400
2 1.008000
Atoms
1 1 1 -0.830 -1.1000000e+001 -7.0000000e+000 -9.0000000e+000
2 1 2 0.415 -1.0414118e+001 -6.2430500e+000 -9.0000000e+000
3 1 2 0.415 -1.0414118e+001 -7.7569500e+000 -9.0000000e+000
4 2 1 -0.830 -1.1000000e+001 -3.9000000e+000 -9.0000000e+000
5 2 2 0.415 -1.0414118e+001 -3.1430500e+000 -9.0000000e+000
6 2 2 0.415 -1.0414118e+001 -4.6569500e+000 -9.0000000e+000
Bonds
1 1 1 2
2 1 1 3
3 1 4 5
4 1 4 6
Angles
1 1 2 1 3
2 1 5 4 6

water.JPG

Dear all,

dear meysam,

I have been trying to make a simple simulation of two water molecules,
and visualize it in VMD. You can find my input file as well as my data
file below. When the simulation is done, I visualize the dump file
using the "LAMMPS Trajectory" option in VMD, but I observe extra

yes. that is to be expected. the LAMMPS trajectory reader in
VMD has to guess the bonds, since there is no indication of
the elements either, it guesses wrong.

bonds. I have also attached an image of what I see in VMD. I have
even asked LAMMPS to output the bonds and I am sure these extra bonds
do not actually exist, but the image I get is ugly. Can anyone help in
this regard.

you have to provide VMD with the required bonding and/or element
information. VMD tries to read "structure" first and if it cannot
find it in a file format, it tries to guess based on the element.
traditionally, the information is provided in a "topology" file,
e.g. a PSF file (VMD hails from supporting the NAMD MD code
which in turn uses X-Plor / CHARMM format data).

there are scripts in the LAMMPS tools directory, that you can use
to help generating this kind of file. but if you install the new
VMD 1.8.7 version (will be released in the next days), then there
is a much more flexible alternative. through a package of scripts,
that can parse most variants of LAMMPS data files and extract the
bonding information from there.

in your case, all you'd have to do would be:

package require topotools
topo readlammpsdata data.water full
animate write psf water.psf

and then just load the water.psf (or the data file)
before loading the dump file "into" it.

if you change the data file like this:

Masses
1 15.999400 # OH
2 1.008000 # HW
Atoms
       1 1 1 -0.830 -1.1000000e+001 -7.0000000e+000
-9.0000000e+000 # OW
       2 1 2 0.415 -1.0414118e+001 -6.2430500e+000
-9.0000000e+000 # HW
       3 1 2 0.415 -1.0414118e+001 -7.7569500e+000
-9.0000000e+000 # HW
       4 2 1 -0.830 -1.1000000e+001 -3.9000000e+000
-9.0000000e+000 # OW
       5 2 2 0.415 -1.0414118e+001 -3.1430500e+000
-9.0000000e+000 # HW
       6 2 2 0.415 -1.0414118e+001 -4.6569500e+000
-9.0000000e+000 # HW

the script will even recognize the elements from the comments
(this is an extension of the format that we use in our group
to be able to convert data files without loss of information
about atom type names between different codes.). lammps will
just ignore them.

hope this helps,
    axel.