Hi Steve:
I am making some positive progress, but am still stuck on something. I changed my pizza script to the following:
Hi Steve:
I am making some positive progress, but am still stuck on something. I changed my pizza script to the following:
Try something like this, which works on my box.
You just need to create a timestep-specific filename.
And de-select all steps before you delete.
Steve
d = dump("tmp.dump",0)
while 1:
time = d.next()
if time == -1: break
d.map(1,"id",2,"type",3,"x",4,"y",5,"z")
e = ensight(d)
e.one("tmp." + str(time),"id","x","y","z")
d.tselect.none()
d.delete()
Hi Steve:
Thanks. I think that there is something wrong with this line:
e.one("au_bignw_push"+str(time),"id","x","y","z","energy")
Which corresponds to line 13 in the dump_to_ensight_new.py through this error message:
I was only suggesting you pass a timestep-dependent
filename to e.one(). I didn't actually try it out. Looks
like you should use e.single(), not e.one().
I just noticed there is also an e.increment() option
which may do what you want. You would still
need to define d with the 2 args (2nd one 0) so
you didn't read the entire dump file up front.
E.increment() looks like it has the while loop that
reads one snapshot at a time inside it.
Steve
Hi Steve:
The E.increment command appears to work well:
e.increment("au_bignw_push","energy","PE")
It runs through all the snapshots, doesn't use much memory, etc. However, I get this error at the end, after the last timestep has been read:
wrote 123 snapshots in Ensight format
0 snapshots selected out of 1
1 snapshots deleted
0 snapshots remaining
<type 'exceptions.IndexError'> list index out of range <traceback object at 0x98ceb8>
IndexError'> with value: list index out of range
error on line 7 of file ./dump_to_ensight_new2.py
error on line 284 of file /Users/haroldpark/Desktop/lammps-17Aug07/pizza-10Aug07/src/dump.py
Which I'm not quite sure how to resolve. Here's my complete script:
This works for me. e.increment has the loop inside it
Steve
d = dump("tmp.dump",0)
while 1:
time = d.next()
if time == -1:break
d.map(1,"id",3,"x", 4,"y", 5,"z", 2,"type")
e = ensight(d)
e.change = 1
e.maxtype = 1
e.single(time,"tmp"+str(time))
d.tselect.none()
d.delete()