Using gmx distance for system with odd number of atoms

GROMACS version: 2022.1
GROMACS modification: Yes/No
Here post your question
I want to perform umbrella sampling to determine the detachment of an alkane from the surface of a silica slab. Now I followed Justin Lemkul’s tutorial and performed the SMD. Everything went well. After that I edited the bash script to calcuate the distance between the COM of silica and the molecule in each frame, but got an error. No values of distance was obtained against the time step.
Then I tried the distance with individual frame, but got an error as I had odd number of atoms for the silica slab. How to overcome the problem. Is it not possible to calculate the COM for groups containing odd number of atoms. another thing I want to ask is what is the syntax for the select option in gmx distance. Like if I want to calculate the distance between the COM of two groups, resnames SIL and resname DOD (for which I have index options under index.ndx), how should I express it under the select option?

Here you have some select syntax.
I don’t know exactly your problem, but I have a script with select option which is looks like that

for var1 in {600000..645000..450}
gmx select -f eq2_333temp_600_650ns.xtc -s eq2_333temp.tpr -b $var1 -e $var1 -select "(resname BGL or resname GLC) and y > 12.741 and y < 22.240 and z > 3.477 and z < 8.147" -on index_lipid_$number.ndx