ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/tcProps/rmsd.c
(Generate patch)

Comparing trunk/tcProps/rmsd.c (file contents):
Revision 1084 by mmeineke, Wed Mar 3 15:16:15 2004 UTC vs.
Revision 1085 by mmeineke, Fri Mar 5 03:10:29 2004 UTC

# Line 28 | Line 28 | void calcRMSDpair( int bin, int i, int j, enum atomNam
28  
29   void calcRMSDpair( int bin, int i, int j, enum atomNames rType );
30  
31 < void rmsd( enum atomNames rType, double startTime, char* outPrefix ){
31 > void rmsd( enum atomNames rType, double startTime, char* outPrefix,
32 >           char* theName){
33  
34    // list of 'a priori' constants
35  
# Line 171 | Line 172 | void rmsd( enum atomNames rType, double startTime, cha
172      }
173      myFrames[index].time = frameTimes[i];
174      readFrame(i, atoms, myFrames[index].Hmat );
175 +    
176 +    index++;
177    }
178  
179    // initialize the counts and the correlation
# Line 194 | Line 197 | void rmsd( enum atomNames rType, double startTime, cha
197      for(j=i+1;j<corrFrames;j++){
198  
199        diffTime = myFrames[j].time - myFrames[i].time;
200 <      if( diffTime > 0.0 ){
200 >      
201 >      if( diffTime > 0.0 ){      
202          
203          percentComplete =
204            (int)( 100.0 * (double)index / (double) nCounts );
205          
206          fprintf( stdout,
207 <                 "\rRMSD corr %3d%% complete.",
207 >                 "\rMSD corr %3d%% complete.",
208                   percentComplete );
209          fflush( stdout );
210          
# Line 215 | Line 219 | void rmsd( enum atomNames rType, double startTime, cha
219  
220    // print out the correlation
221  
222 <  sprintf( outName, "%s.rmsd", outPrefix );
222 >  sprintf( outName, "%s-%s.msd", outPrefix, theName );
223    outFile = fopen( outName, "w" );
224  
225    fprintf( outFile,
226 <           "#time\trmsd\n");
226 >           "#time\tmsd\n");
227  
228    for(i=0;i<RMSDBINS;i++){
229      
# Line 241 | Line 245 | void rmsd( enum atomNames rType, double startTime, cha
245      (int)( 100.0 * (double)index / (double) nCounts );
246    
247    fprintf( stdout,
248 <           "\rRMSD corr %3d%% complete.",
248 >           "\rMSD corr %3d%% complete.\n",
249             percentComplete );
250    fflush( stdout );
251  
# Line 279 | Line 283 | void calcRMSDpair( int bin, int frameI, int frameJ, en
283    atomsI = myFrames[frameI].atoms;
284    atomsJ = myFrames[frameJ].atoms;
285  
286 +  accum = 0.0;
287 +
288    if( rType != COM ){
289      
290      nAccums = 0;
# Line 293 | Line 299 | void calcRMSDpair( int bin, int frameI, int frameJ, en
299          for(j=0;j<3;j++)
300            dSqr += d[j] * d[j];
301          
302 <        accum += sqrt(dSqr);
302 >        accum += dSqr;
303          nAccums++;
304        }    
305      }
# Line 334 | Line 340 | void calcRMSDpair( int bin, int frameI, int frameJ, en
340        for(j=0;j<3;j++)
341          dSqr += d[j] * d[j];
342        
343 <      accum += sqrt(dSqr);
343 >      accum += dSqr;
344        nAccums++;
345      }
346    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines