Tool to build force field input files for molecular dynamics.
fftool.py: python script to build simulation box of molecular or ionic liquids and their mixtures. Requires the Packmol software to create coordinates. Force field files are written in formats suitable for the LAMMPS or DL_POLY molecular dynamics packages.
Download the files or else clone the repository (easier to stay updated):
git clone https://github.com/agiliopadua/fftool.git
How to build an initial configuration of a molecular or ionic system.
-
For each molecule or ion prepare a file containing a z-matrix (
molecule.zmat). See theexamplesdirectory and check the Wikipedia entry for "Z-matrix (chemistry)". Thefftool.pyscript determines the connectivity (which atoms are linked by covalent bonds) from the z-matrix. Cyclic molecules require additionalconnectrecords to close rings. Improper dihedrals cannot be inferred from connectivity and must be indicated byimproperrecords. After the z-matrix supply the name of a database of force field parameters (database.ff). -
Use the
fftool.pyscript to create.xyzfiles for the molecules in your system and an input file forpackmol. For help typefftool.py -h. To build a simulation box with 40 ethanol and 300 water molecules and a density of 40.0 mol/L do:fftool.py 40 ethanol.zmat 300 spce.zmat --rho 40.0 -
Use
packmolwith thepack.inpfile just created to buid the simulation box (adjust the density if necessary):packmol < pack.inpAtom coordinates will be written to
simbox.xyz. You can use a molecular viewer such as RasMol or VMD to look at the.xyzfiles (fftool.pyhas an option to write IUPAC atomic symbols instead of the atom names from the force field). -
Use
fftool.pyto build the input files for LAMMPS or DL_POLY containing the force field parameters and the coordinates:fftool.py 40 ethanol.zmat 300 spce.zmat --rho 40.0 --lammps
-
Packmol: L. Martinez et al. J Comp Chem 30 (2009) 2157, DOI: 10.1002/jcc.21224
-
LAMMPS: S. Plimton, J Comp Phys 117 (1995) 1, DOI: 10.1006/jcph.1995.1039
-
DL_POLY: I.T. Todorov and W. Smith, Daresbury Lab.