--- trunk/src/applications/staticProps/GofAngle2.cpp 2005/02/10 18:14:03 310 +++ trunk/src/applications/staticProps/GofAngle2.cpp 2005/02/16 20:30:50 354 @@ -41,38 +41,50 @@ #include #include -#include "applications/staticProps/GofRAngle2.hpp" +#include "applications/staticProps/GofAngle2.hpp" #include "utils/simError.h" namespace oopse { -GofRAngle2::GofRAngle2(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2) - : RadialDistrFunc(info, filename, sele1, sele2){ +GofAngle2::GofAngle2(SimInfo* info, const std::string& filename, const std::string& sele1, + const std::string& sele2, int nangleBins) + : RadialDistrFunc(info, filename, sele1, sele2), nAngleBins_(nangleBins) { + setOutputName(getPrefix(filename) + ".gto"); + + deltaCosAngle_ = 2.0 / nAngleBins_; + + histogram_.resize(nAngleBins_); + avgGofr_.resize(nAngleBins_); + for (int i = 0 ; i < nAngleBins_; ++i) { + histogram_[i].resize(nAngleBins_); + avgGofr_[i].resize(nAngleBins_); + } + } -void GofRAngle2::preProcess() { +void GofAngle2::preProcess() { for (int i = 0; i < avgGofr_.size(); ++i) { std::fill(avgGofr_[i].begin(), avgGofr_[i].end(), 0); } } -void GofRAngle2::initalizeHistogram() { +void GofAngle2::initalizeHistogram() { npairs_ = 0; for (int i = 0; i < histogram_.size(); ++i) std::fill(histogram_[i].begin(), histogram_[i].end(), 0); } -void GofRAngle2::processHistogram() { +void GofAngle2::processHistogram() { //std::for_each(avgGofr_.begin(), avgGofr_.end(), std::plus>) } -void GofRAngle2::collectHistogram(StuntDouble* sd1, StuntDouble* sd2) { +void GofAngle2::collectHistogram(StuntDouble* sd1, StuntDouble* sd2) { if (sd1 == sd2) { return; @@ -101,7 +113,7 @@ void GofRAngle2::collectHistogram(StuntDouble* sd1, St ++npairs_; } -void GofRAngle::writeRdf() { +void GofAngle2::writeRdf() { std::ofstream rdfStream(outputFilename_.c_str()); if (rdfStream.is_open()) { rdfStream << "#radial distribution function\n";