[gmx-developers] Extracting i-j forces from nb_generic.c

David van der Spoel spoel at xray.bmc.uu.se
Tue Dec 31 10:29:29 CET 2013

On 2013-12-31 08:15, James wrote:
> Dear Gromacs developers,
> To measure thermal conductivity using Green-Kubo I am trying to extract
> the i-j atomic forces from nb_generic.c and I wonder if anyone could
> help me with some basic questions?
> 1. If I understand correctly, ii and jj are atom numbers for atom i and
> atom j. These don't seem to correspond to the atoms in the order that
> they were read in (PDB file), however. How can I recover this order, or
> what is the new order?
This depends if you run in parallel or not. There is a function in 
mtop_util.h that will give you the global atom number (i.e. 
corresponding to your input numbering -1 because gromacs starts counting 
at 0)
> 2. What units are the positions ix, iy, iz (again in nb_generic.c)?
nm everywhere inside gromacs.
> 3. nb_generic is within the loop i = i0 to i1-1 in nonbonded.c. What is
> this loop? Somehow related to different interaction types?
Interactions are sorted to be of the same type for optimization (e.g. 
Coulomb only, LJ only or combinations). By setting the approriate 
environment variables everything will be routed to the nb_generic routine.
> 4. Later, I will also want to extract the instantaneous kinetic and
> potential energy of the atom in the same time-step - any advice is very
> welcome.
Kinetic can in principle be extract by saving velocities and 
postprocessing. Potential is more difficult. How do you divide the 
energy between i and j? Divide in two?

For thermal conductivity isn't it sufficient to measure the 
"temperature"  as a function of position and time?

> 5. Out of interest, I notice many of the files in the release-4-6 branch
> are in include/ but the same files are in legacyheaders/ in the master
> branch. Why is this? Which should I be developing against?
master for sure. 5.0 will come out in the first halve of next year.

> Any help is greatly appreciated.
> Thank you and happy new year!
> James

David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205.
spoel at xray.bmc.uu.se    http://folding.bmc.uu.se

More information about the gromacs.org_gmx-developers mailing list