Hello everyone,
I needed some guidance on the calculation of the atomic position vector as a coarse variable.
For a scalar state function (say, for ex, potential energy), I calculate the running average using the command:
fix 2 all ave/time 1 1 1 c_1 ave running
fix 3 all vector 1 f_2
So, in this first line fix 2, ‘running’ is the keyword to calculate the running time average. Then, in the 2nd line, I store those running time averages as components of a vector fix 3, which is essential to calculate the convergence of the same.
So, how do I perform a similar drill now for the atomic position vector as a state function? I have tried to find relevant commands. I got one command as fix ave/atom. I have shown an example of this command below:
fix 1 all ave/atom 1 100 100 x y z
But, in this command, there is no ‘running’ keyword to calculate a running time average. Also, if the running time average is calculate then how do I store them as I did in the previous case for the calculation of convergence?
variable varID atom id
compute cID all chunk/atom v_varID nchunk once ids once
variable xpos atom x # look up documentation yourself for unwrapped x, y, z
variable ypos atom y
variable zpos atom z
fix run_ave_pos all ave/chunk 1 100 100 cID v_xpos v_ypos v_zpos ave running
Of course, whether this is a good idea or not, or whether this is a feasible idea or not, is up to you to find out. I suspect that this may become moderately more feasible if you (1) identify the atoms of interest (surely you don’t want the per-atom running average positions of all atoms in your system, do you?) and (2) group only those atoms and then (3) pass that group, instead of all, to the fix chunk/ave command.