jewettaij / moltemplate

A general cross-platform tool for preparing simulations of molecules and complex molecular assemblies
http://www.moltemplate.org
MIT License
254 stars 99 forks source link

issue 'bond atom missing in image check' #102

Open Gonglinquan opened 3 months ago

Gonglinquan commented 3 months ago

Hi jewettaij,

Recently I am using moltemplate to generate .data file. My system is composed of polymeric anions and Li-ion. So I build the .lt file by dividing the polymer into three parts, i.e. head, repeat unit, and tail according to the displayed examples. Also force field parameters of partial structures are taken from literature. My model is built by packmol. After finishing these steps I have got the relevant files successfully. But when I run a minimization task via lammps, the issue 'bond atom missing in image check' is reported. I checked the formation of all my .lt files and did not figure out what the problem is. Because you are the expert on this package, maybe I need your help to check my files to ensure if the issue is caused by the building process.

Please find complete contents the uploaded .lt files and please note that the pdb file is not allowed to upload so I uploaded the screenshot of the starting 10 rows. Thanks for your help in advance!

Best regards, Linquan

pdb_file forcefield.lt.txt Li.lt.txt mPET10.lt.txt mPET-head.lt.txt mPET-tail.lt.txt mPET-unit.lt.txt system.lt.txt

Gonglinquan commented 3 months ago

I have figured it out. This issue is caused by the atom order is not in accordance with the pdb file. Anyway thanks for your contribution on the development of moltemplate!

jewettaij commented 2 months ago

Thanks for posting your experience and your solution! That's awesome! I will leave this question open so that other people can discover it.

My only additional recommendation is to always visualize your system before running a simulation.

It's easy to get the atom order wrong when you are using PDB files. When it happens to me, I don't normally notice it until I visualize the system with VMD. (When I do, I see that the bonds are connecting the wrong atoms.)

To see these kinds of problems will want to use visualizer that draws bonds correctly as they appear in the ".data" or ".lmpdat" files generated by moltemplate. (This includes VMD but not OVITO.) If VMD is installed (and in your PATH), thenyou can launch VMD automatically when moltemplate finishes by adding the "-vmd" argument. For example:

moltemplate.sh system.lt -vmd

(It's the only way I use moltemplate.) Cheers!