ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/integrators/NVT.cpp
(Generate patch)

Comparing branches/development/src/integrators/NVT.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1715 by gezelter, Tue May 22 21:55:31 2012 UTC

# Line 79 | Line 79 | namespace OpenMD {
79        tauThermostat_ = simParams->getTauThermostat();
80      }
81  
82 <    update();
82 >    updateSizes();
83    }
84  
85 <  void NVT::doUpdate() {
85 >  void NVT::doUpdateSizes() {
86      oldVel_.resize(info_->getNIntegrableObjects());
87 <    oldJi_.resize(info_->getNIntegrableObjects());    
87 >    oldJi_.resize(info_->getNIntegrableObjects());
88    }
89    void NVT::moveA() {
90      SimInfo::MoleculeIterator i;
# Line 137 | Line 137 | namespace OpenMD {
137  
138            //ji[j] += dt2 * (Tb[j] * PhysicalConstants::energyConvert - ji[j]*chi);
139            ji += dt2*PhysicalConstants::energyConvert*Tb - dt2*chi *ji;
140 <          rotAlgo->rotate(integrableObject, ji, dt);
140 >          rotAlgo_->rotate(integrableObject, ji, dt);
141  
142            integrableObject->setJ(ji);
143          }
# Line 145 | Line 145 | namespace OpenMD {
145  
146      }
147      
148 <    rattle->constraintA();
148 >    flucQ_->moveA();
149 >    rattle_->constraintA();
150  
151      // Finally, evolve chi a half step (just like a velocity) using
152      // temperature at time t, not time t+dt/2
# Line 182 | Line 183 | namespace OpenMD {
183      for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) {
184        for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL;
185             integrableObject = mol->nextIntegrableObject(j)) {
185        oldVel_[index] = integrableObject->getVel();
186        oldJi_[index] = integrableObject->getJ();                
186  
187 +        oldVel_[index] = integrableObject->getVel();
188 +        
189 +        if (integrableObject->isDirectional())
190 +          oldJi_[index] = integrableObject->getJ();                
191 +        
192          ++index;    
193 <      }
190 <          
193 >      }          
194      }
195  
196      // do the iteration:
# Line 235 | Line 238 | namespace OpenMD {
238          }
239        }
240      
241 +      rattle_->constraintB();
242  
239      rattle->constraintB();
240
243        if (fabs(prevChi - chi) <= chiTolerance_)
244          break;
245  
246      }
247  
248 <    integralOfChidt += dt2 * chi;
248 >    flucQ_->moveB();
249  
250 +    integralOfChidt += dt2 * chi;
251      currentSnapshot_->setChi(chi);
252      currentSnapshot_->setIntegralOfChiDt(integralOfChidt);
253    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines