[gmx-developers] New analysis framework: trying to code a new tool

David van der Spoel spoel at xray.bmc.uu.se
Thu Mar 28 22:10:40 CET 2013


I'm working my way through the documentation trying to find out some 
stuff needed to finish my new analysis tool, to compute the free volume 
in a box. Most of it works, but when trying to get a time series I am 
apparently missing something.

My final writing routine looks like:

     AnalysisDataFrameRef ref;
     FILE   *fp;
     int    i;
     double faver  = fractot_/nframes_;
     double fsigma = sqrt(frac2tot_/nframes_-faver*faver);
     printf("Free volume %.2f +/- %.2f %%\n",100*faver,100*fsigma);
     printf("Number of frames %d\n",data_.frameCount());
     fp = fopen("koko.xvg","w");
     for(i=0; (i<data_.frameCount()); i++)
         ref = data_.getDataFrame(i);
         fprintf(fp,"%g  %g\n",ref.x(),ref.y(0));

however, despite frameCount() yielding 101 frames, getDataFrame() fails 
with an API error. I suspect that either I have selected the wrong data 
type for storing the numbers (AnalysisDataFrameAverageModule) or I have 
to call a routine to actually get storage for frames (bool 

Any clues?
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