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

Comparing trunk/OOPSE-2.0/src/applications/staticProps/GofRAngle.cpp (file contents):
Revision 1993 by tim, Thu Feb 10 14:15:52 2005 UTC vs.
Revision 1994 by tim, Thu Feb 10 18:14:03 2005 UTC

# Line 46 | Line 46 | GofRAngle::GofRAngle(SimInfo* info, const std::string&
46  
47   namespace oopse {
48  
49 < GofRAngle::GofRAngle(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2, double len)
50 <    : RadialDistrFunc(info, filename, sele1, sele2, len){
49 > GofRAngle::GofRAngle(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2)
50 >    : RadialDistrFunc(info, filename, sele1, sele2){
51  
52    histogram_.resize(nbins_);
53    avgGofr_.resize(nbins_);
52   }
53  
54  
55   void GofRAngle::preProcess() {
56 <    avgGofr_.resize(nbins_);
57 <    for (int i = 0; i < avgGofr_.size(); ++i)
56 >
57 >    for (int i = 0; i < avgGofr_.size(); ++i) {
58          std::fill(avgGofr_[i].begin(), avgGofr_[i].end(), 0);
59 +    }
60   }
61  
62   void GofRAngle::initalizeHistogram() {
# Line 99 | Line 98 | void GofRAngle::collectHistogram(StuntDouble* sd1, Stu
98      currentSnapshot_->wrapVector(r12);
99  
100      double distance = r12.length();
101 <    int whichBin = distance / deltaR_;
101 >    int whichRBin = distance / deltaR_;
102  
103      
104      double cosAngle = evaluateAngle(sd1, sd2);
105 <    histogram_[whichBin] ++;
105 >    double halfBin = (nAngleBins_ - 1) * 0.5;
106 >    int whichThetaBin = halfBin * (cosAngle + 1.0)
107 >    ++histogram_[whichRBin][whichThetaBin];
108      
109 <    npairs_++;
109 >    ++npairs_;
110   }
111  
112   void GofRAngle::writeRdf() {
# Line 119 | Line 120 | void GofRAngle::writeRdf() {
120              double r = deltaR_ * (i + 0.5);
121  
122              for(int j = 0; j < avgGofr_[i].size(); ++j) {
123 <                double cosAngle = ;
123 >                double cosAngle = -1.0 + (i + 0.5)*deltaCosAngle_;
124                  rdfStream << r << "\t" << cosAngle << "\t" << avgGofr_[i][j]/nProcessed_ << "\n";
125              }
126          }
# Line 132 | Line 133 | void GofRAngle::writeRdf() {
133      rdfStream.close();
134   }
135  
135
136
136   double GofRTheta::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) {
137      Vector3d pos1 = sd1->getPos();
138      Vector3d pos2 = sd2->getPos();
# Line 147 | Line 146 | double GofROmega::evaluateAngle(StuntDouble* sd1, Stun
146  
147   double GofROmega::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) {
148      Vector3d v1 = sd1->getElectroFrame().getColumn(2);
149 <    Vector3d v2 = sd1->getElectroFrame().getColumn(2);
151 <
152 <    
149 >    Vector3d v2 = sd1->getElectroFrame().getColumn(2);    
150   }
151  
152  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines