Dear all,
I would like to see how the energy of my trajectory configurations change when changing some force field parameters. I thought using PyLammps was a convenient way as I am familiar with Python.
My idea was to use L.pair_coeff to redefine the force field terms and then rerun the trajectory.
I’ve seen that the potential energy of a run is very easily extracted with, for instance:
L = PyLammps()
for line in cmdstring.splitlines():
L.command(line)
L.run(1000)
L.runs[0].thermo.PotEng
where cmdstring contains my lmp file with all its commands except the run
(as a comment the lines:
L.runs[0].step #list of time steps in first run
L.runs[0].ke # list of kinetic energy values in first run
in the tutorial raise an error in my version)
Now, instead of run, I need to call rerun for the same trajectory.
I’ve tried:
L.command(‘rerun A-syn_HPS.300.atom last 10000 dump x y z’)
Which, works, but I don’t know how to capture its output. Is there a way?
If this is not possible with PyLammps, is there a way to do that with the python library interface. i.e.:
from lammps import lammps
#run lmp file here
lmp.command(‘rerun A-syn_HPS.300.atom last 10000 dump x y z’)
Again, I don’t know how to capture the output or get the thermo data.
Thanks.
Ramon