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

Comparing trunk/OOPSE-4/src/applications/staticProps/GofRAngle.cpp (file contents):
Revision 3321 by gezelter, Wed Oct 18 21:58:48 2006 UTC vs.
Revision 3322 by xsun, Wed Jan 23 21:21:50 2008 UTC

# Line 50 | Line 50 | namespace oopse {
50                         const std::string& sele2, RealType len, int nrbins, int nangleBins)
51      : RadialDistrFunc(info, filename, sele1, sele2), len_(len), nRBins_(nrbins), nAngleBins_(nangleBins){
52  
53 <      deltaR_ = len_ /nRBins_;            
54 <      deltaCosAngle_ = 2.0 / nAngleBins_;    
55 <
53 >      deltaR_ = len_ /(double) nRBins_;
54 >      deltaCosAngle_ = 2.0 / (double)nAngleBins_;    
55        histogram_.resize(nRBins_);
56        avgGofr_.resize(nRBins_);
57        for (int i = 0 ; i < nRBins_; ++i) {
# Line 63 | Line 62 | namespace oopse {
62  
63  
64    void GofRAngle::preProcess() {
66
65      for (int i = 0; i < avgGofr_.size(); ++i) {
66        std::fill(avgGofr_[i].begin(), avgGofr_[i].end(), 0);
67      }
# Line 71 | Line 69 | namespace oopse {
69  
70    void GofRAngle::initalizeHistogram() {
71      npairs_ = 0;
72 <    for (int i = 0; i < histogram_.size(); ++i)
72 >    for (int i = 0; i < histogram_.size(); ++i){
73        std::fill(histogram_[i].begin(), histogram_[i].end(), 0);
74 +    }
75    }
76  
78
77    void GofRAngle::processHistogram() {
80
78      int nPairs = getNPairs();
79      RealType volume = info_->getSnapshotManager()->getCurrentSnapshot()->getVolume();
80      RealType pairDensity = nPairs /volume;
# Line 102 | Line 99 | namespace oopse {
99      if (sd1 == sd2) {
100        return;
101      }
105    
102      Vector3d pos1 = sd1->getPos();
103      Vector3d pos2 = sd2->getPos();
104      Vector3d r12 = pos2 - pos1;
# Line 113 | Line 109 | namespace oopse {
109      int whichRBin = distance / deltaR_;
110  
111      if (distance <= len_) {
112 +
113        RealType cosAngle = evaluateAngle(sd1, sd2);
114        RealType halfBin = (nAngleBins_ - 1) * 0.5;
115        int whichThetaBin = halfBin * (cosAngle + 1.0);
# Line 154 | Line 151 | namespace oopse {
151      Vector3d pos1 = sd1->getPos();
152      Vector3d pos2 = sd2->getPos();
153      Vector3d r12 = pos2 - pos1;
154 <    
154 >  
155      if (usePeriodicBoundaryConditions_)
156        currentSnapshot_->wrapVector(r12);
157  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines