library interface to computes

Indeed, this does work (just tested). In fact, on the python
interface, it's as simple as:

lmp.extract_variable("foo", None, 0)

where lmp is an instance of the lammps class, and foo has been defined
via a variable command as mentioned. the "0" argument is to indicate
that it is a single, rather than array, return value, and the function
handles converting to a Python float for you -- very neat! :slight_smile:

Joe

You can also do this without defining a variable,
by the lib function lammps_extract_compute.
There is a pre-defined compute thermo_pe, which
will have the potential energy of the system after
a run. If you want PE + KE, then a variable like
you have defined is the best route.

Steve