Rerun and interaction energy for dynamic selection

GROMACS version: 2019
GROMACS modification: No

Dear gromacs users,

I want to calculate the interaction energy between two groups, one of which is dynamic, so the molecule species change during the simulation. I was wondering what is the best thing to do. Is it possible to use rerun for each frame of the trajectory separately with the changing group or one has to rerun the whole trajectory? If so, what command I should use for the rerun to do it for a specific frame or time of the trajectory?

Thank you very much in advance.

Best regards,