48 |
|
char cosCorr1[30]; |
49 |
|
char cosCorr2[30]; |
50 |
|
|
51 |
+ |
int startFrame = 0; |
52 |
+ |
int haveStartFrame = 0; |
53 |
+ |
int endFrame = 0; |
54 |
+ |
int haveEndFrame = 0; |
55 |
+ |
|
56 |
|
program_name = argv[0]; /*save the program name in case we need it*/ |
57 |
|
|
58 |
|
for( i = 1; i < argc; i++){ |
73 |
|
strcpy( gofR2, argv[i] ); |
74 |
|
} |
75 |
|
|
76 |
+ |
else if( !strcmp( argv[i], "--CosCorr" ) ){ |
77 |
+ |
calcCosCorr = 1; |
78 |
+ |
i++; |
79 |
+ |
strcpy( cosCorr1, argv[i] ); |
80 |
+ |
i++; |
81 |
+ |
strcpy( cosCorr2, argv[i] ); |
82 |
+ |
} |
83 |
+ |
|
84 |
|
else if( !strcmp( argv[i], "--MuCorr") ){ |
85 |
|
calcMuCorr = 1; |
86 |
|
i++; |
87 |
|
strcpy( muCorr, argv[i] ); |
88 |
|
} |
89 |
|
|
90 |
< |
else if( !strcmp( argv[i], "--CosCorr" ) ){ |
91 |
< |
calcCosCorr = 1; |
90 |
> |
else if( !strcmp( argv[i], "--startFrame" ) ){ |
91 |
> |
haveStartFrame = 1; |
92 |
|
i++; |
93 |
< |
strcpy( cosCorr1, argv[i] ); |
93 |
> |
startFrame = atoi(argv[i]); |
94 |
> |
startFrame--; |
95 |
> |
} |
96 |
> |
|
97 |
> |
else if( !strcmp( argv[i], "--endFrame" ) ){ |
98 |
> |
haveEndFrame = 1; |
99 |
|
i++; |
100 |
< |
strcpy( cosCorr2, argv[i] ); |
100 |
> |
endFrame = atoi(argv[i]); |
101 |
|
} |
102 |
|
|
103 |
|
else{ |
185 |
|
fflush( stdout ); |
186 |
|
|
187 |
|
nFrames = frameCount( in_name ); |
188 |
+ |
if( !haveEndFrame ) endFrame = nFrames; |
189 |
|
|
190 |
|
printf( "done.\n" |
191 |
|
"nframes = %d\n" |
242 |
|
if( calcMuCorr || calcCosCorr ){ |
243 |
|
dumpArray[j].v = |
244 |
|
(struct vect *)calloc(n_atoms, sizeof(struct vect)); |
226 |
– |
printf( " (Note: reading in vectors)... " ); |
227 |
– |
fflush( stdout ); |
245 |
|
} |
246 |
|
|
247 |
|
//read the time and the box sizes |
373 |
|
fflush( stdout ); |
374 |
|
|
375 |
|
// gofr call |
376 |
< |
GofR( out_prefix, gofR1, gofR2, dumpArray, nFrames ); |
376 |
> |
GofR( out_prefix, gofR1, gofR2, dumpArray, nFrames, startFrame, endFrame ); |
377 |
|
|
378 |
|
fprintf( stdout, |
379 |
|
" done.\n" |
419 |
|
cosCorr1, cosCorr2 ); |
420 |
|
fflush( stdout ); |
421 |
|
|
422 |
< |
// cosCorr call |
423 |
< |
|
422 |
> |
cosCorr( out_prefix, cosCorr1, cosCorr2, dumpArray, nFrames, startFrame, |
423 |
> |
endFrame ); |
424 |
|
|
425 |
|
fprintf( stdout, |
426 |
|
" done.\n" |
433 |
|
} |
434 |
|
|
435 |
|
|
436 |
+ |
void map( double *x, double *y, double *z, |
437 |
+ |
double boxX, double boxY, double boxZ ){ |
438 |
+ |
|
439 |
+ |
*x -= boxX * copysign(1.0,*x) * floor( fabs( *x/boxX ) + 0.5 ); |
440 |
+ |
*y -= boxY * copysign(1.0,*y) * floor( fabs( *y/boxY ) + 0.5 ); |
441 |
+ |
*z -= boxZ * copysign(1.0,*z) * floor( fabs( *z/boxZ ) + 0.5 ); |
442 |
|
|
443 |
+ |
} |
444 |
+ |
|
445 |
+ |
|
446 |
|
/*************************************************************************** |
447 |
|
* prints out the usage for the command line arguments, then exits. |
448 |
|
***************************************************************************/ |
467 |
|
" -note: \"all\" will do all atoms\n" |
468 |
|
" --MuCorr <atom> Calculate mu correlation of atom\n" |
469 |
|
" --CosCorr <atom1> <atom2> Calculate the cos correlation between atom1 and atom2\n" |
470 |
+ |
" --startFrame <frame#> Specifies a frame to start correlating\n" |
471 |
+ |
" --endFrame <frame#> Specifies a frame to stop correlating.\n" |
472 |
|
|
445 |
– |
|
473 |
|
"\n" |
474 |
|
"\n", |
475 |
|
program_name); |