to=5.0, resolution=0.1, orient=HORIZONTAL, label="Temperature") slider.bind('<ButtonRelease-1>', settemp) slider.set(temptarget) slider.pack(side=LEFT) Button(frame, text="Quit", command=quit).pack(side=RIGHT) frame.pack() tkroot.update() # wrapper on GnuPlot via Pizza.py gnu tool if me == 0: from gnu import gnu gn = gnu() gn.plot(xaxis, yaxis) gn.title(compute, "Timestep", "Temperature") # endless loop, checking status of GUI settings every Nfreq steps # run with pre yes/no and post yes/no depending on go/stop status # re-invoke fix langevin with new seed when temperature slider changes # after re-invoke of fix langevin, run with pre yes running = 0 temp = temptarget seed = 12345 lmp.command("fix 2 all langevin %g %g 0.1 %d" % (temp, temp, seed)) while 1:
#!/usr/bin/env python # Script: logplot.py # Purpose: use GnuPlot to plot two columns from a LAMMPS log file # Syntax: logplot.py log.lammps X Y # log.lammps = LAMMPS log file # X,Y = plot Y versus X where X,Y are thermo keywords # once plot appears, you are in Python interpreter, type C-D to exit # Author: Steve Plimpton (Sandia), sjplimp at sandia.gov import sys, os, code path = os.environ["LAMMPS_PYTHON_TOOLS"] sys.path.append(path) from log import log from gnu import gnu if len(sys.argv) != 4: raise Exception("Syntax: logplot.py log.lammps X Y") logfile = sys.argv[1] xlabel = sys.argv[2] ylabel = sys.argv[3] lg = log(logfile) x, y = lg.get(xlabel, ylabel) g = gnu() g.plot(x, y) code.interact()
Button(frame,text="Run",command=run).pack(side=LEFT) Button(frame,text="Stop",command=stop).pack(side=LEFT) slider = Scale(frame,from_=0.0,to=5.0,resolution=0.1, orient=HORIZONTAL,label="Temperature") slider.bind('<ButtonRelease-1>',settemp) slider.set(temptarget) slider.pack(side=LEFT) Button(frame,text="Quit",command=quit).pack(side=RIGHT) frame.pack() tkroot.update() # wrapper on GnuPlot via Pizza.py gnu tool if me == 0: from gnu import gnu gn = gnu() gn.plot(xaxis,yaxis) gn.title(compute,"Timestep","Temperature") # endless loop, checking status of GUI settings every Nfreq steps # run with pre yes/no and post yes/no depending on go/stop status # re-invoke fix langevin with new seed when temperature slider changes # after re-invoke of fix langevin, run with pre yes running = 0 temp = temptarget seed = 12345 lmp.command("fix 2 all langevin %g %g 0.1 %d" % (temp,temp,seed)) while 1:
#!/usr/local/bin/python -i # Script: logplot.py # Purpose: use GnuPlot to plot two columns from a LAMMPS log file # Syntax: logplot.py log.lammps X Y # log.lammps = LAMMPS log file # X,Y = plot Y versus X where X,Y are thermo keywords # once plot appears, you are in Python interpreter, type C-D to exit # Author: Steve Plimpton (Sandia), sjplimp at sandia.gov import sys,os path = os.environ["LAMMPS_PYTHON_TOOLS"] sys.path.append(path) from log import log from gnu import gnu if len(sys.argv) != 4: raise StandardError, "Syntax: logplot.py log.lammps X Y" logfile = sys.argv[1] xlabel = sys.argv[2] ylabel = sys.argv[3] lg = log(logfile) x,y = lg.get(xlabel,ylabel) g = gnu() g.plot(x,y) print "Type Ctrl-D to exit Python"