[gmx-users] coding own analysis tools

Christoph Freudenberger christoph.freudenberger at chemie.uni-ulm.de
Mon Sep 23 17:22:46 CEST 2002


Hi there,

I started to write my own analysis tools by playing with
$GMXDATA/share/template/template.c

For starting I want to read the dimensions of my cubic box.
I tried:

   read_first_frame(&status,ftp2fn(efTRX,NFILE,fnm),&fr,flags);

   do {
     printf("Box at t=%8.3f : %8.5f %8.5f \
	%8.5f\n",fr.time,fr.box[XX][XX],fr.box[YY][YY],fr.box[ZZ][ZZ]);
   } while(read_next_frame(status,&fr));

But the output is not relly what i expected:

Coordinates at t=   0.000 : 
-2185462883768257037410376708809100159692472627962195589234193522174984
51257479740052809467229209420174113722383412669214925584577781553035377
25424568703741369771156398510011282323933595756433685243833802675227346
08835391217370834439888046185032747743018232115356641020555419281766611
3676644913523743361335296.00000 -21854875295269697829100005652045223099
32810594132648503383548821566342024330665517789023652194638860407680374
87032906634574326378599023414318373253581399782427626339340106705901873
90112028090073257534761723645078366309067038777144332819242293088822405
893422459017865004579382054807684246819209857928362196992.00000  0.00000
Coordinates at t=   0.400 : 
-2185462883768257037410376708809100159692472627962195589234193522174984
[snip]

Ok... I just fixed this by thinking it over and putting fr.box.[XX][XX]
in parentheses:

printf("Box at t=%8.3f : %8.5f %8.5f \
8.5f\n",fr.time,(fr.box[XX][XX]),(fr.box[YY][YY]),(fr.box[ZZ][ZZ]));

but does this need parentheses while
fr.x[n][XX]
does not need them???

Please give me a hint?
-- 
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