Unwrapped in compute msd command

Hi,

I’ve read the LAMMPS manual, which states Initial coordinates are stored in “unwrapped” form, by using the image flags associated with each atom. See the dump custom command for a discussion of “unwrapped” coordinates. See the Atoms section of the read_data command for a discussion of image flags and how they are set for each atom. You can reset the image flags (e.g. to 0) before invoking this compute by using the set image command.

I am trying to calculate the diffusion of carbon dioxide in a polymer using the MSD command. For this, I am using the output from my sorption simulations as input parameters for an NVT ensemble. However, I would like my atoms to remain wrapped to avoid errors in the results. Could you advise on the correct procedure for this?

Specifically, if I use the read_data command followed by the set group co2 image 0 0 0 command, will this ensure that the MSD command correctly calculates the diffusion? Or is there something else I should do?

LAMMPS lets you do just about anything – it will even occasionally let you do the right thing.

So, for example, if you wanted to somehow calculate the difference between an atom’s original wrapped coordinates and its current wrapped coordinates, it’s as simple as:

  • using fix store/state to store the original wrapped coordinates
  • Accessing the current wrapped coordinates and subtracting the originals from them with atom-style variables
  • Squaring them (and weighting by mass if desired) with more atom-style variables and then reducing over the group with compute reduce.

But … why? Real-life atoms do not move by Pacman rules. What useful quantity are you hoping to calculate with Pacman mean squared displacement? (I’m not being facetious – I genuinely want to learn how various people use molecular dynamics; the learning is my only reward for being here!)