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 1067 by mmeineke, Tue Feb 24 17:13:06 2004 UTC vs.
Revision 1085 by mmeineke, Fri Mar 5 03:10:29 2004 UTC

# Line 11 | Line 11
11   #include "scdCorr.h"
12   #include "directorHead.h"
13   #include "directorWhole.h"
14 + #include "rmsd.h"
15 + #include "gofz.h"
16  
17  
18   #define VERSION_MAJOR 0
# Line 42 | Line 44 | int main( int argC, char *argV[] ){
44    char* conversionCheck;
45    int conversionError;
46    int optionError;
47 +  char* rmsdName;
48    char* pair1;
49    char* pair2;
50    int scdCorr;
51    double startTime;
52 +  double avgXY;
53    double maxLength;
50  int directorHead, directorWhole;
54  
55 +  int directorHead, directorWhole, doRMSD, doGofz, doAvgXY;
56 +  enum atomNames rmsdType;
57 +
58    // system initialization
59    
60    isScanned = 0;
# Line 67 | Line 73 | int main( int argC, char *argV[] ){
73    startTime = 0.0;
74    directorHead = 0;
75    directorWhole = 0;
76 +  doRMSD = 0;
77 +  doGofz = 0;
78 +  doAvgXY = 0;
79    
80  
81    // parse the command line
# Line 83 | Line 92 | int main( int argC, char *argV[] ){
92  
93          // parse long word options
94          
95 <        if( !strcmp( argV[i], "--gofr" ) ){
95 >        if( !strcmp( argV[i], "--rmsd" ) ){
96  
97 +          doRMSD = 1;
98            i++;
99            if( i>=argC ){
100              fprintf( stderr,
101                       "\n"
102 <                     "not enough arguments for --gofr\n");
102 >                     "not enough arguments for --rmsd\n");
103              usage();
104              exit(0);
105            }      
106 <          pair1 = argV[i];
106 >          rmsdName = argV[i];
107  
108 <          i++;
109 <          if( i>=argC ){
110 <            fprintf( stderr,
111 <                     "\n"
112 <                     "not enough arguments for --gofr\n");
113 <            usage();
108 >          if( !strcmp(rmsdName, "HEAD") )    rmsdType = HEAD;
109 >          else if( !strcmp(rmsdName, "CH") ) rmsdType = CH;
110 >          else if( !strcmp(rmsdName, "CH2") )rmsdType = CH2;
111 >          else if( !strcmp(rmsdName, "CH3") )rmsdType = CH3;
112 >          else if( !strcmp(rmsdName, "SSD") )rmsdType = SSD;
113 >          else if( !strcmp(rmsdName, "COM") )rmsdType = COM;
114 >          else{
115 >            fprintf( stderr,
116 >                     "Unrecognized rmsd atom type \"%s\"\n",
117 >                     rmsdName );
118              exit(0);
119 <          }      
106 <          pair2 = argV[i];
119 >          }
120  
121          }
122  
# Line 311 | Line 324 | int main( int argC, char *argV[] ){
324              break;
325  
326            case 'w':
327 <            // -h turn on director head
327 >            // -w turn on director head
328  
329              directorWhole = 1;
330 +            break;
331 +
332 +          case 'g':
333 +            // -g turn on gofZ
334 +
335 +            doGofz = 1;
336 +            break;
337 +
338 +          case 'v':
339 +            // -v turn on average XY
340 +
341 +            doAvgXY = 1;
342              break;
343  
344  
# Line 478 | Line 503 | int main( int argC, char *argV[] ){
503      
504      calcDirWholeCorr( startTime, atoms, outPrefix );
505    }
506 +
507 +  if(doRMSD){
508 +
509 +    fprintf ( stdout,
510 +              "Calculating the RMSD\n" );
511 +    fflush( stdout );
512 +    
513 +    rmsd( rmsdType, startTime, outPrefix, rmsdName );
514 +  }
515 +
516 +  if(doGofz){
517 +
518 +    fprintf ( stdout,
519 +              "Calculating the gofZ\n" );
520 +    fflush( stdout );
521 +    
522 +    calcGofz( startTime, atoms, outPrefix );
523 +  }
524 +
525 +  if(doAvgXY){
526 +
527 +    fprintf ( stdout,
528 +              "Calculating the average XY\n" );
529 +    fflush( stdout );
530 +    
531 +    avgXY = calcAverageXY( startTime );
532 +    
533 +    fprintf ( stdout,
534 +              "Done, average XY = %6G\n", avgXY );
535 +    fflush( stdout );
536 +    
537 +  }
538    
539  
540    closeFile();
# Line 504 | Line 561 | void usage(){
561                  "                     *Defaults to 1/2 smallest length of first frame.\n"
562                  "   -s              Calculate the Scd chain correlation.\n"
563                  "   -h              Calculate the directors for the head groups\n"
564 <                "   -w              Calculate the director fro the bilayers\n"
564 >                "   -w              Calculate the director from the bilayers\n"
565 >                "   -g              Calculate the gofz profile\n"
566                  "\n"
567                  "   long:\n"
568                  "   -----\n"
569 <                "   --gofr <atom1> <atom2>         g(r) for atom1 and atom2\n"
569 >                "   --rmsd <atom1>                 rmsd for atom1\n"
570                  "   --gofrTheta <atom1> <atom2>    g(r, theta) for atom1 and atom2\n"
571                  "   --gofrOmega <atom1> <atom2>    g(r, omega) for atom1 and atom2\n"
572                  "   --version                      displays the version number\n"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines