Question about fix ave/time

Hello LAMMPS users,

I have searched the mailing list and I couldn’t anything relevant to my question. How can I use the average values stored by fix ave/time in the input file? I used the following command in my input file and I got the error: “ERROR: Divide by 0 in variable formula (…/variable.cpp:1515)”

It seems to me that since f_PAIR_ave vector defined in the following commands gets updated every ${df}, thus at the initial steps f_PAIR_ave[3] is zero and thus I get the error. If this is the case what can I do?

I also have another question. Is the size of f_PAIR_ave global vector 3?

Farshad

One error I notice is that you should add "mode vector" to the fix
ave/time command. There may be more, but we can't know from your
snippet.

Ray

And why don’t you try simply printing them to a file, or to the
screen as part of thermo output first, before using them to
do something else. E.g. use your script to debug what you
are trying to do, one baby step at a time. If the value
on some timestep is 0.0, then using it to divide by in
some other formula isn’t going to work.

Steve

Ray,

Thanks for your feedback. I think there is no need to add “mod vector”, since the variables I am going to take time average are components of a vector and hence are scalars.

Steve,

Thanks for your comments. I started new runs of simulation and as you said I saved the averaged values into a file and then I post-processed my results.

Farshad

And why don’t you try simply printing them to a file, or to the
screen as part of thermo output first, before using them to
do something else. E.g. use your script to debug what you
are trying to do, one baby step at a time. If the value
on some timestep is 0.0, then using it to divide by in
some other formula isn’t going to work.

Steve