overwrite output file.

Hi all lammps users,

I have a more general question for the lammps forum which is regarding my input script. My lammps input script is working with a loop variable and at the each loop iteration, script creates an output data line and write it into a file. If the length of the loop is ‘n’, I expect there are n data lines in the output file at the end of the simulation. But I am getting only one output line which is related to the last loop run. Then I realize that my input script overwrite the output file at the each loop iteration. So my question is how I can write single output file containing all data which are related to all loop increments. (Because I don’t want to generate n # of separate output files for each loop iteration).

Following is a part of input script.

Hi all lammps users,

I have a more general question for the lammps forum which is regarding my
input script. My lammps input script is working with a loop variable and at
the each loop iteration, script creates an output data line and write it
into a file. If the length of the loop is 'n', I expect there are n data
lines in the output file at the end of the simulation. But I am getting only
one output line which is related to the last loop run. Then I realize that
my input script overwrite the output file at the each loop iteration. So my
question is how I can write single output file containing all data which are
related to all loop increments. (Because I don't want to generate n # of
separate output files for each loop iteration).

appending to an existing file is almost always a very bad idea,
especially on any kind of networked or scratch file system, since it
comes with a huge risk of corrupting the *entire* file, if something
goes wrong. nothing is keeping you from concatenating individual files
after the fact.

on top of that, calling ave/time with 1 1 1 is a rather pointless
operation. why not use fix print and avoid a lot of overhead?

axel.

Thank you so much, Dr. Axel. It solved the problem.

Nira.