[gmx-developers] add a new autocorrelation function.

Xavier Periole X.Periole at rug.nl
Fri Jan 11 00:17:12 CET 2008


Dears,

I am trying to add a new autocorrelation function. The idea if to get
the residence time of water molecules, but it does not really matter.

I am modifying gmx3.3.1.

I made my modifications in gmx_analyze.c to introduce a new option that
calls do_autocorr the following way:

if(bacNewoption) {
   do_autocorr(acfile,"Autocorrelation",n,nset,val,dt,
                 eacNewOption,bAverCorr);
}

I made the same modification for another case where no new function
was needed and it worked pretty good: reproducing C(t) from another
source. So this is safe.

in autocorr.c I also make my changes, defined my variables, etc.

Main change:
...
       if (MODE(eacNormal)) {
       corr[k] += c1[j]*c1[j+k];
       }
       else if (MODE(eacNewOption) {
       fprintf(stdout,"in there");
       compute the new correlation function;
       }
...

Everything goes well, no complain at the compilation.
g_analyze calls do_autocorr with the new option but when in autocorr.c
the code in eacNewOption is not executed. The option is recognized.

I find out that the options are defined in include/gstat.h in the
following way:

#define eacNormal (1<<0)
#define eacCos    (1<<1)
#define eacVector (1<<2)
#define eacRcross (1<<3  | eacVector)
#define eacP0     (1<<4  | eacVector)
#define eacP1     (1<<5  | eacVector)
#define eacP2     (1<<6  | eacVector)
#define eacP3     (1<<7  | eacVector)
#define eacP4     (1<<8  | eacVector)

I do not know how to include my eacNewOption in there! I tried several
things but the new option is not understood.

Anyone could give me a hand?

Thanks
XAvier

-----------------------------------------------------
XAvier Periole - PhD

NMR & Molecular Dynamics Group
University of Groningen
The Netherlands
http://md.chem.rug.nl/~periole
-----------------------------------------------------



More information about the gromacs.org_gmx-developers mailing list