I want to use compute com/molecule to calculate the centroid of the molecular ring.
But in my lammps version, there is no such command. In which version is this command in? Is anyone willing to share this part of the source code with me?
compute molchunk all chunk/atom molecule
compute molcom all com/chunk molchunk
and then read out the molecular centres of mass. If you only want the COM of one molecule, you can even go simpler by defining one group using that molecule and then using the xcm(group, dim) functions for equal-style variables.
You must go back to a very old version to find this command. This is not recommended. We have generalized the per molecule or per grid compute and averaging fix styles with a feature called “chunks” over 7 years ago. Please see: 8.3.2. Use chunks to calculate system properties — LAMMPS documentation