[lammps-users] Question regarding fix ave/time

Dear LAMMPS Users,

I am having an issue when using the ave/time fix to record data, and I have been unable to find a solution. I wonder if anyone might be able to offer advice. Here is the issue:

I have a command like:

compute temp1 tube1 temp
fix tempavg1 tube1 ave/time 1 100 100 c_temp1 file temperature.tube1

When I have Nrepeat set equal to Nfreq, like above, the output file contains only the header, but no data. When I have Nrepeat < Nfreq, it works as expected. I thought this was due to the requirement that averaging periods do not overlap (i.e. that (Nrepeat-1)*Nevery < Nfreq ) but this should be just satisfied for Nrepeat = Nfreq, when Nevery = 1 as above. Indeed, if I set Nrepeat = 101, I get “ERROR: Illegal fix ave/time command”, which does not appear for Nrepeat = Nfreq.

So my question is, should this fix work for Nrepeat = Nfreq and Nevery=1 like I expect, and if so, what might the reason be that it doesn’t, given that no error message is printed?

Thanks very much,

When I add this line to bench/in.lj
fix 2 all ave/time 1 50 50 c_thermo_temp file tmp.ave
I get output to tmp.ave.

Are you using the current version of LAMMPS?


Dear Steve,

I am using the release from 21 Jul 2010 on my linux machine, and I also get the same result using the windows binary from 21 Dec 2010.

I tried adding that line to bench/in.lj on my linux setup, and it worked just fine, so I suppose it is a problem with my particular simulation.

I have attached a simplified .in and .data file that produce the problem on my two machines, in case those are helpful.

Thanks very much for the assistance,
Gene Cook

MWNT_9-9_and_14-14.in (656 Bytes)

MWNT_9-9_and_14-14.data (75.6 KB)

CH.airebo (770 KB)

I ran your script on my box, and get output on step 200. You won;t
get output on step 100 b/c you run a minimize first and it runs for a few
steps. Fix ave/time only operates during dynamics, not minimization.
So the dynamics run that follows can't do output on step 100 b/c there
all the preceding steps of dynamics weren't available.

I would definitenly try your script with the current version. I recall
some bug fixe that affects minimize/dynamics/ave-time since the older
versions you are using.


Thanks very much for the advice. I compiled the newest release (5 Feb 2011) and it seems to be working now on the linux machine.

Thanks again,