[lammps-users] a combination problem

Dear All,

I am going to add deformation in y direction and measure some property w.r.t to my system, using following commands.

fix id1 all deform 4000 y delta 0 10 remap x units box
fix id2 all ave/time 1 2000 4000 pressure file pressure.file

the first command is to deform y every 4000 steps, that is the deformation will happen at 4000, 8000, 12000,… The second command will average pressure at (2001,2002,…,4000), (6001,6002,…8000)… However, this may cause a problem since at time step 4000, 8000, 12000 the shape will change-so is the pressure. So I would like to compute average at (2000,…3999), (6000,7999), (10000,11999), in which case I do not know how I can write such command.
Any suggestion is greatly welcome. Thank you.


The fix ave/time options don't allow that. You can always
print out the pressure every timestep to a file and average
it yourself afterwards however you want.


Here's another idea. You could use fix ave/time
to calculate the ave P on steps 2000 to 4000 inclusive,
ditto for 6000-8000, etc. Then write a variable formula
(equal style) which uses that ave value and subtracts out the current
pressure (at step 4000) with the proper weighting to adjust the average to be
the ave for steps 2000-3999 inclusive. Then you can print
that new ave with thermo output (or write it to a file with
another fix ave/time) ...