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

Comparing trunk/src/applications/staticProps/RNEMDStats.cpp (file contents):
Revision 1882 by gezelter, Tue Jun 18 16:10:07 2013 UTC vs.
Revision 1883 by gezelter, Tue Jun 18 16:16:40 2013 UTC

# Line 96 | Line 96 | namespace OpenMD {
96      vector<RealType> binMass(nBins_, 0.0);
97      vector<Vector3d> binVel(nBins_, V3Zero);
98      vector<RealType> binKE(nBins_, 0.0);
99 <    vector<int> binDof(nBins_, 0);
100 <    vector<int> binCount(nBins_, 0);
99 >    vector<unsigned int> binDof(nBins_, 0);
100 >    vector<unsigned int> binCount(nBins_, 0);
101      
102      
103      for (mol = info_->beginMolecule(mi); mol != NULL;
# Line 122 | Line 122 | namespace OpenMD {
122        
123        // figure out where that object is:
124        Vector3d pos = sd->getPos();
125 <      currentSnapshot_->wrapVector(pos);
125 >      Vector3d vel = sd->getVel();
126 >      RealType m = sd->getMass();
127  
128 +      currentSnapshot_->wrapVector(pos);
129        int bin = getBin(pos);
130 <      binCount[bin]++;
130 >      binCount[bin] += 1;
131  
130      RealType m = sd->getMass();
132        binMass[bin] += m;
132      Vector3d vel = sd->getVel();
133        binVel[bin] += vel;
134        binKE[bin] += 0.5 * (m * vel.lengthSquare());
135        binDof[bin] += 3;
# Line 153 | Line 153 | namespace OpenMD {
153        }
154      }
155      
156 <    for (int i = 0; i < nBins_; i++) {
156 >    for (unsigned int i = 0; i < nBins_; i++) {
157        if (binDof[i] > 0) {
158          RealType temp = 2.0 * binKE[i] / (binDof[i] * PhysicalConstants::kb *
159                                            PhysicalConstants::energyConvert);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines