[gmx-users] com calculation

Christoph Freudenberger christoph.freudenberger at chemie.uni-ulm.de
Wed Mar 19 09:02:41 CET 2003


Hi there,

As I posted in the users list a couple of days before, I wanted
to write an extension to the g_rdf code to calculate the spatial
distrubtion function.
I've posted some questions to the developers list, because
I consindered them to specific for this list.
Unfortunatly nobody answered... :-(

Anyway, I worked around most of the problems myself already
but I am still somewhat unsure about the calculation of the
com of a group in g_rdf:

      if (bCM) {
        /* calculate centre of mass */
        clear_rvec(xcom);
        for(i=0; (i < isize_cm); i++) {
          ix = index_cm[i];
          rvec_inc(xcom,x[ix]);
        }
This first loop seems to sum up the position vectors of all
atoms in the com group into the vector xcom.
        /* store it in the first 'group' */
        for(j=0; (j<DIM); j++)
          x[index[0][0]][j] = xcom[j] / isize_cm;
      }
Then xcom/isize_cm is written to the x-array but why isn't
there any weighting by the masses of the atoms?
Or did I miss that somewhere?

regards
-- 
Christoph Freudenberger
Abt. Organische Chemie I AK Siehl - Uni Ulm -Tel: ++49-731-502-2785

_______________________________________________
gmx-developers mailing list
gmx-developers at gromacs.org
http://www.gromacs.org/mailman/listinfo/gmx-developers
Please don't post (un)subscribe requests to the list. Use the
www interface or send it to gmx-developers-request at gromacs.org.


-- 
Christoph Freudenberger
Abt. Organische Chemie I AK Siehl - Uni Ulm -Tel: ++49-731-502-2785




More information about the gromacs.org_gmx-users mailing list