--- trunk/src/applications/staticProps/GofXyz.cpp 2005/02/10 18:14:03 310 +++ trunk/src/applications/staticProps/GofXyz.cpp 2005/02/17 16:21:07 360 @@ -46,31 +46,45 @@ namespace oopse { namespace oopse { -GofXyz::GofXyz(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2) - : RadialDistrFunc(info, filename, sele1, sele2){ +GofXyz::GofXyz(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2, double len, int nrbins) + : RadialDistrFunc(info, filename, sele1, sele2), len_(len), nRBins_(nrbins) { + setOutputName(getPrefix(filename) + ".gxyz"); + deltaR_ = len_ / nRBins_; + + histogram_.resize(nRBins_); + for (int i = 0 ; i < nRBins_; ++i) { + histogram_[i].resize(nRBins_); + for(int j = 0; j < nRBins_; ++j) { + histogram_[i][j].resize(nRBins_); + } + } } void GofXyz::preProcess() { - + /* for (int i = 0; i < avgGofr_.size(); ++i) { std::fill(avgGofr_[i].begin(), avgGofr_[i].end(), 0); } + */ } void GofXyz::initalizeHistogram() { + /* npairs_ = 0; for (int i = 0; i < histogram_.size(); ++i) std::fill(histogram_[i].begin(), histogram_[i].end(), 0); + */ } void GofXyz::processHistogram() { + /* double volume = info_->getSnapshotManager()->getCurrentSnapshot()->getVolume(); double pairDensity = npairs_ /volume; - double pairConstant = ( 4.0 * PI * pairDensity ) / 3.0; + double pairConstant = ( 4.0 * NumericConstant::PI * pairDensity ) / 3.0; for(int i = 0 ; i < histogram_.size(); ++i){ @@ -83,11 +97,12 @@ void GofXyz::processHistogram() { avgGofr_[i][j] += histogram_[i][j] / nIdeal; } } - + */ } void GofXyz::collectHistogram(StuntDouble* sd1, StuntDouble* sd2) { + /* if (sd1 == sd2) { return; } @@ -107,6 +122,7 @@ void GofXyz::collectHistogram(StuntDouble* sd1, StuntD ++histogram_[whichRBin][whichThetaBin]; ++npairs_; + */ } void GofXyz::writeRdf() { @@ -123,14 +139,17 @@ void GofXyz::writeRdf() { double y = deltaR_ * (j+ 0.5); for(int k = 0;k < histogram_[i].size(); ++k) { - double z = deltaR_ * (k + 0.5); - rdfStream << x << "\t" << y << "\t" << z << "\t" << histogram_[i][j][k]/nProcessed_ << "\n"; + double z = deltaR_ * (k + 0.5); + rdfStream << x << "\t" << y << "\t" << z << "\t" << histogram_[i][j][k]/nProcessed_ << "\n"; + } } } } else { - + sprintf(painCave.errMsg, "GofXyz: unable to open %s\n", outputFilename_.c_str()); + painCave.isFatal = 1; + simError(); } rdfStream.close();