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 1994 by tim, Thu Feb 10 18:14:03 2005 UTC vs.
Revision 2032 by tim, Tue Feb 15 17:24:12 2005 UTC

# Line 67 | Line 67 | void GofRAngle::processHistogram() {
67  
68  
69   void GofRAngle::processHistogram() {
70 <
70 >    int nRealPairs = getNRealPairs();
71      double volume = info_->getSnapshotManager()->getCurrentSnapshot()->getVolume();
72 <    double pairDensity = npairs_ /volume;
73 <    double pairConstant = ( 4.0 * PI * pairDensity ) / 3.0;
72 >    double pairDensity = nRealPairs /volume;
73 >    double pairConstant = ( 4.0 * NumericConstant::PI * pairDensity ) / 3.0;
74  
75      for(int i = 0 ; i < histogram_.size(); ++i){
76  
# Line 100 | Line 100 | void GofRAngle::collectHistogram(StuntDouble* sd1, Stu
100      double distance = r12.length();
101      int whichRBin = distance / deltaR_;
102  
103 <    
104 <    double cosAngle = evaluateAngle(sd1, sd2);
105 <    double halfBin = (nAngleBins_ - 1) * 0.5;
106 <    int whichThetaBin = halfBin * (cosAngle + 1.0)
107 <    ++histogram_[whichRBin][whichThetaBin];
108 <    
109 <    ++npairs_;
103 >    if (distance <= len_) {
104 >        double cosAngle = evaluateAngle(sd1, sd2);
105 >        double halfBin = (nAngleBins_ - 1) * 0.5;
106 >        int whichThetaBin = halfBin * (cosAngle + 1.0);
107 >        ++histogram_[whichRBin][whichThetaBin];
108 >        
109 >        ++npairs_;
110 >    }
111   }
112  
113   void GofRAngle::writeRdf() {
# Line 139 | Line 140 | double GofRTheta::evaluateAngle(StuntDouble* sd1, Stun
140      Vector3d r12 = pos1 - pos2;
141      currentSnapshot_->wrapVector(r12);
142      r12.normalize();
143 <    Vector3d dipole = sd1->getElectroFrame().getColumn(2)£»
143 >    Vector3d dipole = sd1->getElectroFrame().getColumn(2);
144      dipole.normalize();    
145 <    return dot();
145 >    return dot(r12, dipole);
146   }
147  
148   double GofROmega::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) {
149      Vector3d v1 = sd1->getElectroFrame().getColumn(2);
150      Vector3d v2 = sd1->getElectroFrame().getColumn(2);    
151 +    v1.normalize();
152 +    v2.normalize();
153 +    return dot(v1, v2);
154   }
155  
156  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines