Gmx distance com error

GROMACS version:2016.4

Hello gmx users,

I am stuck at a very basic command line and need your expertise in dealing with it.

I have a clay sheet containing 192 surface oxygen. I am doing umbrella sampling for site-specific PMF calculations and want to get the progression of COM distances of my fixed Cs atom from the center of mass of the topmost clay sheet (basically a specific hexagonal site containing 6 oxygen atoms out of the 192 surface oxygen) over time.

Figure 1, Front view

                                                         Cs atom 
                                                 o----o---o---o---o  (Surface oxygen, front view)

Figure 2, Top view (Hexagonal cavity)

                                                        /               \
                                                      /                  \
                                                      o        Cs         o
                                                      \                   /
                                                        \                /

I have already created a special index file which has relevant groups such as ;

group 18 --> referenceSurface ~containing 6 surface oxygen

group 19 --> restrainedCs ~containing 1 Cs atom (basically the one that I have fixed)

group 20 --> another Cs atom (this one is not fixed and can move freely in all sample space during the entire course of the simulation)


Case 1

gmx_mpi distance -n index.ndx -f conf1.gro -s pull.tpr -select ‘com of group 18 plus com of group 19’ -oxyz dist1.xvg

Inconsistency in user input:
Invalid index group reference(s)
Group ‘referenceSurface’ cannot be used in selections except as a full value
of the selection, because atom indices in it are not sorted and/or it
contains duplicate atoms.

Case 2

gmx_mpi distance -n index.ndx -f conf1.gro -s pull.tpr -select ‘com of group 19 plus com of group 20’ -oxyz dist1.xvg

Reading file npt.tpr, VERSION 2016.4 (single precision)
Reading frames from gro file ‘Generated by trjconv : clay + Cs + acetate + water t= 2.00000’, 24221 atoms.
Last frame 0 time 2.000
Analyzed 1 frames, last time 2.000
com of group 19 plus com of group 20:
Number of samples: 1
Average distance: 1.39928 nm
Standard deviation: 0.00000 nm

My understanding is that if I compare the above 2 cases, I would say that for case 2, it is measuring the distance of my fixed Cs atom with the other Cs atom which is free to move. No problem here, whereas for case 1, Cs atom is measuring its distance from all 6 oxygen atoms, somehow not understanding how to take the center of mass of the hexagonal cavity containing 6 atoms.

Approach taken:

  1. Modified my command line from this:

gmx_mpi distance -s pull.tpr -f conf1.gro -n index.ndx -select ‘com of group “restrainedCs” plus com of group “referenceSurface”’ -oall dist1.xvg

  1. Used all output options like -oav / -oxyz

I have followed the following threads, but still couldn’t manage to rectify this error

Please help. I am pretty much sure that I am overseeing a very basic step.


Have you checked the index group to make sure there are no repeating atoms and all atom numbers are in increasing order?

Thank you @jalemkul, arranging all the atom numbers in the increasing order did the trick. !!!