This is a short manual on how to use the On-The-Fly Molecular Dynamics program.
The program is intended to perform classical dynamics simulations of molecular systems using potential energy surface and gradients generated by external software on-the-fly.
The source code is available at the bitbucket.org. In order to download repository you should be included in the list of developers.
Input file description
The OTF-MD program uses the input file to specify parameters of calculations. Here we present an example of input file with description of parameter which can be modified by user.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# comments start with '#' character # this section is required [input] xyz_file = file_name # (required) - Path to initial geometry file in XYZ format. mol_file = file_name # (required) - Path to file with atomic numbers and atomic masses. vel_file = file_name # (optional) - Path to file with initial velocities. # Can be used when restart from previous run is required. # this section is required [external] run_script = file_name # (required) - Path to script file which will be used to calculate energy # and gradients on each propagation step. command = string # (required) - Command which should be executed to launch the specified script. # this is optional section [propagation] method = VelocityVerlet # (optional; default is VelocityVerlet) - Method of integration. dt = float_number # (optional; default is 1) - Propagation time step in fs. steps = integer_number # (optional; default is 1) - Number of propagation steps. # this is optional section [output] TMP_DIR = ./ # (optional; default is the directory where the program is launched) # Directory where calculations should be performed. XYZ_OUT = file_name # (optional; default is XYZ_$TSTEP.xyz) - Name of output file for molecular # geometry on each time step. VEL_OUT = file_name # (optional; default is VEL_$TSTEP.xyz) - Name of output file for velocities # of atoms on each time step. EG_OUT = file_name # (optional; default is EG_$TSTEP.out) - Name of output file which is produced # by external script. Energy and gradients will be loaded on each time step from this file. |
In order to simplify operations with variables in the input file, one can use the following template variables which will be substituted during program run.
- $RUN_SCRIPT – Run script file name with path. Can be useful in command string.
- $XYZ_OUT – XYZ output file on current propagation step. This file is assumed to be used in command string in order to provide an external script with the current geometry.
- $VEL_OUT – File with velocities on current propagation step.
- $EG_OUT – File with energy and gradient produced by external script.
- $TMP_DIR – Temporary directory variable.
- $TSTEP – Current time step.
Geometry files
The OTF-MD program reads geometry from two input files: xyz_file and mol_file.
The XYZ file specifies the molecule geometry by giving the number of atoms with Cartesian coordinates that will be read on the first line, a comment on the second, and the lines of atomic coordinates in the following lines. Atomic coordinates are in ångströms.
As an example here we present the content of XYZ file for the propiolic acid molecule.
1 2 3 4 5 6 7 8 9 |
7 comment line C 0.0000000000 0.4933010000 0.0000000000 C -0.2834320000 -0.9672660000 0.0000000000 C -0.5742820000 -2.1399970000 0.0000000000 O 1.4085850000 0.7153070000 0.0000000000 O -0.8432820000 1.4260230000 0.0000000000 H -0.8301210000 -3.1916200000 0.0000000000 H 1.4539890000 1.7447600000 0.0000000000 |
The MOL file specifies atomic numbers and atomic masses of atoms. The first column must contain the same atomic labels as specified in XYZ file. Second and third columns contain atomic numbers and atomic masses, respectively.
1 2 3 4 5 6 7 |
C 6.0 12.011 C 6.0 12.011 C 6.0 12.011 O 8.0 15.9994 O 8.0 15.9994 H 1.0 1.00782504 H 1.0 1.00782504 |
The VEL file has the same structure as XYZ file. However, instead of Cartesian coordinates it contains velocities written in [/a.u. of time] units.
External script to calculate energy and gradient
The script should take molecular geometry in XYZ format. For this provided geometry, the script should evaluate energy and gradient. Output should be formatted as following.
1 2 3 4 |
$energy ... [single number in Hartree] $gradient ... [set of numbers in Hartree/bohr] |
Analysis programs
Analysis of the molecular dynamics trajectory calculated with OTF-MD program can be performed with programs available in utils/ directory.
- calc_energies : calculates kinetic and potential energies of the system during trajectory. The third column are the total energy of the system. In case of absence of external fields the total energy of the system must be conserved.
In order to run the program, execute the following command. The input file is the same which was used for propagation.
1python calc_energies.py input.ini - create_xyz_anim : merges XYZ files into one. The output can be used to visualize XYZ trajectory. The input file is the same which was used for propagation.
1python create_xyz_anim.py input.ini - create_TGA_traj : creates trajectory files for analysis by TGA program.
123456789101112usage: create_TGA_traj.py [-h] -hess_fname HESS_FILE -out_path OUT_PATHINPUT_FILEoptional arguments:-h, --help show this help message and exitrequired arguments:INPUT_FILE Path to input file.-hess_fname HESS_FILEPath to file with hessian.-out_path OUT_PATH Path to directory where output trajectory will bewritten.