Files
lammps/tools/fep/fep.py
Axel Kohlmeyer 69c06791a5 import USER-FEP package from https://github.com/agiliopadua/compute_fep
copied the code into the suitable directories and made some adjustments
to include it cleanly. need to think about makeing derived classes, soft
core versions in USER-OMP and also soft-core versions of lj/sdk.
2014-04-18 14:35:23 -04:00

24 lines
480 B
Python
Executable File

#!/usr/bin/env python
# fep.py - calculate free energy from compute fep results
import sys, math
if len(sys.argv) < 2:
print "Free Energy Perturbation"
print "usage: fep.py temperature < fep.lmp"
sys.exit()
rt = 0.008314 / 4.184 * float(sys.argv[1])
v = 1.0
sum = 0.0
for line in sys.stdin:
if line.startswith("#"):
continue
tok = line.split()
if len(tok) == 4:
v = float(tok[3])
sum += math.log(float(tok[2]) / v)
print -rt * sum