Pyforce is a custom package for LAMMPS, adding a fix command for calculating forces with Python.
Author: Jinzhe Zeng
Email: jzzeng@stu.ecnu.edu.cn
Download LAMMPS first, then
git clone https://github.com/njzjz/Pyforce.git
cp -r Pyforce/USER-PYFORCE/ $LAMMPS_DIR/src
cd $LAMMPS_DIR/src
make yes-user-pyforce
make serial
Add a line in LAMMPS input file:
fix 1 all pyforce C H O
where C, H and O are names of elements.
Also, a Python program force.py
, which reads the XYZ format file comb.xyz
and writes the forces file force.dat
, should be put in the folder.