Re: [lammps-users] Compute force between certain groups

Hi, Axel,

I have addressed my problem following your great suggestions. Thanks again for your help.

It comes to me naturally that if it is possible to output per-atom quantities between two groups of atoms.
If so, I could bypass the 32 group limit with a post-processing analysis by defining the group during data curation.
So, is there any command for it considering Kspace calculation? Or can this be achieved by modifying the LAMMPS code?

Thanks in advance,
Jianbo Wang

The 32 group limit cannot be easily lifted, since it corresponds to a bitmask stored into a 32-bit data type and changing this to a 64-bit integer type (on supported platforms and with -DLAMMPS_SMALLBIG or -DLAMMPS_BIGBIG, but not -DLAMMPS_SMALLSMALL) would require changes to most files in the LAMMPS sources. This is one of the reasons why the “chunk” feature was introduced in LAMMPS as an alternate approach to partition subsets of atoms.

So if you would want to make a change to the source code, I would recommend implementing a compute chunk/chunk command instead of modifying the group support and compute group/group.

I seriously doubt that including kspace into the analysis would result in a significant improvement of the results. You require kspace for getting the correct trajectory because accurate treatment of long-range electrostatic interactions usually does have a significant impact on trajectories, but if you do analysis of this kind, the data you generate from the trajectory (force, energy) is going to be “noisy” anyway. When using rerun you do have an accurate trajectory, though, since you were simulating with kspace included, so even if you add a little more noise to the analysis data by using a cutoff coulomb you will still have the correct distribution of data (assuming that the noisiness due to the smaller number of data is following a normal distribution). However, the computational cost of adding kspace for all subsets can be substantial. This will be more significant the more groups/chunks you have as the cost will increase quadratically with the number of groups/chunks involved.