[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?

   rm_pbc(&(top->idef),top->atoms.nr,box,x0,x0);

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


Thank you in advance
Sunjoo



More information about the gromacs.org_gmx-users mailing list