1 |
|
#include <iostream> |
2 |
|
#include <cstdlib> |
3 |
|
#include <cstring> |
4 |
+ |
#include <math.h> |
5 |
|
|
6 |
|
#include "simError.h" |
7 |
|
#include "PairCorrType.hpp" |
22 |
|
|
23 |
|
nAtoms = theNatoms; |
24 |
|
|
25 |
+ |
if( (nAtoms <= 0) || (nBins <= 0) ){ |
26 |
+ |
sprintf( painCave.errMsg, |
27 |
+ |
"Pair Corr Type Error: nBins and nAtoms must be greater than 0\n" |
28 |
+ |
" nBins = %d, nAtoms = %d\n", |
29 |
+ |
nBins, nAtoms ); |
30 |
+ |
painCave.isFatal = 1; |
31 |
+ |
simError(); |
32 |
+ |
} |
33 |
+ |
|
34 |
+ |
|
35 |
|
isAtom1 = new bool[nAtoms]; |
36 |
|
isAtom2 = new bool[nAtoms]; |
37 |
|
|
112 |
|
if( isSelfSelf ) pairDensity = nAtoms1 * (nAtoms1 - 1) / volume; |
113 |
|
else pairDensity = nAtoms1 * nAtoms2 / volume; |
114 |
|
|
115 |
< |
pairConstant = ( 4.0 * M_PI * pairDens ) / 3.0; |
115 |
> |
pairConstant = ( 4.0 * M_PI * pairDensity ) / 3.0; |
116 |
|
|
117 |
|
} |
118 |
|
|