Molecular Dynamics
******************

FlexMD defines the molecular system under study through the
**MDMolecule** class: an instantiation of this class holds all
information about the molecular system to be simulated, such as
coordinates, topology, and force field parameters (if needed). An
**MDMolecule** object can be initialized from a PDB or XYZ file by
specifying its path at object creation.

An interface to energy evaluators is provided by specialized
**ForceJob** classes, acting as wrappers around the ADF suite of
programs. A **ForceJob** requires an **MDMolecule** object to be
specified at creation. The resulting **ForceJob** object can either be
used directly by the Atomistic Simulation Environment (ASE) [1]
library as a calculator object (see examples/scmlib/ASE_emt_h2o) or
with the **ASEMDPropagator** class, which provides methods for running
an MD time step using ASE classes. Internally, the propagator sets up
the required ASE objects, passes the **ForceJob** object to them, and
retrieves the new positions and velocities. An additional protagonist,
an **MDManager** class instance, coordinates the MD simulation by
running the MD steps with the **ASEMDPropagator** object and writing
trajectory information to file.

During creation of an **MDManager** object, a directory ‘QMMD’ is
created, which contains a file TRAJEC00.DCD holding the geometries
along the trajectory, a file FTRAJEC00.DCD holding the forces along
the trajectory, and finally a file ENERGY00.dat holding the potential
and kinetic energy, as well as the temperature throughout the
evaluation. To extract the geometries from the trajectory file, the
**DCDFile** class is available, providing methods to read and write
geometries to and from a trajectory file in DCD format. The
**MDManager** is also responsible for handling the restart of a
previous MD evaluation: if a 'QMMD' directory is already present at
script invocation, the new output files will be assigned the number
subsequent to the highest numbered files in that directory. In
addition, provided the previous run terminated normally, the restart
will continue from the final geometry and velocity of the previous
run.

The ADF package contains different electronic structure methods of
varying degrees of accuracy and speed. The best-known methods are the
ADF Density Functional Theory (DFT) code itself and the BAND DFT code
for periodic systems. FlexMD provides an interface toward both
programs. For the interface with ADF, FlexMD makes use of classes from
PyADF [2], a scripting framework for efficient quantum chemistry
calculations. In addition to ADF and BAND, several semi-empirical
methods are included in the ADF suite, such as DFTB and the NDDO type
schemes available in the MOPAC package [3]. The ADF suite also
provides classical mechanics methods, such as the reactive force field
ReaxFF and the simple force field UFF. Interfaces to all of these
methods are available in FlexMD. A simple example of a Python script
for MD using the **UFFForceJob** class for UFF calculations can be
found in the examples directory, under examples/scmlib/flexmd_uff_h2o.

To increase the flexibility of FlexMD, an interface towards force
calculations using the NAMD2.8 classical molecular dynamics package is
provided (examples/scmlib/namd_h2o). NAMD2.8 is not distributed with
the ADF suite, but it is available from a third party to be downloaded
and installed
(https://www.ks.uiuc.edu/Development/Download/download.cgi).
