How to get potential energy of a single water molecule with the rest of the system

GROMACS version: 2020
GROMACS modification: No
I am trying to get the interaction energy of one water molecule with the rest of the system over an MD trajectory. First I defined a group in the index file call “BULK_H2O,” then I added this group to the mdp energy group option. I ran the MD for 10 ps and got the edr file. Finally, I use gmx energy to get the potential energy of this water molecule, but I am getting zeros for all kinds of interactions (LJ and coulomb).
The defines are there for position restraints of protein and ligand respectively.
Here’s my mdp:
define = -DPOSRES -DPOSRES_LIGAND -DPOSRES_FC_HG=1000 -DPOSRES_FC_HG_C=1000 -DPOSRES_FC=1000
integrator = sd
dt = 0.001
tinit = 0
nsteps = 10000 ; 10 ps
nstxout = 0 ; every 0.5 ps
nstvout = 0
nstfout = 0
nstxtcout = 500 ; every 0.5 ps
nstenergy = 500
energygrps = BULK_H2O BULK_rest
comm_mode = None
constraint_algorithm = lincs
lincs_iter = 2
constraints = all-bonds
nstlist = 20
ns_type = grid
rlist = 1.4
rcoulomb = 1.2
rvdw = 1.2
Tcoupl = no;
tc_grps = System
tau_t = 2
ref_t = 310
Pcoupl = no
pcoupltype = isotropic
tau_p = 1.0
compressibility = 4.5e-5
ref_p = 1.0
refcoord_scaling = com
pbc = xyz
gen_vel = yes
gen_temp = 310
gen_seed = 290389

I’m guessing you ran your simulation on a GPU, which cannot handle different energy groups. In any case, this is an analysis method and shouldn’t really be invoked during the run, anyway. Use mdrun -rerun on CPU only to recalculate the interaction energies.

Hi, thanks for the reply. Indeed I have run my MD on a GPU. I have tried “gmx mdrun -rerun md.xtc -nb cpu,” but I am still getting 0 for the interaction energies. I do have values for total potential though.

Which energy terms are you analyzing?

LJ-SR and Coulomb-SR of my water molecule vs. the rest of the system.

I’m seeing the same thing. This is the third thread that I’ve found with a very similar problem but without a resolution. Is there anyone that I can work with on this? I’m happy to upload files or work with a developer directly. Just let me know!

Thank you

Guy Vigers