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

Comparing trunk/tcProps/tcProps.c (file contents):
Revision 1058 by mmeineke, Wed Feb 18 21:20:51 2004 UTC vs.
Revision 1060 by mmeineke, Thu Feb 19 21:10:06 2004 UTC

# Line 2 | Line 2
2  
3   #include <stdio.h>
4   #include <stdlib.h>
5 + #include <string.h>
6  
7  
8   #include "params.h"
9   #include "tcProps.h"
10   #include "readWrite.h"
11   #include "scdCorr.h"
12 + #include "directorHead.h"
13  
14  
15   #define VERSION_MAJOR 0
# Line 30 | Line 32 | int main( int argC, char *argV[] ){
32    
33    struct atomCoord atoms[nAtoms];
34    int i,j,k;
33  char* inName;
34  int nFrames;
35    
36    char* outPrefix; // the output prefix
37    char currentFlag; // used in parsing the flags
38    int done = 0; // multipurpose boolean
39    int havePrefix; // boolean for the output prefix  
40 +  int haveMaxLength;
41    char* conversionCheck;
42    int conversionError;
43    int optionError;
# Line 44 | Line 45 | int main( int argC, char *argV[] ){
45    char* pair2;
46    int scdCorr;
47    double startTime;
48 +  double maxLength;
49 +  int directorHead;
50  
51    // system initialization
52    
# Line 55 | Line 58 | int main( int argC, char *argV[] ){
58    outPrefix = NULL;
59    inName = NULL;
60    
61 +  haveMaxLength = 0;
62    conversionError = 0;
63    optionError = 0;
64    havePrefix = 0;
65    scdCorr = 0;
66    startTime = 0.0;
67 +  directorHead = 0;
68    
69  
70    // parse the command line
# Line 231 | Line 236 | int main( int argC, char *argV[] ){
236            case 'l':
237              // -l <double>    set <double> to the maxLength
238  
239 <            haveMaxLength = true;
239 >            haveMaxLength = 1;
240              j++;
241              currentFlag = argV[i][j];
242                
# Line 292 | Line 297 | int main( int argC, char *argV[] ){
297              break;
298  
299            case 's':
300 <            // -s turn on separate output files
300 >            // -s turn on Scd corr
301  
302              scdCorr = 1;
303              break;
304  
305 +          case 'h':
306 +            // -h turn on director head
307  
308 +            directorHead = 1;
309 +            break;
310 +
311 +
312            default:
313  
314 <            sprintf(painCave.errMsg,
314 >            fprintf( stderr,
315                      "\n"
316                      "Bad option \"-%c\"\n", currentFlag);
317              usage();
# Line 336 | Line 347 | int main( int argC, char *argV[] ){
347      exit(0);
348    }
349  
350 +  if( outPrefix == NULL )
351 +    outPrefix = inName;
352  
353 +
354    // initialize the arrays
355  
356    for(i=0;i<nLipids;i++){
# Line 393 | Line 407 | int main( int argC, char *argV[] ){
407  
408    // read and set the frames
409    
410 <  openFile( inName );
410 >  openFile();
411  
412    fprintf( stdout,
413             "\n"
# Line 401 | Line 415 | int main( int argC, char *argV[] ){
415             inName );
416    fflush(stdout);
417  
418 <  setFrames( inName );
418 >  setFrames();
419    
420    fprintf( stdout,
421             "done.\n"
422 <           "nFrames = %d\n.",
422 >           "nFrames = %d.\n",
423             nFrames );
424    fflush(stdout);
425  
# Line 415 | Line 429 | int main( int argC, char *argV[] ){
429                "Calculating the Scd correlation\n" );
430      fflush( stdout );
431      
432 <    calcScdCorr( startTime );
432 >    calcScdCorr( startTime, atoms, outPrefix );
433    }
434 +
435 +  if(directorHead){
436 +
437 +    fprintf ( stdout,
438 +              "Calculating the Head director\n" );
439 +    fflush( stdout );
440 +    
441 +    calcDirHeadCorr( startTime, atoms, outPrefix );
442 +  }
443    
444  
445 +  closeFile();
446 +
447   }
448  
449  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines