--- trunk/OOPSE/libmdtools/ForceFields.cpp 2003/03/27 20:12:15 423 +++ trunk/OOPSE/libmdtools/ForceFields.cpp 2003/04/07 21:16:35 472 @@ -15,12 +15,13 @@ 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 - entry_plug->rCut = 2.5 bigSigma; + entry_plug->rCut = 2.5 * bigSigma; if(entry_plug->rCut > (entry_plug->box_x / 2.0)) entry_plug->rCut = entry_plug->box_x / 2.0; if(entry_plug->rCut > (entry_plug->box_y / 2.0)) @@ -40,20 +41,38 @@ void ForceFields::doForces( int calcPot, int calcStres double* trq; double* tau; double* A; - double* u_l; + double* u_l;; + DirectionalAtom* dAtom; + double ut[3]; + + //u_l = new double[entry_plug->n_atoms]; + short int passedCalcPot = (short int)calcPot; short int passedCalcStress = (short int)calcStress; // forces are zeroed here, before any are acumulated. // NOTE: do not rezero the forces in Fortran. + for(i=0; in_atoms; i++){ entry_plug->atoms[i]->zeroForces(); + +// if( entry_plug->atoms[i]->isDirectional() ){ +// dAtom = (DirectionalAtom *)entry_plug->atoms[i]; +// dAtom->getU(ut); + + +// if(dAtom->getIndex()== 1){ +// std::cerr << "atom 2's u_l = " << ut[0] << ", " << ut[1] +// << ", " << ut[2] << "\n"; +// } +// } + } for(i=0; in_mol; i++ ){ - entry_plug->molecules[i]->calc_forces(); + entry_plug->molecules[i].calcForces(); } frc = Atom::getFrcArray(); @@ -61,12 +80,17 @@ 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; + tau[0] = 0.0; + tau[1] = 0.0; + tau[2] = 0.0; + + fortranForceLoop( pos, A, @@ -80,6 +104,8 @@ void ForceFields::doForces( int calcPot, int calcStres &isError ); + // delete[] u_l; + if( isError ){ sprintf( painCave.errMsg, "Error returned from the fortran force calculation.\n" );