Dear All,
How do I convert this Ethylene glycol topology and parameter set in GROMACS format to LAMMPS format?
The set was obtained from this paper https://doi.org/10.1021/jp109914s
#define _FF_OPLS
#define _FF_OPLSAA
[ defaults ]
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ
1 3 yes 0.5 0.5
[ atomtypes ]
; name bond_type mass charge ptype sigma epsilon
CG CG 6 12.01100 0.1650 A 3.50000e-01 2.76144e-01
HG HG 1 1.00800 0.0600 A 2.50000e-01 1.25520e-01
OG OG 8 15.99940 -0.7200 A 3.00000e-01 7.11280e-01
HO HO 1 1.00800 0.4350 A 0.00000e+00 0.00000e+00
[ bondtypes ]
; i j func b0 kb
CG CG 1 0.15290 224262.0
CG HG 1 0.10900 284512.0
CG OG 1 0.14300 267776.0
OG HO 1 0.09450 462750.4
[ angletypes ]
; i j k func th0 cth
CG CG OG 1 108.00 418.40
CG CG HG 1 110.70 313.80
HG CG HG 1 107.80 276.14
HG CG OG 1 109.50 292.88
CG OG HO 1 108.50 460.24
[ dihedraltypes ]
; i j k l func coefficients
OG CG CG OG 3 9.852 11.989 4.987 -26.828 0.000 0.000
CG CG OG HO 3 -0.141 5.591 3.156 -8.606 0.000 0.000
; Fourier coefficients
; angle F1 F2 F3
; OCCO 16.264 -4.987 13.414
; CCOH 1.727 -3.156 4.303
Best regards,
Yunes Salman
If you are planning to work with organic materials, I suggest giving a go to Moltemplate. It is a scripting language to render LAMMPS-template (LT) files into a working input deck. It has useful functions, like combining a structure file (DUMP, PDB, XYZ) with the force field describing individual molecules. It ships an oplsaa.lt
file with the whole force field and settings.
Here an example of a simple molecule, formamide, written in the LT format:
import "/usr/local/moltemplate/moltemplate/force_fields/oplsaa.lt"
# The "oplsaa.lt" file contains force-field parameters, atom type definitions,
# partial charges, masses and bond-angle rules for the atoms in your system.
_FAM inherits OPLSAA {
# atom-id mol-id atom-type charge X Y Z # comment
write('Data Atoms') {
$atom:C00 $mol @atom:177 0.00 0.100014490 0.490422099 0.0
$atom:O01 $mol @atom:178 0.00 1.091153187 -0.250749643 0.0
$atom:N02 $mol @atom:179 0.00 -1.121616690 -0.181085754 0.0
$atom:H03 $mol @atom:182 0.00 -2.013715893 0.272535813 0.0
$atom:H04 $mol @atom:182 0.00 -1.056768463 -1.190185868 0.0
$atom:H05 $mol @atom:221 0.00 0.144676387 1.570292021 0.0
}
# Note: You don't have to specify the charge in this example because we are
# using the OPLSAA force-field which assigns charge according to
# atom-type. Just leave these numbers as 0.00 for now.
# Note: LAMMPS expects an integer in the 2nd column (the Molecule-ID number).
# If we put "$mol" there, moltemplate will generate this integer for you
# A list of the bonds in the molecule:
# BondID AtomID1 AtomID2
write('Data Bond List') {
$bond:C1 $atom:C00 $atom:O01
$bond:C2 $atom:C00 $atom:H05
$bond:C3 $atom:C00 $atom:N02
$bond:C4 $atom:N02 $atom:H03
$bond:C5 $atom:N02 $atom:H04
}
# In the "Data Bond List" section we don't have to specify the bond type.
# The bond-type will be determined by the atom type (according to "oplsaa.lt")
}
This is technically a forum for LAMMPS, but I believe that MOLTEMPLATE really unleashes the true potential of LAMMPS by rendering complex structures into perfect data and input files. Good luck!
2 Likes
Thank you very much for this tip. I used Moltemplate before but I didn’t know about this function.