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 1067 by mmeineke, Tue Feb 24 17:13: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 + #include "directorWhole.h"
14  
15  
16   #define VERSION_MAJOR 0
# Line 30 | Line 33 | int main( int argC, char *argV[] ){
33    
34    struct atomCoord atoms[nAtoms];
35    int i,j,k;
33  char* inName;
34  int nFrames;
36    
37    char* outPrefix; // the output prefix
38    char currentFlag; // used in parsing the flags
39    int done = 0; // multipurpose boolean
40    int havePrefix; // boolean for the output prefix  
41 +  int haveMaxLength;
42    char* conversionCheck;
43    int conversionError;
44    int optionError;
# Line 44 | Line 46 | int main( int argC, char *argV[] ){
46    char* pair2;
47    int scdCorr;
48    double startTime;
49 +  double maxLength;
50 +  int directorHead, directorWhole;
51  
52    // system initialization
53    
# Line 55 | Line 59 | int main( int argC, char *argV[] ){
59    outPrefix = NULL;
60    inName = NULL;
61    
62 +  haveMaxLength = 0;
63    conversionError = 0;
64    optionError = 0;
65    havePrefix = 0;
66    scdCorr = 0;
67    startTime = 0.0;
68 +  directorHead = 0;
69 +  directorWhole = 0;
70    
71  
72    // parse the command line
# Line 231 | Line 238 | int main( int argC, char *argV[] ){
238            case 'l':
239              // -l <double>    set <double> to the maxLength
240  
241 <            haveMaxLength = true;
241 >            haveMaxLength = 1;
242              j++;
243              currentFlag = argV[i][j];
244                
# Line 292 | Line 299 | int main( int argC, char *argV[] ){
299              break;
300  
301            case 's':
302 <            // -s turn on separate output files
302 >            // -s turn on Scd corr
303  
304              scdCorr = 1;
305              break;
306  
307 +          case 'h':
308 +            // -h turn on director head
309  
310 +            directorHead = 1;
311 +            break;
312 +
313 +          case 'w':
314 +            // -h turn on director head
315 +
316 +            directorWhole = 1;
317 +            break;
318 +
319 +
320            default:
321  
322 <            sprintf(painCave.errMsg,
322 >            fprintf( stderr,
323                      "\n"
324                      "Bad option \"-%c\"\n", currentFlag);
325              usage();
# Line 336 | Line 355 | int main( int argC, char *argV[] ){
355      exit(0);
356    }
357  
358 +  if( outPrefix == NULL )
359 +    outPrefix = inName;
360  
361 +
362    // initialize the arrays
363  
364    for(i=0;i<nLipids;i++){
365  
366      atoms[nLipAtoms*i+0].type = HEAD;
367 +    atoms[nLipAtoms*i+0].mass = 72;
368      atoms[nLipAtoms*i+0].u[0] = 0.0;
369      atoms[nLipAtoms*i+0].u[1] = 0.0;
370      atoms[nLipAtoms*i+0].u[2] = 1.0;
371      
372 +    
373  
374      atoms[nLipAtoms*i+1].type = CH2;
375 +    atoms[nLipAtoms*i+1].mass = 14.03;
376  
377      atoms[nLipAtoms*i+2].type = CH;
378 +    atoms[nLipAtoms*i+2].mass = 13.02;
379  
380      atoms[nLipAtoms*i+3].type = CH2;
381 +    atoms[nLipAtoms*i+3].mass = 14.03;
382  
383      atoms[nLipAtoms*i+4].type = CH2;
384 +    atoms[nLipAtoms*i+4].mass = 14.03;
385  
386      atoms[nLipAtoms*i+5].type = CH2;
387 +    atoms[nLipAtoms*i+5].mass = 14.03;
388  
389      atoms[nLipAtoms*i+6].type = CH2;
390 +    atoms[nLipAtoms*i+6].mass = 14.03;
391  
392      atoms[nLipAtoms*i+7].type = CH2;
393 +    atoms[nLipAtoms*i+7].mass = 14.03;
394  
395      atoms[nLipAtoms*i+8].type = CH2;
396 +    atoms[nLipAtoms*i+8].mass = 14.03;
397  
398      atoms[nLipAtoms*i+9].type = CH2;
399 +    atoms[nLipAtoms*i+9].mass = 14.03;
400  
401      atoms[nLipAtoms*i+10].type = CH3;
402 +    atoms[nLipAtoms*i+10].mass = 15.04;
403  
404      atoms[nLipAtoms*i+11].type = CH2;
405 +    atoms[nLipAtoms*i+11].mass = 14.03;
406  
407      atoms[nLipAtoms*i+12].type = CH2;
408 +    atoms[nLipAtoms*i+12].mass = 14.03;
409  
410 <    atoms[nLipAtoms*i+13].type = CH2;
410 >    atoms[nLipAtoms*i+13].type = CH2;    
411 >    atoms[nLipAtoms*i+13].mass = 14.03;
412  
413      atoms[nLipAtoms*i+14].type = CH2;
414 +    atoms[nLipAtoms*i+14].mass = 14.03;
415    
416      atoms[nLipAtoms*i+15].type = CH2;
417 +    atoms[nLipAtoms*i+15].mass = 14.03;
418    
419      atoms[nLipAtoms*i+16].type = CH2;
420 +    atoms[nLipAtoms*i+16].mass = 14.03;
421    
422      atoms[nLipAtoms*i+17].type = CH2;
423 +    atoms[nLipAtoms*i+17].mass = 14.03;
424    
425      atoms[nLipAtoms*i+18].type = CH3;
426 +    atoms[nLipAtoms*i+18].mass = 15.04;
427    }
428    
429    for(i=(nLipAtoms*nLipids);i<nAtoms;i++){
430      atoms[i].type = SSD;
431 +    atoms[i].mass = 18.03;
432      atoms[i].u[0] = 0.0;
433      atoms[i].u[1] = 0.0;
434      atoms[i].u[2] = 1.0;
# Line 393 | Line 436 | int main( int argC, char *argV[] ){
436  
437    // read and set the frames
438    
439 <  openFile( inName );
439 >  openFile();
440  
441    fprintf( stdout,
442             "\n"
# Line 401 | Line 444 | int main( int argC, char *argV[] ){
444             inName );
445    fflush(stdout);
446  
447 <  setFrames( inName );
447 >  setFrames();
448    
449    fprintf( stdout,
450             "done.\n"
451 <           "nFrames = %d\n.",
451 >           "nFrames = %d.\n",
452             nFrames );
453    fflush(stdout);
454  
# Line 415 | Line 458 | int main( int argC, char *argV[] ){
458                "Calculating the Scd correlation\n" );
459      fflush( stdout );
460      
461 <    calcScdCorr( startTime );
461 >    calcScdCorr( startTime, atoms, outPrefix );
462    }
463 +
464 +  if(directorHead){
465 +
466 +    fprintf ( stdout,
467 +              "Calculating the Head director\n" );
468 +    fflush( stdout );
469 +    
470 +    calcDirHeadCorr( startTime, atoms, outPrefix );
471 +  }
472 +
473 +  if(directorWhole){
474 +
475 +    fprintf ( stdout,
476 +              "Calculating the bilayer director\n" );
477 +    fflush( stdout );
478 +    
479 +    calcDirWholeCorr( startTime, atoms, outPrefix );
480 +  }
481    
482  
483 +  closeFile();
484 +
485   }
486  
487  
# Line 440 | Line 503 | void usage(){
503                  "   -l <maxLength>  set the maximum value of r\n"
504                  "                     *Defaults to 1/2 smallest length of first frame.\n"
505                  "   -s              Calculate the Scd chain correlation.\n"
506 +                "   -h              Calculate the directors for the head groups\n"
507 +                "   -w              Calculate the director fro the bilayers\n"
508                  "\n"
509                  "   long:\n"
510                  "   -----\n"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines