Calculating MSD for a dynamic group

Dear LAMMPS Users,

I am simulating an interfacial system and I want to calculate the mean square displacement (MSD) of a dynamic group. However, I ran into the following error:

ERROR: Fix omsL1_COMPUTE_STORE does not allow use with a dynamic group (../modify.cpp:247)

I assume this means that the fix ave/time that I call on my compute msd cannot handle a dynamic group. Firstly, a suggestion to include this limitation as a restriction in the LAMMPS documentation. Secondly, does anyone have any workaround solutions for time averaging output in LAMMPS without first writing all the data to file and then doing this manually?


PS. For reference the relevant lines of my code are:

group           layer1 dynamic methane region layer1 every 100

compute       omsL1 layer1 msd
fix                 omsL1 layer1 ave/time 1 1 100 c_omsL1[1] c_omsL1[2] c_omsL1[3] c_omsL1[4] file diffusion_L1.dat

This is an ill-defined property, since you are computing the distance between particles at different times and they may have joined or left or rejoined or releft the dynamic group in between the first and the current step.

So even when computing this in post processing you have a problem and the computed value depend on what you decide about which atoms the MSD computation would apply to. If you only consider atoms that stay within that group all the time, then you have a bias on your results, when you consider atoms that were not in the dynamic group at all the time, your definition of what atoms this property applies to becomes fuzzy and also the results may be dependent on the length of the displacement.

Thanks for the reminder. Please note that LAMMPS is a very large software package and the implementation and documentation of compute msd predates the implementation of dynamic groups. It is near impossible to keep track of side effects. When implementing dynamic groups it was decided that computes predominantly will likely support dynamic groups (since few require “historic data”) while fixes not and because of that are the default settings for computes to accept dynamic groups except when explicitly disabled and for fixes to disallow dynamic groups except when explicitly enabled.