Plotting LAMMPS output in real time

Dear all,
I’d like to plot and visualize in real time what comes out from my LAMMPS input script.
I tried with the vizplotgui_vmd.py tool, using the exact syntax I found in the file, but it just started running as usual in the shell and nothing else showed up.

Any suggestion?

Thanks

Dear all,
I'd like to plot and visualize in real time what comes out from my LAMMPS
input script.
I tried with the vizplotgui_vmd.py tool, using the exact syntax I found in
the file, but it just started running as usual in the shell and nothing else
showed up.

Any suggestion?

there *have* to be some kind of error messages.

do you have all prerequisites set up? have you tried the provided examples?
those scripts are not to be used blindly, but given as an example for
people to adapt to their needs.

in any case, forcing LAMMPS to be directly connected to a
visualization like in those python script examples is almost always a
bad idea unless you are using it for demonstration purposes.

if you want proper real time visualization of the positions with VMD,
use fix imd.
if you want to look at your thermo output, use and adapt something
like logplot.py from the tools directory, or
perl+gnuplot/xmgrace/whatever, or awk+gnuploy/xmgrace/whatever and so
on.

if set up correctly, that keeps your simulation independent from the
visualization.

axel.

p.s.: most people just visualize the trajectory as it is accumulated.
there is very little to be learned from running interactively unless
you hook this up to a virtual reality system and/or connect to an
interactive manipulation device, eg. a VR-wand, or a 3d mouse, or a
haptic device.

I’m sorry, I posted the wrong error.

The command is:

$ python logplot.py log.lammps Step Temp

and i got THIS error :

46 10000 10032 100000
read 5505 log entries
Traceback (most recent call last):
File “logplot.py”, line 25, in
x,y = lg.get(xlabel,ylabel)
File “/Users/MicheleFormica/Desktop/Nano/log.py”, line 148, in get
vecs[i][j] = self.data[j][map[i]]
IndexError: list index out of range

I'm sorry, I posted the wrong error.

The command is:

$ python logplot.py log.lammps Step Temp

and i got THIS error :

46 10000 10032 100000
read 5505 log entries
Traceback (most recent call last):
  File "logplot.py", line 25, in <module>
    x,y = lg.get(xlabel,ylabel)
  File "/Users/MicheleFormica/Desktop/Nano/log.py", line 148, in get
    vecs[i][j] = self.data[j][map[i]]
IndexError: list index out of range

so you got to figure out why. it is impossible from here. if you don't
know python, you better start learning it, or find a local python guru
(there are plenty of them nowadays).

i would be using awk or perl for this anyway and not python. but then
again, i am an old fart and have learned all those old-fashioned
scripting languages that were around long before python became
popular.

axel.

Got it!
Thanks a lot for your help.

Michele