--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/08/27 19:23:29 733 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2003/09/15 16:52:02 763 @@ -153,11 +153,14 @@ template void Integrator::integrate(voi double sampleTime = info->sampleTime; double statusTime = info->statusTime; double thermalTime = info->thermalTime; + double resetTime = info->resetTime; + double currSample; double currThermal; double currStatus; - + double currReset; + int calcPot, calcStress; int isError; @@ -179,17 +182,12 @@ template void Integrator::integrate(voi thermalize(); } - calcPot = 0; - calcStress = 0; - currSample = sampleTime; - currThermal = thermalTime; - currStatus = statusTime; - calcPot = 0; calcStress = 0; currSample = sampleTime + info->getTime(); currThermal = thermalTime+ info->getTime(); currStatus = statusTime + info->getTime(); + currReset = resetTime + info->getTime(); dumpOut->writeDump(info->getTime()); statOut->writeStat(info->getTime()); @@ -229,6 +227,13 @@ template void Integrator::integrate(voi calcStress = 0; currStatus += statusTime; } + + if (info->resetIntegrator){ + if (info->getTime() >= currReset){ + this->resetIntegrator(); + currReset += resetTime; + } + } #ifdef IS_MPI strcpy(checkPointMsg, "successfully took a time step."); @@ -351,7 +356,6 @@ template void Integrator::moveA(void){ // rotate about the x-axis angle = dt2 * ji[0] / I[0][0]; this->rotate(1, 2, angle, ji, A); - dAtom->setJ(ji); dAtom->setA(A); @@ -749,3 +753,7 @@ template void Integrator::thermalize(){ template void Integrator::thermalize(){ tStats->velocitize(); } + +template double Integrator::getConservedQuantity(void){ + return tStats->getTotalE(); +} \ No newline at end of file