Keeping the center of mass of a certain group at the center of the box during the simulation process

GROMACS version:2020.6
GROMACS modification: No

I want to know if gromacs can implement a function similar to fix recenter in lammps (https://docs.lammps.org/fix_recenter.html).

Description:
Constrain the center-of-mass position of a group of atoms by adjusting the coordinates of the atoms every timestep. This is simply a small shift that does not alter the dynamics of the system or change the relative coordinates of any pair of atoms in the group. This can be used to ensure the entire collection of atoms (or a portion of them) do not drift during the simulation due to random perturbations (e.g. fix langevin thermostatting).

This function can keep the center of mass of a certain group at the center of the box during the simulation process, which facilitates post-processing statistics, such as the wetting of droplets on the graphene surface.

Thanks!

Hi,
As far as I understand, what you need is already available using the comm-mode and comm-grps options. Hopefully they should do what you want. However, it will not specifically center the group in the system.

Otherwise, you will have to do the recentering after finishing the simulation, with gmx trjconv. I’m not sure why any post-processing statistics would require any recentering during the simulations.