[lammps-users] average position particles

Hi all,

I'm trying to run a simulation where I thermally agitate the particles at a high temperature and then I want to get a final configuration. To get that final configuration
I use the following code:

#final equilibration
fix 1 all nve temp 300 300 100
run 1000000
unfix 1

I wanted to see if it is possible to generate a file with the average position of the particles after these 1000000 steps?

thank you very much

you can use fix ave/atom to compute average positions. you need to decide if you want wrapped or unwrapped positions. see the note about this in the documentation for fix ave/atom. at the end of the calculation (and after writing out a restart etc.) you can then define an atom style variable each for the average x, y, and z position and then use the set command to overwrite the current positions with the averaged positions from those variables and then write out a new data or dump file.