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 1885 by gezelter, Tue Jun 18 17:16:15 2013 UTC

# Line 86 | Line 86 | namespace OpenMD {
86    }
87  
88    void RNEMDZ::processFrame(int istep) {
89 +    RealType z;
90 +
91 +    hmat_ = currentSnapshot_->getHmat();
92 +    for (int i = 0; i < nBins_; i++) {
93 +      z = (((RealType)i + 0.5) / (RealType)nBins_) * hmat_(2,2);
94 +      dynamic_cast<Accumulator*>(z_->accumulator[i])->add(z);
95 +    }
96 +    volume_ = currentSnapshot_->getVolume();
97 +
98 +
99      Molecule* mol;
100      RigidBody* rb;
101      StuntDouble* sd;
# Line 96 | Line 106 | namespace OpenMD {
106      vector<RealType> binMass(nBins_, 0.0);
107      vector<Vector3d> binVel(nBins_, V3Zero);
108      vector<RealType> binKE(nBins_, 0.0);
109 <    vector<int> binDof(nBins_, 0);
110 <    vector<int> binCount(nBins_, 0);
109 >    vector<unsigned int> binDof(nBins_, 0);
110 >    vector<unsigned int> binCount(nBins_, 0);
111      
112      
113      for (mol = info_->beginMolecule(mi); mol != NULL;
# Line 110 | Line 120 | namespace OpenMD {
120          rb->updateAtoms();
121        }
122      }
123 <    
123 >  
124      if (evaluator_.isDynamic()) {
125        seleMan_.setSelectionSet(evaluator_.evaluate());
126      }
# Line 122 | Line 132 | namespace OpenMD {
132        
133        // figure out where that object is:
134        Vector3d pos = sd->getPos();
135 <      currentSnapshot_->wrapVector(pos);
135 >      Vector3d vel = sd->getVel();
136 >      RealType m = sd->getMass();
137  
138        int bin = getBin(pos);
128      binCount[bin]++;
139  
140 <      RealType m = sd->getMass();
140 >      binCount[bin] += 1;
141 >
142        binMass[bin] += m;
132      Vector3d vel = sd->getVel();
143        binVel[bin] += vel;
144        binKE[bin] += 0.5 * (m * vel.lengthSquare());
145        binDof[bin] += 3;
# Line 153 | Line 163 | namespace OpenMD {
163        }
164      }
165      
166 <    for (int i = 0; i < nBins_; i++) {
166 >    for (unsigned int i = 0; i < nBins_; i++) {
167 >
168        if (binDof[i] > 0) {
169          RealType temp = 2.0 * binKE[i] / (binDof[i] * PhysicalConstants::kb *
170                                            PhysicalConstants::energyConvert);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines