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

Comparing trunk/src/integrators/VelocityVerletIntegrator.cpp (file contents):
Revision 770 by tim, Fri Dec 2 15:38:03 2005 UTC vs.
Revision 1029 by chrisfen, Thu Aug 31 22:34:49 2006 UTC

# Line 67 | Line 67 | namespace oopse {
67      
68      forceMan_->init();
69      
70 <    // remove center of mass drift velocity (in case we passed in a configuration
71 <    // that was drifting
70 >    // remove center of mass drift velocity (in case we passed in a
71 >    // configuration that was drifting)
72      velocitizer_->removeComDrift();
73      
74      // initialize the forces before the first step
75      calcForce(true, true);
76      
77 <    //execute constraint algorithm to make sure at the very beginning the system is constrained  
77 >    // execute the constraint algorithm to make sure that the system is
78 >    // constrained at the very beginning  
79      if (info_->getNGlobalConstraints() > 0) {
80        rattle->constraintA();
81        calcForce(true, true);
82 <      rattle->constraintB();        
83 <      info_->getSnapshotManager()->advance();//copy the current snapshot to previous snapshot
82 >      rattle->constraintB();      
83 >      //copy the current snapshot to previous snapshot
84 >      info_->getSnapshotManager()->advance();
85      }
86      
87      if (needVelocityScaling) {
# Line 89 | Line 91 | namespace oopse {
91      dumpWriter = createDumpWriter();
92      
93      statWriter = createStatWriter();
94 <    
94 >
95 >    dumpWriter->writeDumpAndEor();
96 >
97      if (simParams->getUseSolidThermInt()) {
98        restWriter = createRestWriter();
99 <      restWriter->writeZangle();
99 >      restWriter->writeZAngFile();
100      }
101      
98    dumpWriter->writeDumpAndEor();
99    
100    
102      //save statistics, before writeStat,  we must save statistics
103      thermo.saveStat();
104      saveConservedQuantity();
# Line 135 | Line 136 | namespace oopse {
136  
137  
138    void VelocityVerletIntegrator::preStep() {
139 <    double difference = currentSnapshot_->getTime() + dt - currStatus;
139 >    RealType difference = currentSnapshot_->getTime() + dt - currStatus;
140    
141      if (difference > 0 || fabs(difference) < oopse::epsilon) {
142        needPotential = true;
143        needStress = true;  
144      }
144
145    }
146  
147    void VelocityVerletIntegrator::postStep() {
# Line 151 | Line 151 | namespace oopse {
151    
152      //increase time
153      currentSnapshot_->increaseTime(dt);        
154 <  
154 >  
155      if (needVelocityScaling) {
156        if (currentSnapshot_->getTime() >= currThermal) {
157          velocitizer_->velocitize(targetScalingTemp);
158          currThermal += thermalTime;
159        }
160      }
161 <  
161 >
162      if (currentSnapshot_->getTime() >= currSample) {
163        dumpWriter->writeDumpAndEor();
164 <    
164 >
165        if (simParams->getUseSolidThermInt())
166 <        restWriter->writeZangle();
166 >        restWriter->writeZAngFile();
167      
168        currSample += sampleTime;
169      }
170 <  
170 >
171      if (currentSnapshot_->getTime() >= currStatus) {
172        //save statistics, before writeStat,  we must save statistics
173        thermo.saveStat();
# Line 191 | Line 191 | namespace oopse {
191      dumpWriter->writeEor();
192    
193      if (simParams->getUseSolidThermInt()) {
194 <      restWriter->writeZangle();
194 >      restWriter->writeZAngFile();
195        delete restWriter;
196        restWriter = NULL;
197      }
# Line 232 | Line 232 | namespace oopse {
232        mask.set(Stats::VHARM);
233      }
234  
235 <    if (simParams->havePrintPressureTensor() && simParams->getPrintPressureTensor()){
235 >    if (simParams->havePrintPressureTensor() &&
236 >        simParams->getPrintPressureTensor()){
237          mask.set(Stats::PRESSURE_TENSOR_X);
238          mask.set(Stats::PRESSURE_TENSOR_Y);
239          mask.set(Stats::PRESSURE_TENSOR_Z);
240      }
241      
242 +    if (simParams->getAccumulateBoxDipole()) {
243 +      mask.set(Stats::BOX_DIPOLE_X);
244 +      mask.set(Stats::BOX_DIPOLE_Y);
245 +      mask.set(Stats::BOX_DIPOLE_Z);
246 +    }
247 +
248       return new StatWriter(info_->getStatFileName(), mask);
249    }
250  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines