Dear Lammps Users,
I want to analyze a dump file using pizza.py,
I wrote a module that does that calculation and a main program that invokes it. The parameters that I use in my main program
to call the module is
t = calc_dev.calc_deviat(d1,d2,filename)
where the d1,d2 are the dumps that I assign in main program, and filename is the output file i want to write the analyzed information in.
I have 5 dumps and I need to analyze everyone with everyone.
that means dump_1 with dump_2, with dump_3 , with dump_4 and etc.
the same for dump_2 …
my programm works for dump_1 , dump_2 but when it calculates the dump_1 and dump_3 it says that index out of range on the line where I do d1.next()
So that probably means that I have already read this dump file, and I can’t read it more.
Is there any way to reset the current snapshot in dump-command to beginning?
here is my module that calculates what I need:
def calc_deviat(d1,d2,filename):
print "Now I am filling the " + filename + “\n”
natoms = 4050
begin_time = 0
fo = open(filename, “wb”)
v1=np.ones((3,natoms),dtype=float)
v2=np.ones((3,natoms), dtype=float)
while 1:
time = d1.next() ########## THIS IS THE ERROR LINE
print "timestep = ", time
d2.next()
if time == -1: break
calculate and write in file.
fo.close()
return 1
###########Error Message ##########################
<type ‘exceptions.IndexError’> list index out of range <traceback object at 0xa83cd24>
IndexError’> with value: list index out of range
error on line 34 of file ./main_program.py
error on line 28 of file module_calc_deviat_from_dumps.py
error on line 301 of file /home/vasilis/LAMMPS/lammps-6Dec12/tools/pizza-5Aug12/src/dump.py
Thank you,
Vasiliy.