How to calculate electrostatic and van der waals interaction between two specific groups in gromacs?

GROMACS version: 2023.2
GROMACS modification: no

Hello, I performed molecular dynamics via gromacs on a biological system and now I would like to calculate electrostatic and van der waals interaction between two groups in my index file. However, it seems that it is impossible via gmx energy module and .edr file, since it does not prompt to select the group from index file. Can anyone help me with this?

thank you in advanced.

See if this workflow helps, it uses Gromacs tools under the hood but automates the generation of index files and new run input files:

You should be warned that computing enthalpic interactions between sub-parts of a system is useless in most cases. This is because there are strong compensations between enthalpy and entropy and on top of that, electrostatic interactions are long ranged and can have opposite signs, so decomposing those often gives misleading information.