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 1881 by gezelter, Tue Jun 18 16:07:27 2013 UTC vs.
Revision 1882 by gezelter, Tue Jun 18 16:10:07 2013 UTC

# Line 154 | Line 154 | namespace OpenMD {
154      }
155      
156      for (int i = 0; i < nBins_; i++) {
157 <      RealType temp = 2.0 * binKE[i] / (binDof[i] * PhysicalConstants::kb *
158 <                                        PhysicalConstants::energyConvert);
159 <      RealType den = binMass[i] * nBins_ * PhysicalConstants::densityConvert
160 <        / volume_;
161 <      Vector3d vel = binVel[i] / RealType(binCount[i]);
162 <      dynamic_cast<Accumulator *>(temperature->accumulator[i])->add(temp);
163 <      dynamic_cast<VectorAccumulator *>(velocity->accumulator[i])->add(vel);
164 <      dynamic_cast<Accumulator *>(density->accumulator[i])->add(den);
165 <      dynamic_cast<Accumulator *>(counts_->accumulator[i])->add(1);
157 >      if (binDof[i] > 0) {
158 >        RealType temp = 2.0 * binKE[i] / (binDof[i] * PhysicalConstants::kb *
159 >                                          PhysicalConstants::energyConvert);
160 >        RealType den = binMass[i] * nBins_ * PhysicalConstants::densityConvert
161 >          / volume_;
162 >        Vector3d vel = binVel[i] / RealType(binCount[i]);
163 >        dynamic_cast<Accumulator *>(temperature->accumulator[i])->add(temp);
164 >        dynamic_cast<VectorAccumulator *>(velocity->accumulator[i])->add(vel);
165 >        dynamic_cast<Accumulator *>(density->accumulator[i])->add(den);
166 >        dynamic_cast<Accumulator *>(counts_->accumulator[i])->add(1);
167 >      }
168      }
169    }
170    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines