| 46 |
|
|
| 47 |
|
namespace oopse { |
| 48 |
|
|
| 49 |
< |
GofXyz::GofXyz(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2) |
| 50 |
< |
: RadialDistrFunc(info, filename, sele1, sele2){ |
| 49 |
> |
GofXyz::GofXyz(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2, double len, int nrbins) |
| 50 |
> |
: RadialDistrFunc(info, filename, sele1, sele2), len_(len), nRBins_(nrbins) { |
| 51 |
> |
setOutputName(getPrefix(filename) + ".gxyz"); |
| 52 |
|
|
| 53 |
+ |
deltaR_ = len_ / nRBins_; |
| 54 |
+ |
|
| 55 |
+ |
histogram_.resize(nRBins_); |
| 56 |
+ |
for (int i = 0 ; i < nRBins_; ++i) { |
| 57 |
+ |
histogram_[i].resize(nRBins_); |
| 58 |
+ |
for(int j = 0; j < nRBins_; ++j) { |
| 59 |
+ |
histogram_[i][j].resize(nRBins_); |
| 60 |
+ |
} |
| 61 |
+ |
} |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
|
| 65 |
|
void GofXyz::preProcess() { |
| 66 |
< |
|
| 66 |
> |
/* |
| 67 |
|
for (int i = 0; i < avgGofr_.size(); ++i) { |
| 68 |
|
std::fill(avgGofr_[i].begin(), avgGofr_[i].end(), 0); |
| 69 |
|
} |
| 70 |
+ |
*/ |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
void GofXyz::initalizeHistogram() { |
| 74 |
+ |
/* |
| 75 |
|
npairs_ = 0; |
| 76 |
|
for (int i = 0; i < histogram_.size(); ++i) |
| 77 |
|
std::fill(histogram_[i].begin(), histogram_[i].end(), 0); |
| 78 |
+ |
*/ |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
|
| 82 |
|
void GofXyz::processHistogram() { |
| 83 |
|
|
| 84 |
+ |
/* |
| 85 |
|
double volume = info_->getSnapshotManager()->getCurrentSnapshot()->getVolume(); |
| 86 |
|
double pairDensity = npairs_ /volume; |
| 87 |
< |
double pairConstant = ( 4.0 * PI * pairDensity ) / 3.0; |
| 87 |
> |
double pairConstant = ( 4.0 * NumericConstant::PI * pairDensity ) / 3.0; |
| 88 |
|
|
| 89 |
|
for(int i = 0 ; i < histogram_.size(); ++i){ |
| 90 |
|
|
| 97 |
|
avgGofr_[i][j] += histogram_[i][j] / nIdeal; |
| 98 |
|
} |
| 99 |
|
} |
| 100 |
< |
|
| 100 |
> |
*/ |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
void GofXyz::collectHistogram(StuntDouble* sd1, StuntDouble* sd2) { |
| 104 |
|
|
| 105 |
+ |
/* |
| 106 |
|
if (sd1 == sd2) { |
| 107 |
|
return; |
| 108 |
|
} |
| 122 |
|
++histogram_[whichRBin][whichThetaBin]; |
| 123 |
|
|
| 124 |
|
++npairs_; |
| 125 |
+ |
*/ |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
void GofXyz::writeRdf() { |
| 139 |
|
double y = deltaR_ * (j+ 0.5); |
| 140 |
|
|
| 141 |
|
for(int k = 0;k < histogram_[i].size(); ++k) { |
| 142 |
< |
double z = deltaR_ * (k + 0.5); |
| 143 |
< |
rdfStream << x << "\t" << y << "\t" << z << "\t" << histogram_[i][j][k]/nProcessed_ << "\n"; |
| 142 |
> |
double z = deltaR_ * (k + 0.5); |
| 143 |
> |
rdfStream << x << "\t" << y << "\t" << z << "\t" << histogram_[i][j][k]/nProcessed_ << "\n"; |
| 144 |
> |
} |
| 145 |
|
} |
| 146 |
|
} |
| 147 |
|
|