6 |
|
#include "cosCorr.h" |
7 |
|
|
8 |
|
void cosCorr( char* out_prefix, char* atom1, char* atom2, |
9 |
< |
struct xyz_frame* frames, int nFrames ){ |
9 |
> |
struct xyz_frame* frames, int nFrames, |
10 |
> |
int startFrame, int endFrame ){ |
11 |
|
|
12 |
|
|
13 |
|
int i,j,k; |
14 |
< |
|
14 |
< |
double atom1Dens; |
15 |
< |
double atom2Dens; |
16 |
< |
|
17 |
< |
double atom1Constant; |
18 |
< |
double atom2Constant; |
19 |
< |
|
14 |
> |
|
15 |
|
double nAtom1; |
16 |
|
double nAtom2; |
17 |
|
|
86 |
|
atom2 ); |
87 |
|
exit(8); |
88 |
|
} |
89 |
< |
|
95 |
< |
// calculate some of the constants; |
96 |
< |
|
97 |
< |
atom1Dens = nAtom1 / boxVol; |
98 |
< |
atom2Dens = nAtom2 / boxVol; |
99 |
< |
|
100 |
< |
atom1Constant = ( 4.0 * M_PI * atom1Dens ) / 3.0; |
101 |
< |
atom2Constant = ( 4.0 * M_PI * atom2Dens ) / 3.0; |
102 |
< |
|
89 |
> |
|
90 |
|
// calculate the histogram |
91 |
|
|
92 |
< |
for( i=0; i<nFrames; i++){ |
92 |
> |
for( i=startFrame; i<endFrame; i++){ |
93 |
|
for( j=0; j<(frames[i].nAtoms-1); j++ ){ |
94 |
|
|
95 |
|
if( !strcmp( frames[0].names[j], atom1 ) ){ |