--- branches/new_design/OOPSE-3.0/src/integrators/VelocityVerletIntegrator.cpp 2004/12/04 05:24:07 1847 +++ branches/new_design/OOPSE-3.0/src/integrators/VelocityVerletIntegrator.cpp 2004/12/08 17:03:50 1868 @@ -46,12 +46,6 @@ void VelocityVerletIntegrator::initialize(){ void VelocityVerletIntegrator::initialize(){ - currSample = 0.0; - currStatus = 0.0; - currThermal = 0.0; - needPotential = false; - needStress = false; - // remove center of mass drift velocity (in case we passed in a configuration // that was drifting velocitizer_->removeComDrift(); @@ -75,12 +69,16 @@ void VelocityVerletIntegrator::initialize(){ dumpWriter->writeDump(); - //save statistics + //save statistics, before writeStat, we must save statistics thermo.saveStat(); saveConservedQuantity(); - - //before writeStat, we must save statistics statWriter->writeStat(currentSnapshot_->statData); + + currSample = sampleTime + currentSnapshot_->getTime(); + currStatus = statusTime + currentSnapshot_->getTime();; + currThermal = thermalTime + + currentSnapshot_->getTime(); + needPotential = false; + needStress = false; } @@ -121,10 +119,6 @@ void VelocityVerletIntegrator::postStep() { //increase time currentSnapshot_->increaseTime(dt); - - //save statistics - thermo.saveStat(); - saveConservedQuantity(); if (needVelocityScaling) { if (currentSnapshot_->getTime() >= currThermal) { @@ -139,7 +133,11 @@ void VelocityVerletIntegrator::postStep() { } if (currentSnapshot_->getTime() >= currStatus) { + //save statistics, before writeStat, we must save statistics + thermo.saveStat(); + saveConservedQuantity(); statWriter->writeStat(currentSnapshot_->statData); + needPotential = false; needStress = false; currStatus += statusTime;