Visualizing hydrogen bonds using lammps or vmd


I’m currently working on a simulation in Lammps and I want to know the number of hydrogen bonds present in water molecules. Unfortunately, I couldn’t find a specific command for this in the Lammps manual. So, I’ve decided to use the Hydrogen Bonds plugin in VMD. However, Unfortunately, I’ve encountered a problem with the plugin. After loading a dcd and psf file in VMD and applying the plugin, it doesn’t display any hydrogen bonds in the plot. Even when I select HBonds from the Drawing Method in the Graphics bar, it still doesn’t display any hydrogen bonds, despite the simulation containing numerous water molecules.

Here are the dump commands I’ve used in my input file :

dump Dynamic all atom 1000 equilib2.lammpstrj
dump dcdfile all dcd 1000 dump.dcd
dump_modify dcdfile unwrap yes

I’m wondering if dcd and lammpstrj files should contain specific information to be able to visualize hydrogen bonds or if I should modify these commands in Lammps so that I can see the hydrogen bonds in VMD.


Please note that the .lammpstrj file contains mostly the same information as the dcd file. For visualization in VMD, you best generate a .psf file. A tutorial for that can be found here:

For hydrogen bond analysis, you would need to do additional scripting to make sure that VMD can recognize hydrogen bond donors, acceptors, and the hydrogens properly. That usually requires to use CHARMM force field naming conventions for atom name and type. LAMMPS doesn’t do any of that since it uses numeric atom types. Data files created by VMD’s TopoTools plugin can retain some of the information, if it existed previously, by adding corresponding comments that are ignored by LAMMPS but read and interpreted by VMD when reading the data file with TopoTools.

1 Like

Thanks for your explanation. It was helpful. I think the problm is the process of creating my psf file.