[gmx-users] The energy output code

Mark Abraham Mark.Abraham at anu.edu.au
Wed Jun 21 10:35:02 CEST 2006


Shao Qing wrote:
> Gromacsers: 
> Hello, everyone. I want to calculate the interaction energy of molecules in certain region, like in the pore. Because the molecules can move inside the pore and outside it. A group is not suitable here, I guess. I do not find such tools in the gmx_tools, either. I want to change the code of the subroutine output energy in the mdrun to fulfill my aim. Could anyone tell me where the subroutine is? I mean, the subroutine to calculate the energy in the mdrun and output it to the edr.
> Thanks in advance  

Caveat, I'm not expert enough to be sure what I'm saying is right, but I
think it right!

It's not as simple as that. The energies (and forces) are computed
group-wise, so you need to construct a group back in the .top file
before evaluating the energy. The simplest way to do that would be to
decided in advance how many water molecules will be in the group, and at
each energy output step, recompute exactly which water molecules are
close enough to be part of the group, and fill the group data structure
with the corresponding indices. Then magically the energy for that group
will be calculated and appear in the .edr output.

Mark



More information about the gromacs.org_gmx-users mailing list