Aleks Donev, Courant Institute, February 2023
These codes illustrate the (positional) Verlet algorithm for Molecular Dynamics and is meant for students, not for research. The parameters are set up to start in a gas state but then a small droplet should nucleate. Increase the number of atoms for larger droplets (but you may need to wait longer).
The main file is mddemo.py, and has some options at the top that you can change. To run this, execute (once):
f2py3 -c -m ljlib ljlib.f90 # If you have f2py and UseF2PY=True
gfortran -fPIC --shared ljlib_new.f90 -o ljlib_new.so # If UseF2PY=False
and then run with python3 mddemo.py. In ljlib_new.f90 I modernized the Fortran code to use Fortran 2003 for Interoperability with C, together with ctypes; the older code ljlib.f90 uses Fortran 90 and f2py. This makes the python caller code ugly. If someone makes this work with PyBind11 please let me know.
At present direct (runtime) visualization is broken. The original code used the visual package in python2, which has now become VPython in python3 (pip3 install --user vpython). I could not get it to work; if someone gets visualization to work please let me know. The code will write animnew.pdb which contains samples from the trajectory and can be opened with chimerax. There is a demo movie in Movies/DemoMD.mp4. To make such a movie using chimerax yourself, go to the subdirectory Movies, open chimerax, and then run the script using Open->DemoMD.cxc.