As Axel said, it’s probably not a good idea to use a large complicated system to test your conversion. It’s better to use a tiny molecule for comparison. Create a simulation that contains only a single small molecule. (In the example below, I use ethylene.) Make sure this small molecule contains both dihedral and improper interactions. Make sure not to use a conformation of the molecule which is not in equilibrium. (In an equilibrium conformation, the forces on all the atoms will be 0. Probably both LAMMPS and GROMACS will agree that the forces are 0. This does not tell you anything.)
Question for Xuejiao:
Did you convert the entire GROMOS force field into moltemplate (LT) format?
Or did you convert only the ITP files containing the atomic coordinates and bond topology of a molecule into moltemplate format? (If you have code which can convert ITP files into moltemplate format, please share it with me, and I will find a way to give you credit for the contribution. I recently submitted a paper on moltemplate with all of the people who contributed force fields as coauthors.)
Andrew
P.S. If it helps, here is the protocol we used to test the DREIDING force field using ethylene. This is the way we did it, but I worry the long explanation below may be more confusing than helpful. Feel free to skip the rest of this email.
----- Details (feel free to skip) -----
When Matt Bone converted the DREIDING force field into moltemplate format, we ran into the same problem. We created some moltemplate files for ethylene in different conformations. If it helps, I have attached these files. Ethylene is probably the simplest and smallest molecule that you can use for this purpose. (Don’t use alkanes because they lack improper interactions.)
To test whether the dihedral interactions were converted successfully, calculate the forces on a conformation of ethylene which has been twisted around its central axis using both LAMMPS and GROMACS. (Although potential energy is not a meaningful way to compare the behavior of the molecule in LAMMPS and GROMACS, differences in energy are meaningful and can be compared. So if you don’t like measuring forces, you can instead measure the difference in potential energy of the twisted conformation of ethylene with the relaxed conformation of ethylene, using both LAMMPS and GROMACS. These energy differences should agree. The relevant files are “ethylene_rotate.lt” and “ethylene.lt”)
Similarly, to test the improper interactions, I would use a conformation where the 3 atoms surrounding each carbon atom are not coplanar. (Such a conformation is stored in the “ethylene_improper_sym.lt” file which is attached. I would try this first.)
Again, the moltemplate files I attached contain different conformations of the same ethylene molecules, but these were intended to be used with the DREIDING force field. You are not using the same force field, so you will have to create your own version of the ethylene LT file and copy the coordinates from my attached files into your LT file. You will also have to create equivalent versions of ethylene in GROMACS format so that you can compare with gromacs.
Protocol:
-
Edit the “ethylene.lt”, “ethylene_improper_sym.lt”, and “ethylene_rotate.lt” files to make sure that the partial charge of each atom agrees with the charges that GROMACS is using. (Alternatively, set all atom charges to 0.)
-
Edit the “system.lt” file and select which conformation of the molecule you want to simulate by uncommenting the line containing the version of the molecule you want. (Either “ethylene_improper_sym.lt”, or “ethylene_rotate.lt”, or “ethylene.lt”. I would start with “ethylene_improper_sym.lt”.)
-
Run moltemplate:
moltemplate system.lt -
Run LAMMPS
lmp_mpi -i run_print_pe.in
(I created the “run_print_pe.in” script to make sure you are measuring the potential energy at t=0, before any relaxation has occurred. Note: The name of your LAMMPS executable binary (“lmp_mpi”) may vary.)
-
Make note of the potential energy of the system when the molecule is not flat:
-
Edit the “system.lt” file again, and uncomment the line containing “ethylene.lt”, and comment out the other lines. (ie, comment out the line containing “ethylene_improper_sym.lt”.)
Then repeat steps 3-5)
(In the “ethylene.lt” file, the conformation of the molecule is flat and very close to its equilibrium conformation.)
-
Subtract the potential energies (flat vs. not-flat).
-
Do the same thing in GROMACS
README_visualize.txt (2.85 KB)
ethylene_improper_sym.lt (757 Bytes)
ethylene_rotate.lt (764 Bytes)
ethylene.lt (764 Bytes)
system.lt (211 Bytes)
run_print_pe.in (958 Bytes)