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 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
Revision 1715 by gezelter, Tue May 22 21:55:31 2012 UTC

# Line 36 | Line 36
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38   * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include "integrators/NVT.hpp"
# Line 78 | 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 136 | 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 144 | 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 181 | 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)) {
184        oldVel_[index] = integrableObject->getVel();
185        oldJi_[index] = integrableObject->getJ();                
186  
187 +        oldVel_[index] = integrableObject->getVel();
188 +        
189 +        if (integrableObject->isDirectional())
190 +          oldJi_[index] = integrableObject->getJ();                
191 +        
192          ++index;    
193 <      }
189 <          
193 >      }          
194      }
195  
196      // do the iteration:
# Line 234 | Line 238 | namespace OpenMD {
238          }
239        }
240      
241 +      rattle_->constraintB();
242  
238      rattle->constraintB();
239
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