ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/sequentialProps/ContactAngle2.cpp
(Generate patch)

Comparing trunk/src/applications/sequentialProps/ContactAngle2.cpp (file contents):
Revision 2071 by gezelter, Sat Mar 7 21:41:51 2015 UTC vs.
Revision 2072 by gezelter, Sat Mar 7 22:54:56 2015 UTC

# Line 122 | Line 122 | namespace OpenMD {
122        // z is possibly symmetric around 0
123        z = pos.z();
124            
125 <      std::size_t whichRBin = int(r / dr);
126 <      std::size_t whichZBin = int( (zLen/2.0 + z) / dz);
125 >      int whichRBin = int(r / dr);
126 >      int whichZBin = int( (zLen/2.0 + z) / dz);
127        
128 <      if ((whichRBin < nRBins_) && (whichZBin >= 0) && (whichZBin < nZBins_))
129 <        histo[whichRBin][whichZBin] += sd->getMass();
128 >      if ((whichRBin < nRBins_) && (whichZBin >= 0) && (whichZBin < nZBins_)) {
129 >        std::size_t i = static_cast<std::size_t>(whichRBin);
130 >        std::size_t j = static_cast<std::size_t>(whichZBin);
131 >        histo[i][j] += sd->getMass();
132 >      }
133        
134      }
135      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines