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, directorWhole; |
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 |
+ |
directorWhole = 0; |
69 |
|
|
70 |
|
|
71 |
|
// parse the command line |
237 |
|
case 'l': |
238 |
|
// -l <double> set <double> to the maxLength |
239 |
|
|
240 |
< |
haveMaxLength = true; |
240 |
> |
haveMaxLength = 1; |
241 |
|
j++; |
242 |
|
currentFlag = argV[i][j]; |
243 |
|
|
298 |
|
break; |
299 |
|
|
300 |
|
case 's': |
301 |
< |
// -s turn on separate output files |
301 |
> |
// -s turn on Scd corr |
302 |
|
|
303 |
|
scdCorr = 1; |
304 |
+ |
break; |
305 |
+ |
|
306 |
+ |
case 'h': |
307 |
+ |
// -h turn on director head |
308 |
+ |
|
309 |
+ |
directorHead = 1; |
310 |
+ |
break; |
311 |
+ |
|
312 |
+ |
case 'w': |
313 |
+ |
// -h turn on director head |
314 |
+ |
|
315 |
+ |
directorWhole = 1; |
316 |
|
break; |
317 |
|
|
318 |
|
|
319 |
|
default: |
320 |
|
|
321 |
< |
sprintf(painCave.errMsg, |
321 |
> |
fprintf( stderr, |
322 |
|
"\n" |
323 |
|
"Bad option \"-%c\"\n", currentFlag); |
324 |
|
usage(); |
354 |
|
exit(0); |
355 |
|
} |
356 |
|
|
357 |
+ |
if( outPrefix == NULL ) |
358 |
+ |
outPrefix = inName; |
359 |
|
|
360 |
+ |
|
361 |
|
// initialize the arrays |
362 |
|
|
363 |
|
for(i=0;i<nLipids;i++){ |
364 |
|
|
365 |
|
atoms[nLipAtoms*i+0].type = HEAD; |
366 |
+ |
atoms[nLipAtoms*i+0].mass = 72; |
367 |
|
atoms[nLipAtoms*i+0].u[0] = 0.0; |
368 |
|
atoms[nLipAtoms*i+0].u[1] = 0.0; |
369 |
|
atoms[nLipAtoms*i+0].u[2] = 1.0; |
370 |
|
|
371 |
+ |
|
372 |
|
|
373 |
|
atoms[nLipAtoms*i+1].type = CH2; |
374 |
+ |
atoms[nLipAtoms*i+1].mass = 14.03; |
375 |
|
|
376 |
|
atoms[nLipAtoms*i+2].type = CH; |
377 |
+ |
atoms[nLipAtoms*i+2].mass = 13.02; |
378 |
|
|
379 |
|
atoms[nLipAtoms*i+3].type = CH2; |
380 |
+ |
atoms[nLipAtoms*i+3].mass = 14.03; |
381 |
|
|
382 |
|
atoms[nLipAtoms*i+4].type = CH2; |
383 |
+ |
atoms[nLipAtoms*i+4].mass = 14.03; |
384 |
|
|
385 |
|
atoms[nLipAtoms*i+5].type = CH2; |
386 |
+ |
atoms[nLipAtoms*i+5].mass = 14.03; |
387 |
|
|
388 |
|
atoms[nLipAtoms*i+6].type = CH2; |
389 |
+ |
atoms[nLipAtoms*i+6].mass = 14.03; |
390 |
|
|
391 |
|
atoms[nLipAtoms*i+7].type = CH2; |
392 |
+ |
atoms[nLipAtoms*i+7].mass = 14.03; |
393 |
|
|
394 |
|
atoms[nLipAtoms*i+8].type = CH2; |
395 |
+ |
atoms[nLipAtoms*i+8].mass = 14.03; |
396 |
|
|
397 |
|
atoms[nLipAtoms*i+9].type = CH2; |
398 |
+ |
atoms[nLipAtoms*i+9].mass = 14.03; |
399 |
|
|
400 |
|
atoms[nLipAtoms*i+10].type = CH3; |
401 |
+ |
atoms[nLipAtoms*i+10].mass = 15.04; |
402 |
|
|
403 |
|
atoms[nLipAtoms*i+11].type = CH2; |
404 |
+ |
atoms[nLipAtoms*i+11].mass = 14.03; |
405 |
|
|
406 |
|
atoms[nLipAtoms*i+12].type = CH2; |
407 |
+ |
atoms[nLipAtoms*i+12].mass = 14.03; |
408 |
|
|
409 |
< |
atoms[nLipAtoms*i+13].type = CH2; |
409 |
> |
atoms[nLipAtoms*i+13].type = CH2; |
410 |
> |
atoms[nLipAtoms*i+13].mass = 14.03; |
411 |
|
|
412 |
|
atoms[nLipAtoms*i+14].type = CH2; |
413 |
+ |
atoms[nLipAtoms*i+14].mass = 14.03; |
414 |
|
|
415 |
|
atoms[nLipAtoms*i+15].type = CH2; |
416 |
+ |
atoms[nLipAtoms*i+15].mass = 14.03; |
417 |
|
|
418 |
|
atoms[nLipAtoms*i+16].type = CH2; |
419 |
+ |
atoms[nLipAtoms*i+16].mass = 14.03; |
420 |
|
|
421 |
|
atoms[nLipAtoms*i+17].type = CH2; |
422 |
+ |
atoms[nLipAtoms*i+17].mass = 14.03; |
423 |
|
|
424 |
|
atoms[nLipAtoms*i+18].type = CH3; |
425 |
+ |
atoms[nLipAtoms*i+18].mass = 15.04; |
426 |
|
} |
427 |
|
|
428 |
|
for(i=(nLipAtoms*nLipids);i<nAtoms;i++){ |
429 |
|
atoms[i].type = SSD; |
430 |
+ |
atoms[i].mass = 18.03; |
431 |
|
atoms[i].u[0] = 0.0; |
432 |
|
atoms[i].u[1] = 0.0; |
433 |
|
atoms[i].u[2] = 1.0; |
435 |
|
|
436 |
|
// read and set the frames |
437 |
|
|
438 |
< |
openFile( inName ); |
438 |
> |
openFile(); |
439 |
|
|
440 |
|
fprintf( stdout, |
441 |
|
"\n" |
443 |
|
inName ); |
444 |
|
fflush(stdout); |
445 |
|
|
446 |
< |
setFrames( inName ); |
446 |
> |
setFrames(); |
447 |
|
|
448 |
|
fprintf( stdout, |
449 |
|
"done.\n" |
450 |
< |
"nFrames = %d\n.", |
450 |
> |
"nFrames = %d.\n", |
451 |
|
nFrames ); |
452 |
|
fflush(stdout); |
453 |
|
|
457 |
|
"Calculating the Scd correlation\n" ); |
458 |
|
fflush( stdout ); |
459 |
|
|
460 |
< |
calcScdCorr( startTime ); |
460 |
> |
calcScdCorr( startTime, atoms, outPrefix ); |
461 |
|
} |
462 |
+ |
|
463 |
+ |
if(directorHead){ |
464 |
+ |
|
465 |
+ |
fprintf ( stdout, |
466 |
+ |
"Calculating the Head director\n" ); |
467 |
+ |
fflush( stdout ); |
468 |
+ |
|
469 |
+ |
calcDirHeadCorr( startTime, atoms, outPrefix ); |
470 |
+ |
} |
471 |
+ |
|
472 |
+ |
if(directorWhole){ |
473 |
+ |
|
474 |
+ |
fprintf ( stdout, |
475 |
+ |
"Calculating the bilayer director\n" ); |
476 |
+ |
fflush( stdout ); |
477 |
+ |
|
478 |
+ |
calcDirWholeCorr( startTime, atoms, outPrefix ); |
479 |
+ |
} |
480 |
|
|
481 |
|
|
482 |
+ |
closeFile(); |
483 |
+ |
|
484 |
|
} |
485 |
|
|
486 |
|
|
502 |
|
" -l <maxLength> set the maximum value of r\n" |
503 |
|
" *Defaults to 1/2 smallest length of first frame.\n" |
504 |
|
" -s Calculate the Scd chain correlation.\n" |
505 |
+ |
" -h Calculate the directors for the head groups\n" |
506 |
+ |
" -w Calculate the director fro the bilayers\n" |
507 |
|
"\n" |
508 |
|
" long:\n" |
509 |
|
" -----\n" |