--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/08/26 20:29:26 725 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2003/09/17 14:22:15 768 @@ -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; @@ -174,24 +177,17 @@ template void Integrator::integrate(voi // initialize the forces before the first step calcForce(1, 1); - // myFF->doForces(1,1); - + if (info->setTemp){ 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(); ->>>>>>> 1.18 + currReset = resetTime + info->getTime(); dumpOut->writeDump(info->getTime()); statOut->writeStat(info->getTime()); @@ -232,6 +228,13 @@ template void Integrator::integrate(voi currStatus += statusTime; } + if (info->resetIntegrator){ + if (info->getTime() >= currReset){ + this->resetIntegrator(); + currReset += resetTime; + } + } + #ifdef IS_MPI strcpy(checkPointMsg, "successfully took a time step."); MPIcheckPoint(); @@ -251,11 +254,9 @@ template void Integrator::integrateStep moveA(); - if (nConstrained){ - constrainA(); - } + #ifdef IS_MPI strcpy(checkPointMsg, "Succesful moveA\n"); MPIcheckPoint(); @@ -276,10 +277,8 @@ template void Integrator::integrateStep moveB(); - if (nConstrained){ - constrainB(); - } + #ifdef IS_MPI strcpy(checkPointMsg, "Succesful moveB\n"); MPIcheckPoint(); @@ -354,10 +353,13 @@ template void Integrator::moveA(void){ angle = dt2 * ji[0] / I[0][0]; this->rotate(1, 2, angle, ji, A); - dAtom->setJ(ji); dAtom->setA(A); } + } + + if (nConstrained){ + constrainA(); } } @@ -399,6 +401,10 @@ template void Integrator::moveB(void){ dAtom->setJ(ji); } + } + + if (nConstrained){ + constrainB(); } } @@ -558,6 +564,7 @@ template void Integrator::constrainA(){ painCave.isFatal = 1; simError(); } + } template void Integrator::constrainB(void){ @@ -751,3 +758,7 @@ template void Integrator::thermalize(){ template void Integrator::thermalize(){ tStats->velocitize(); } + +template double Integrator::getConservedQuantity(void){ + return tStats->getTotalE(); +}