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++){ |
79 |
|
strcpy( muCorr, argv[i] ); |
80 |
|
} |
81 |
|
|
82 |
< |
else if( !strcmp( argv[i], "--CosCorr" ) ){ |
83 |
< |
calcCosCorr = 1; |
82 |
> |
else if( !strcmp( argv[i], "--startFrame" ) ){ |
83 |
> |
haveStartFrame = 1; |
84 |
|
i++; |
85 |
< |
strcpy( cosCorr1, argv[i] ); |
85 |
> |
startFrame = atoi(argv[i]); |
86 |
> |
} |
87 |
> |
|
88 |
> |
else if( !strcmp( argv[i], "--endFrame" ) ){ |
89 |
> |
haveEndFrame = 1; |
90 |
|
i++; |
91 |
< |
strcpy( cosCorr2, argv[i] ); |
91 |
> |
endFrame = atoi(argv[i]); |
92 |
|
} |
93 |
|
|
94 |
|
else{ |
176 |
|
fflush( stdout ); |
177 |
|
|
178 |
|
nFrames = frameCount( in_name ); |
179 |
+ |
if( !haveEndFrame ) endFrame = nFrames; |
180 |
|
|
181 |
|
printf( "done.\n" |
182 |
|
"nframes = %d\n" |
233 |
|
if( calcMuCorr || calcCosCorr ){ |
234 |
|
dumpArray[j].v = |
235 |
|
(struct vect *)calloc(n_atoms, sizeof(struct vect)); |
226 |
– |
printf( " (Note: reading in vectors)... " ); |
227 |
– |
fflush( stdout ); |
236 |
|
} |
237 |
|
|
238 |
|
//read the time and the box sizes |
364 |
|
fflush( stdout ); |
365 |
|
|
366 |
|
// gofr call |
367 |
< |
GofR( out_prefix, gofR1, gofR2, dumpArray, nFrames ); |
367 |
> |
GofR( out_prefix, gofR1, gofR2, dumpArray, nFrames, startFrame, endFrame ); |
368 |
|
|
369 |
|
fprintf( stdout, |
370 |
|
" done.\n" |
410 |
|
cosCorr1, cosCorr2 ); |
411 |
|
fflush( stdout ); |
412 |
|
|
413 |
< |
// cosCorr call |
414 |
< |
|
413 |
> |
cosCorr( out_prefix, cosCorr1, cosCorr2, dumpArray, nFrames, startFrame, |
414 |
> |
endFrame ); |
415 |
|
|
416 |
|
fprintf( stdout, |
417 |
|
" done.\n" |
424 |
|
} |
425 |
|
|
426 |
|
|
427 |
+ |
void map( double *x, double *y, double *z, |
428 |
+ |
double boxX, double boxY, double boxZ ){ |
429 |
+ |
|
430 |
+ |
*x -= boxX * copysign(1.0,*x) * floor( fabs( *x/boxX ) + 0.5 ); |
431 |
+ |
*y -= boxY * copysign(1.0,*y) * floor( fabs( *y/boxY ) + 0.5 ); |
432 |
+ |
*z -= boxZ * copysign(1.0,*z) * floor( fabs( *z/boxZ ) + 0.5 ); |
433 |
|
|
434 |
+ |
} |
435 |
+ |
|
436 |
+ |
|
437 |
|
/*************************************************************************** |
438 |
|
* prints out the usage for the command line arguments, then exits. |
439 |
|
***************************************************************************/ |
458 |
|
" -note: \"all\" will do all atoms\n" |
459 |
|
" --MuCorr <atom> Calculate mu correlation of atom\n" |
460 |
|
" --CosCorr <atom1> <atom2> Calculate the cos correlation between atom1 and atom2\n" |
461 |
+ |
" --startFrame <frame#> Specifies a frame to start correlating\n" |
462 |
+ |
" --endFrame <frame#> Specifies a frame to stop correlating.\n" |
463 |
|
|
445 |
– |
|
464 |
|
"\n" |
465 |
|
"\n", |
466 |
|
program_name); |