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

Comparing branches/development/src/flucq/FluctuatingChargeNVT.cpp (file contents):
Revision 1731 by gezelter, Thu May 31 12:25:30 2012 UTC vs.
Revision 1735 by jmichalk, Tue Jun 5 17:50:53 2012 UTC

# Line 137 | Line 137 | namespace OpenMD {
137      RealType integralOfChidt = currentSnapshot_->getIntegralOfChiElectronicDt();
138      RealType instTemp = thermo.getElectronicTemperature();
139  
140    cerr << "why are we here?\n";
140  
141      for (mol = info_->beginMolecule(i); mol != NULL;
142           mol = info_->nextMolecule(i)) {
# Line 149 | Line 148 | namespace OpenMD {
148          cfrc = atom->getFlucQFrc();
149          cmass = atom->getChargeMass();
150          
151 <        // velocity half step
152 <        cvel += dt2_ *PhysicalConstants::energyConvert/cmass*cfrc - dt2_*chi*cvel;                    
151 >        cerr << atom->getType() << "\n";
152 >        cerr << "Before\n";
153 >        cerr << "cvel: " << cvel << "\tcpos: " << cpos << "\tcfrc: " << cfrc << "\tcmass: " << cmass << "\n";
154 >        
155 >        // velocity half step
156 >        cvel += dt2_ * cfrc / cmass - dt2_*chi*cvel;                    
157          // position whole step
158          cpos += dt_ * cvel;
159 <        
159 >        
160 >        cerr << "After\n";
161 >        cerr << "cvel: " << cvel << "\tcpos: " << cpos << "\n\n";        
162 >
163          atom->setFlucQVel(cvel);
164          atom->setFlucQPos(cpos);
165        }
# Line 163 | Line 169 | namespace OpenMD {
169        (tauThermostat_ * tauThermostat_);
170  
171      integralOfChidt += chi * dt2_;
172 +    cerr << "Move A instTemp: " << instTemp << "\n";
173      currentSnapshot_->setChiElectronic(chi);
174      currentSnapshot_->setIntegralOfChiElectronicDt(integralOfChidt);
175        
# Line 203 | Line 210 | namespace OpenMD {
210      for(int k = 0; k < maxIterNum_; k++) {
211        index = 0;
212        instTemp = thermo.getElectronicTemperature();
213 <
213 >      cerr << "MoveB instTemp: " << instTemp << "\n";
214        // evolve chi another half step using the temperature at t + dt/2
215        prevChi = chi;
216        chi = oldChi + dt2_ * (instTemp / targetTemp_ - 1.0) /
# Line 219 | Line 226 | namespace OpenMD {
226            cmass = atom->getChargeMass();
227            
228            // velocity half step
229 <          cvel = oldVel_[index] + dt2_/cmass*PhysicalConstants::energyConvert * cfrc - dt2_*chi*oldVel_[index];
229 >          cvel = oldVel_[index] + dt2_ * cfrc / cmass - dt2_*chi*oldVel_[index];
230            
231            atom->setFlucQVel(cvel);      
232            ++index;          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines