[gmx-users] charge density

Sunjoo Lee sunnytov at gmail.com
Tue Aug 5 17:18:41 CEST 2008

Hello All

We have been trying to get the charge densities from the trajectory by
using our in-house matlab code, which basically the same as a part  of
gmx_potential.c .

        z = x0[index[n][i]][axis];
            if (z < 0)
               z += box[axis][axis];
           if (z > box[axis][axis])
               z -= box[axis][axis];
           /* determine which slice atom is in */
          slice = (z / (*slWidth));
          (*slCharge)[n][slice] += top->atoms.atom[index[n][i]].q;

However, the charge profiles from the g_potential tool and from our
code show were not the same even for a single structure.

Could you explain how the additional steps might affect?


    /* calculate position of center of mass based on group 1 */
    calc_xcm(x0, gnx[0], index[0], top->atoms.atom, xcm, FALSE);

Thank you in advance

More information about the gromacs.org_gmx-users mailing list