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

Comparing branches/development/src/integrators/VelocityVerletIntegrator.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1723 by gezelter, Thu May 24 20:59:54 2012 UTC

# Line 54 | Line 54 | namespace OpenMD {
54   #include "utils/ProgressBar.hpp"
55  
56   namespace OpenMD {
57 <  VelocityVerletIntegrator::VelocityVerletIntegrator(SimInfo *info) : Integrator(info), rotAlgo(NULL) {
57 >  VelocityVerletIntegrator::VelocityVerletIntegrator(SimInfo *info) : Integrator(info) {
58      dt2 = 0.5 * dt;
59    rotAlgo = new DLM();
60    rattle = new Rattle(info);
59    }
60    
61    VelocityVerletIntegrator::~VelocityVerletIntegrator() {
64    delete rotAlgo;
65    delete rattle;
62    }
63    
64    void VelocityVerletIntegrator::initialize(){
# Line 72 | Line 68 | namespace OpenMD {
68      // remove center of mass drift velocity (in case we passed in a
69      // configuration that was drifting)
70      velocitizer_->removeComDrift();
71 +
72 +    // find the initial fluctuating charges.
73 +    flucQ_->initialize();
74      
75      // initialize the forces before the first step
76      calcForce();
# Line 79 | Line 78 | namespace OpenMD {
78      // execute the constraint algorithm to make sure that the system is
79      // constrained at the very beginning  
80      if (info_->getNGlobalConstraints() > 0) {
81 <      rattle->constraintA();
81 >      rattle_->constraintA();
82        calcForce();
83 <      rattle->constraintB();      
83 >      rattle_->constraintB();      
84        //copy the current snapshot to previous snapshot
85        info_->getSnapshotManager()->advance();
86      }
# Line 122 | Line 121 | namespace OpenMD {
121  
122    void VelocityVerletIntegrator::doIntegrate() {
123    
125  
124      initialize();
125    
126 <    while (currentSnapshot_->getTime() < runTime) {
127 <    
128 <      preStep();
129 <    
130 <      integrateStep();
133 <    
134 <      postStep();
135 <      
136 <    }
137 <  
126 >    while (currentSnapshot_->getTime() < runTime) {    
127 >      preStep();    
128 >      integrateStep();    
129 >      postStep();      
130 >    }  
131      finalize();
139  
132    }
133  
134  
# Line 211 | Line 203 | namespace OpenMD {
203    
204      dumpWriter = NULL;
205      statWriter = NULL;
214  
206    }
207  
208    void VelocityVerletIntegrator::integrateStep() {
# Line 224 | Line 215 | namespace OpenMD {
215  
216    void VelocityVerletIntegrator::calcForce() {
217      forceMan_->calcForces();
218 +    flucQ_->applyConstraints();
219    }
220  
221    DumpWriter* VelocityVerletIntegrator::createDumpWriter() {
# Line 266 | Line 258 | namespace OpenMD {
258        mask.set(Stats::BOX_DIPOLE_Y);
259        mask.set(Stats::BOX_DIPOLE_Z);
260      }
261 +
262 +    if (simParams->getPrintHeatFlux()) {
263 +      mask.set(Stats::HEATFLUX_X);
264 +      mask.set(Stats::HEATFLUX_Y);
265 +      mask.set(Stats::HEATFLUX_Z);
266 +    }
267    
268      if (simParams->haveTaggedAtomPair() && simParams->havePrintTaggedPairDistance()) {
269        if (simParams->getPrintTaggedPairDistance()) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines