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

Comparing trunk/OOPSE-3.0/src/applications/staticProps/GofR.cpp (file contents):
Revision 1990 by tim, Wed Feb 9 17:08:22 2005 UTC vs.
Revision 1991 by tim, Wed Feb 9 18:12:47 2005 UTC

# Line 42 | Line 42
42   #include <algorithm>
43   #include <fstream>
44   #include "applications/staticProps/GofR.hpp"
45 + #include "utils/simError.h"
46  
47   namespace oopse {
48  
# Line 91 | Line 92 | void GofR::collectHistogram(StuntDouble* sd1, StuntDou
92      Vector3d pos1 = sd1->getPos();
93      Vector3d pos2 = sd2->getPos();
94      Vector3d r12 = pos1 - pos2;
95 <    
95 <    double distance = (pos1 - pos2).length();
95 >    currentSnapshot_->wrapVector(r12);
96  
97 +    double distance = r12.length();
98 +
99      int whichBin = distance / delta_;
100      histogram_[whichBin] ++;
101      npairs_++;
# Line 104 | Line 106 | void GofR::writeRdf() {
106      std::ofstream rdfStream(outputFilename_.c_str());
107      if (rdfStream.is_open()) {
108          rdfStream << "#radial distribution function\n";
109 <        rdfStream << "#selection1: " << selectionScript1_;
110 <        rdfStream << "#selection2: " << selectionScript2_;
109 >        rdfStream << "#selection1: (" << selectionScript1_ << ")\t";
110 >        rdfStream << "selection2: (" << selectionScript2_ << ")\n";
111 >        rdfStream << "#r\tcorrValue\n";
112 >        for (int i = 0; i < avgGofr_.size(); ++i) {
113 >            double r = delta_ * (i + 0.5);
114 >            rdfStream << r << "\t" << avgGofr_[i]/nProcessed_ << "\n";
115 >        }
116          
117      } else {
118  
119  
120      }
121 +
122 +    rdfStream.close();
123   }
124  
125   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines