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 1060 by mmeineke, Thu Feb 19 21:10:06 2004 UTC vs.
Revision 1085 by mmeineke, Fri Mar 5 03:10:29 2004 UTC

# Line 10 | Line 10
10   #include "readWrite.h"
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 41 | 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;
49  int directorHead;
54  
55 +  int directorHead, directorWhole, doRMSD, doGofz, doAvgXY;
56 +  enum atomNames rmsdType;
57 +
58    // system initialization
59    
60    isScanned = 0;
# Line 65 | Line 72 | int main( int argC, char *argV[] ){
72    scdCorr = 0;
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 81 | 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 <          }      
104 <          pair2 = argV[i];
119 >          }
120  
121          }
122  
# Line 308 | Line 323 | int main( int argC, char *argV[] ){
323              directorHead = 1;
324              break;
325  
326 +          case 'w':
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 +
345            default:
346  
347              fprintf( stderr,
# Line 356 | Line 389 | int main( int argC, char *argV[] ){
389    for(i=0;i<nLipids;i++){
390  
391      atoms[nLipAtoms*i+0].type = HEAD;
392 +    atoms[nLipAtoms*i+0].mass = 72;
393      atoms[nLipAtoms*i+0].u[0] = 0.0;
394      atoms[nLipAtoms*i+0].u[1] = 0.0;
395      atoms[nLipAtoms*i+0].u[2] = 1.0;
396      
397 +    
398  
399      atoms[nLipAtoms*i+1].type = CH2;
400 +    atoms[nLipAtoms*i+1].mass = 14.03;
401  
402      atoms[nLipAtoms*i+2].type = CH;
403 +    atoms[nLipAtoms*i+2].mass = 13.02;
404  
405      atoms[nLipAtoms*i+3].type = CH2;
406 +    atoms[nLipAtoms*i+3].mass = 14.03;
407  
408      atoms[nLipAtoms*i+4].type = CH2;
409 +    atoms[nLipAtoms*i+4].mass = 14.03;
410  
411      atoms[nLipAtoms*i+5].type = CH2;
412 +    atoms[nLipAtoms*i+5].mass = 14.03;
413  
414      atoms[nLipAtoms*i+6].type = CH2;
415 +    atoms[nLipAtoms*i+6].mass = 14.03;
416  
417      atoms[nLipAtoms*i+7].type = CH2;
418 +    atoms[nLipAtoms*i+7].mass = 14.03;
419  
420      atoms[nLipAtoms*i+8].type = CH2;
421 +    atoms[nLipAtoms*i+8].mass = 14.03;
422  
423      atoms[nLipAtoms*i+9].type = CH2;
424 +    atoms[nLipAtoms*i+9].mass = 14.03;
425  
426      atoms[nLipAtoms*i+10].type = CH3;
427 +    atoms[nLipAtoms*i+10].mass = 15.04;
428  
429      atoms[nLipAtoms*i+11].type = CH2;
430 +    atoms[nLipAtoms*i+11].mass = 14.03;
431  
432      atoms[nLipAtoms*i+12].type = CH2;
433 +    atoms[nLipAtoms*i+12].mass = 14.03;
434  
435 <    atoms[nLipAtoms*i+13].type = CH2;
435 >    atoms[nLipAtoms*i+13].type = CH2;    
436 >    atoms[nLipAtoms*i+13].mass = 14.03;
437  
438      atoms[nLipAtoms*i+14].type = CH2;
439 +    atoms[nLipAtoms*i+14].mass = 14.03;
440    
441      atoms[nLipAtoms*i+15].type = CH2;
442 +    atoms[nLipAtoms*i+15].mass = 14.03;
443    
444      atoms[nLipAtoms*i+16].type = CH2;
445 +    atoms[nLipAtoms*i+16].mass = 14.03;
446    
447      atoms[nLipAtoms*i+17].type = CH2;
448 +    atoms[nLipAtoms*i+17].mass = 14.03;
449    
450      atoms[nLipAtoms*i+18].type = CH3;
451 +    atoms[nLipAtoms*i+18].mass = 15.04;
452    }
453    
454    for(i=(nLipAtoms*nLipids);i<nAtoms;i++){
455      atoms[i].type = SSD;
456 +    atoms[i].mass = 18.03;
457      atoms[i].u[0] = 0.0;
458      atoms[i].u[1] = 0.0;
459      atoms[i].u[2] = 1.0;
# Line 440 | Line 494 | int main( int argC, char *argV[] ){
494      
495      calcDirHeadCorr( startTime, atoms, outPrefix );
496    }
497 +
498 +  if(directorWhole){
499 +
500 +    fprintf ( stdout,
501 +              "Calculating the bilayer director\n" );
502 +    fflush( stdout );
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 465 | Line 560 | void usage(){
560                  "   -l <maxLength>  set the maximum value of r\n"
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 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