ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/staticProps/GofXyz.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/staticProps/GofXyz.cpp (file contents):
Revision 1994 by tim, Thu Feb 10 18:14:03 2005 UTC vs.
Revision 2038 by tim, Wed Feb 16 20:30:50 2005 UTC

# Line 46 | Line 46 | GofXyz::GofXyz(SimInfo* info, const std::string& filen
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  
# Line 83 | Line 97 | void GofXyz::processHistogram() {
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      }
# Line 107 | Line 122 | void GofXyz::collectHistogram(StuntDouble* sd1, StuntD
122      ++histogram_[whichRBin][whichThetaBin];
123      
124      ++npairs_;
125 +    */
126   }
127  
128   void GofXyz::writeRdf() {
# Line 123 | Line 139 | 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          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines