| 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 |
| 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; |
| 45 |
|
char* pair2; |
| 46 |
|
int scdCorr; |
| 47 |
|
double startTime; |
| 48 |
+ |
double maxLength; |
| 49 |
+ |
int directorHead; |
| 50 |
|
|
| 51 |
|
// system initialization |
| 52 |
|
|
| 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 |
| 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 |
|
|
| 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(); |
| 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++){ |
| 407 |
|
|
| 408 |
|
// read and set the frames |
| 409 |
|
|
| 410 |
< |
openFile( inName ); |
| 410 |
> |
openFile(); |
| 411 |
|
|
| 412 |
|
fprintf( stdout, |
| 413 |
|
"\n" |
| 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 |
|
|
| 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 |
|
|