--- trunk/OOPSE/libmdtools/ForceFields.cpp 2003/03/27 21:07:14 428 +++ trunk/OOPSE/libmdtools/ForceFields.cpp 2003/06/20 20:29:36 561 @@ -1,8 +1,12 @@ +#include + +using namespace std; + + #include #ifdef IS_MPI #include -#include #endif // is_mpi @@ -16,7 +20,8 @@ void ForceFields::calcRcut( void ){ #ifdef IS_MPI double tempBig = bigSigma; - MPI::COMM_WORLD.Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX ); + MPI_Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX, + MPI_COMM_WORLD); #endif //is_mpi //calc rCut and rList @@ -39,18 +44,18 @@ void ForceFields::doForces( int calcPot, int calcStres double* frc; double* pos; double* trq; - double* tau; double* A; - double* u_l; + double* u_l;; + DirectionalAtom* dAtom; short int passedCalcPot = (short int)calcPot; short int passedCalcStress = (short int)calcStress; - // forces are zeroed here, before any are acumulated. + // forces are zeroed here, before any are accumulated. // NOTE: do not rezero the forces in Fortran. for(i=0; in_atoms; i++){ - entry_plug->atoms[i]->zeroForces(); + entry_plug->atoms[i]->zeroForces(); } for(i=0; in_mol; i++ ){ @@ -62,25 +67,25 @@ void ForceFields::doForces( int calcPot, int calcStres trq = Atom::getTrqArray(); A = Atom::getAmatArray(); u_l = Atom::getUlArray(); - tau = entry_plug->tau; - isError = 0; entry_plug->lrPot = 0.0; - + for (i=0; i<9; i++) { + entry_plug->tau[i] = 0.0; + } + fortranForceLoop( pos, A, u_l, frc, trq, - tau, + entry_plug->tau, &(entry_plug->lrPot), &passedCalcPot, &passedCalcStress, &isError ); - if( isError ){ sprintf( painCave.errMsg, "Error returned from the fortran force calculation.\n" );