--- trunk/OOPSE/libmdtools/EAM_FF.cpp 2003/07/30 21:17:01 657 +++ trunk/OOPSE/libmdtools/EAM_FF.cpp 2003/08/07 00:47:33 669 @@ -168,6 +168,9 @@ EAM_FF::EAM_FF(){ headAtomType = NULL; currentAtomType = NULL; + + // Set eamRcut to 0.0 + eamRcut = 0.0; // do the funtion wrapping wrapMeFF( this ); @@ -266,8 +269,12 @@ void EAM_FF::calcRcut( void ){ void EAM_FF::calcRcut( void ){ - double tempEamRcut; - + + #ifdef IS_MPI + double tempEamRcut = eamRcut; + MPI_Allreduce( &tempEamRcut, &eamRcut, 1, MPI_DOUBLE, MPI_MAX, + MPI_COMM_WORLD); +#endif //is_mpi entry_plug->setRcut(eamRcut); } @@ -478,14 +485,14 @@ void EAM_FF::readParams( void ){ } entry_plug->useLJ = 0; - + entry_plug->useEAM = 1; // Walk down again and send out EAM type currentAtomType = headAtomType->next; while( currentAtomType != NULL ){ if( currentAtomType->name[0] != '\0' ){ isError = 0; - cerr << "Calling newEAMtype for type "<eam_ident <<"\n"; + newEAMtype( &(currentAtomType->lattice_constant), &(currentAtomType->eam_nrho), &(currentAtomType->eam_drho), @@ -497,7 +504,7 @@ void EAM_FF::readParams( void ){ currentAtomType->eam_Frhovals, &(currentAtomType->eam_ident), &isError); - cerr << "Returned from newEAMtype\n"; + if( isError ){ sprintf( painCave.errMsg, "Error initializing the \"%s\" atom type in fortran EAM\n", @@ -517,15 +524,15 @@ void EAM_FF::readParams( void ){ MPIcheckPoint(); #endif // is_mpi - cerr << "Done sending eamtypes to fortran\n"; + } void EAM_FF::initializeAtoms( int nAtoms, Atom** the_atoms ){ int i; - + // initialize the atoms @@ -545,7 +552,10 @@ void EAM_FF::initializeAtoms( int nAtoms, Atom** the_a the_atoms[i]->setMass( currentAtomType->mass ); the_atoms[i]->setIdent( currentAtomType->ident ); the_atoms[i]->setEAM(); + the_atoms[i]->setEamRcut( currentAtomType->eam_rcut); + if (eamRcut < currentAtomType->eam_rcut) eamRcut = currentAtomType->eam_rcut; + } }