LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] pylammps thermo_style issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] pylammps thermo_style issue


From: Gideon Simpson <gideon.simpson@...24...>
Date: Mon, 16 Oct 2017 21:56:57 -0700

I’ve been trying my hand at rewriting some examples using PyLammps, and I have the following difficulty with my rewrite of USER/DIFFUSE/in.msd.2d which makes an estimate of the mean square displacement.  The following is giving me trouble

If I use the lines

L.compute("msd", "all", "msd", "com", "yes")
L.variable("msd", "equal", "c_msd[4]")
L.thermo_style("custom","step", "v_msd")

It works as expected, but

L.compute("msd", "all", "msd", "com", "yes")
L.thermo_style("custom","step", “c_msd[4]")

generates the error

Traceback (most recent call last):
  File "msd2d.py", line 51, in <module>
    L.run(10000)
  File "/opt/lammps/python/lammps.py", line 689, in run
    self.runs += get_thermo_data(output)
  File "/opt/lammps/python/lammps.py", line 633, in get_thermo_data
    thermo_data = namedtuple('ThermoData', list(current_run.keys()))(*list(current_run.values()))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 351, in namedtuple
    'alphanumeric characters and underscores: %r' % name)
ValueError: Type names and field names can only contain alphanumeric characters and underscores: 'c_msd[4]'



-gideon