--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/07/21 21:27:40 643 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2003/08/22 20:04:39 711 @@ -11,7 +11,7 @@ #include "simError.h" -Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ){ +template Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ) { info = theInfo; myFF = the_ff; @@ -41,7 +41,7 @@ Integrator::Integrator( SimInfo *theInfo, ForceFields* checkConstraints(); } -Integrator::~Integrator() { +template Integrator::~Integrator() { if( nConstrained ){ delete[] constrainedA; @@ -54,7 +54,7 @@ Integrator::~Integrator() { } -void Integrator::checkConstraints( void ){ +template void Integrator::checkConstraints( void ){ isConstrained = 0; @@ -155,7 +155,7 @@ void Integrator::checkConstraints( void ){ } -void Integrator::integrate( void ){ +template void Integrator::integrate( void ){ int i, j; // loop counters @@ -183,18 +183,19 @@ void Integrator::integrate( void ){ // initialize the forces before the first step - myFF->doForces(1,1); - + calcForce(1, 1); + // myFF->doForces(1,1); + if( info->setTemp ){ - tStats->velocitize(); + thermalize(); } calcPot = 0; calcStress = 0; - currSample = sampleTime; - currThermal = thermalTime; - currStatus = statusTime; + currSample = sampleTime + info->getTime(); + currThermal = thermalTime+ info->getTime(); + currStatus = statusTime + info->getTime(); dumpOut->writeDump( info->getTime() ); statOut->writeStat( info->getTime() ); @@ -220,7 +221,7 @@ void Integrator::integrate( void ){ if( info->setTemp ){ if( info->getTime() >= currThermal ){ - tStats->velocitize(); + thermalize(); currThermal += thermalTime; } } @@ -251,7 +252,7 @@ void Integrator::integrate( void ){ delete statOut; } -void Integrator::integrateStep( int calcPot, int calcStress ){ +template void Integrator::integrateStep( int calcPot, int calcStress ){ @@ -270,7 +271,7 @@ void Integrator::integrateStep( int calcPot, int calcS // calc forces - myFF->doForces(calcPot,calcStress); + calcForce(calcPot,calcStress); #ifdef IS_MPI strcpy( checkPointMsg, "Succesful doForces\n" ); @@ -292,7 +293,7 @@ void Integrator::integrateStep( int calcPot, int calcS } -void Integrator::moveA( void ){ +template void Integrator::moveA( void ){ int i, j; DirectionalAtom* dAtom; @@ -371,7 +372,7 @@ void Integrator::moveA( void ){ } -void Integrator::moveB( void ){ +template void Integrator::moveB( void ){ int i, j; DirectionalAtom* dAtom; double Tb[3], ji[3]; @@ -413,7 +414,7 @@ void Integrator::moveB( void ){ } } -void Integrator::preMove( void ){ +template void Integrator::preMove( void ){ int i, j; double pos[3]; @@ -431,7 +432,7 @@ void Integrator::preMove( void ){ } } -void Integrator::constrainA(){ +template void Integrator::constrainA(){ int i,j,k; int done; @@ -582,7 +583,7 @@ void Integrator::constrainA(){ } -void Integrator::constrainB( void ){ +template void Integrator::constrainB( void ){ int i,j,k; int done; @@ -691,7 +692,7 @@ void Integrator::constrainB( void ){ } -void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], +template void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], double A[3][3] ){ int i,j,k; @@ -772,3 +773,12 @@ void Integrator::rotate( int axes1, int axes2, double } } } + +template void Integrator::calcForce( int calcPot, int calcStress ){ + myFF->doForces(calcPot,calcStress); + +} + +template void Integrator::thermalize(){ + tStats->velocitize(); +}