| 1 |
#include <cstring> |
| 2 |
#include <cmath> |
| 3 |
|
| 4 |
#include "PairCorrType.hpp" |
| 5 |
|
| 6 |
|
| 7 |
GofR::GofR( char* key1, char* key2, int theNatoms ): |
| 8 |
PairCorrType( key1, key2, theNatoms ) |
| 9 |
{ |
| 10 |
int i; |
| 11 |
|
| 12 |
strcpy( corrType, "GofR" ); |
| 13 |
|
| 14 |
for(i=0;i<N_BINS;i++){ |
| 15 |
currHist[i] = 0; |
| 16 |
currGofR[i] = 0.0; |
| 17 |
avgGofR[i] = 0.0; |
| 18 |
} |
| 19 |
|
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
void GofR::correlate( double[3] Rij, double dist, |
| 25 |
double[3] uHatI, double[3] uHatJ ){ |
| 26 |
int bin; |
| 27 |
|
| 28 |
bin = (int)( dist / delR ); |
| 29 |
if( bin < N_BINS )currHist[bin] += 2; |
| 30 |
} |