[lammps-users] something with fix ave/time

Dear all:
    I am puzzled with "fix ave/time command" in my simulation. When the simulation is
completed, the result observed by this command is:
                   # Time-averaged data for fix 2
                  # TimeStep v_etotal
                      100000 -11111.4
    The v_etotal is the total energy of the model. Well, from above, it can be found the v_etotal is -11111.4, the precision is so low, only achieving 0.1. But in the log file, the etotal energy shows high precision, eg,
-11111.4101838. Why? Is it a bug or something else? Thanks for an early answer. The input file is in the annex.

ceo.tension (1.39 KB)

I'ts not a bug; it's a valid answer.
In fix_ave_time.cpp is this line:
    for (i = 0; i < nvalues; i++) fprintf(fp," %g",vector_total[i]/norm);
Change %g to something like %20.10g if you want more precision.

Steve

2010/5/24 chenyunjun <[email protected]>: