unsigned char bc;
t_3dvec dist;
double d;
- //double norm;
+ double norm;
int o,s;
unsigned char ibrand;
lc=&(moldyn->lc);
- slots=moldyn->cutoff/dr;
+ slots=2.0*moldyn->cutoff/dr;
o=2*slots;
if(slots*dr<=moldyn->cutoff)
d=v3_absolute_square(&dist);
/* ignore if greater or equal cutoff */
- if(d>=moldyn->cutoff_square)
+ if(d>=4.0*moldyn->cutoff_square)
continue;
/* fill the slots */
}
}
- /* normalization
+ /* normalization */
for(i=1;i<slots;i++) {
- // normalization: 4 pi r r dr
+ // normalization: 4 pi r^2 dr
// here: not double counting pairs -> 2 pi r r dr
- norm=2*M_PI*moldyn->count*(i*dr*i*dr)*dr;
+ // ... and actually it's a constant times r^2
+ norm=i*i*dr*dr;
stat[i]/=norm;
stat[slots+i]/=norm;
stat[o+i]/=norm;
}
- */
+ /* */
if(ptr==NULL) {
/* todo: store/print pair correlation function */