--- trunk/OOPSE/libmdtools/ForceFields.cpp 2003/07/02 21:26:55 572 +++ trunk/OOPSE/libmdtools/ForceFields.cpp 2003/10/29 20:41:39 843 @@ -3,7 +3,7 @@ using namespace std; using namespace std; -#include +#include #ifdef IS_MPI #include @@ -26,16 +26,8 @@ void ForceFields::calcRcut( void ){ //calc rCut and rList - entry_plug->rCut = 2.5 * bigSigma; - if(entry_plug->rCut > (entry_plug->boxLx / 2.0)) - entry_plug->rCut = entry_plug->boxLx / 2.0; - if(entry_plug->rCut > (entry_plug->boxLy / 2.0)) - entry_plug->rCut = entry_plug->boxLy / 2.0; - if(entry_plug->rCut > (entry_plug->boxLz / 2.0)) - entry_plug->rCut = entry_plug->boxLz / 2.0; - - entry_plug->rList = entry_plug->rCut + 1.0; - + entry_plug->setDefaultRcut( 2.5 * bigSigma ); + } void ForceFields::doForces( int calcPot, int calcStress ){ @@ -46,7 +38,7 @@ void ForceFields::doForces( int calcPot, int calcStres double* trq; double* A; double* u_l;; - DirectionalAtom* dAtom; + SimState* config; short int passedCalcPot = (short int)calcPot; short int passedCalcStress = (short int)calcStress; @@ -62,11 +54,13 @@ void ForceFields::doForces( int calcPot, int calcStres entry_plug->molecules[i].calcForces(); } - frc = Atom::getFrcArray(); - pos = Atom::getPosArray(); - trq = Atom::getTrqArray(); - A = Atom::getAmatArray(); - u_l = Atom::getUlArray(); + config = entry_plug->getConfiguration(); + + frc = config->getFrcArray(); + pos = config->getPosArray(); + trq = config->getTrqArray(); + A = config->getAmatArray(); + u_l = config->getUlArray(); isError = 0; entry_plug->lrPot = 0.0; @@ -75,6 +69,7 @@ void ForceFields::doForces( int calcPot, int calcStres entry_plug->tau[i] = 0.0; } + fortranForceLoop( pos, A, u_l, @@ -86,6 +81,8 @@ void ForceFields::doForces( int calcPot, int calcStres &passedCalcStress, &isError ); + + if( isError ){ sprintf( painCave.errMsg, "Error returned from the fortran force calculation.\n" ); @@ -98,6 +95,7 @@ void ForceFields::doForces( int calcPot, int calcStres "returned from the force calculation.\n" ); MPIcheckPoint(); #endif // is_mpi + }