Hello LAMMPS users,
I modified my dump_atom.cpp such that the timesteps it outputs are time values rather than timesteps. As a result, my time values are non-integer type numbers, and I think dump2ensight.py (or dump.py specifically) has a problem reading in the snapshots. It ends up only getting the first snapshot (timestep: 0). I had some trouble reading through dump.py to find how it iterates to the next snapshot. Can somebody help me modify dump.py so that it can read these non-integer times? Thank you very much!
Jonathan
Hello LAMMPS users,
hello jonathan,
I modified my dump_atom.cpp such that the timesteps it outputs are time
values rather than timesteps. As a result, my time values are non-integer
do you mind explaining, what you need this for?
it is in general a bad idea to break a file format. there are too
many broken and inconsistent file formats around already, and
too many people invent new ad hoc formats that will create all
kinds of trouble in the long run.
it would be so much better to add a new output
section (lets call it ELAPSEDTIME:) that any decently
written parser of the lammps trajectory file format will
just ignore (unless you teach it to parse it).
type numbers, and I think dump2ensight.py (or dump.py specifically) has a
problem reading in the snapshots. It ends up only getting the first
snapshot (timestep: 0). I had some trouble reading through dump.py to find
how it iterates to the next snapshot. Can somebody help me modify dump.py
so that it can read these non-integer times? Thank you very much!
i would suggest that rather than hacking more tools to become
compatible with your hack and incompatible with the rest of the
world, you try the approach mentioned above.
cheers,
axel.
Hi Axel,
FYI, I am trying to synchronize my LAMMPS output with another output (from the atc fix) that uses time values instead of timesteps.
Your solution is viable as well, but I wouldn’t know how to do that either. I figured this was the simplest solution for myself, and I wouldn’t be committing it, so no harm done.
Jonathan
Jonathan:
One idea that would be relatively straightforward to implement would be to output the “real” time along with the step count in your log file. You could then read the two pieces of information together as a dictionary in Python (i.e., {step: time}). If you’re already trying to sync multiple files, reading one more can’t hurt. . . .
–AEI