168 |
|
|
169 |
|
headAtomType = NULL; |
170 |
|
currentAtomType = NULL; |
171 |
+ |
|
172 |
+ |
// Set eamRcut to 0.0 |
173 |
+ |
eamRcut = 0.0; |
174 |
|
|
175 |
|
// do the funtion wrapping |
176 |
|
wrapMeFF( this ); |
269 |
|
|
270 |
|
|
271 |
|
void EAM_FF::calcRcut( void ){ |
272 |
< |
double tempEamRcut; |
273 |
< |
|
272 |
> |
|
273 |
> |
#ifdef IS_MPI |
274 |
> |
double tempEamRcut = eamRcut; |
275 |
> |
MPI_Allreduce( &tempEamRcut, &eamRcut, 1, MPI_DOUBLE, MPI_MAX, |
276 |
> |
MPI_COMM_WORLD); |
277 |
> |
#endif //is_mpi |
278 |
|
entry_plug->setRcut(eamRcut); |
279 |
|
} |
280 |
|
|
485 |
|
} |
486 |
|
|
487 |
|
entry_plug->useLJ = 0; |
488 |
< |
|
488 |
> |
entry_plug->useEAM = 1; |
489 |
|
// Walk down again and send out EAM type |
490 |
|
currentAtomType = headAtomType->next; |
491 |
|
while( currentAtomType != NULL ){ |
492 |
|
|
493 |
|
if( currentAtomType->name[0] != '\0' ){ |
494 |
|
isError = 0; |
495 |
< |
cerr << "Calling newEAMtype for type "<<currentAtomType->eam_ident <<"\n"; |
495 |
> |
|
496 |
|
newEAMtype( &(currentAtomType->lattice_constant), |
497 |
|
&(currentAtomType->eam_nrho), |
498 |
|
&(currentAtomType->eam_drho), |
504 |
|
currentAtomType->eam_Frhovals, |
505 |
|
&(currentAtomType->eam_ident), |
506 |
|
&isError); |
507 |
< |
cerr << "Returned from newEAMtype\n"; |
507 |
> |
|
508 |
|
if( isError ){ |
509 |
|
sprintf( painCave.errMsg, |
510 |
|
"Error initializing the \"%s\" atom type in fortran EAM\n", |
524 |
|
MPIcheckPoint(); |
525 |
|
#endif // is_mpi |
526 |
|
|
520 |
– |
cerr << "Done sending eamtypes to fortran\n"; |
527 |
|
|
528 |
+ |
|
529 |
|
} |
530 |
|
|
531 |
|
|
532 |
|
void EAM_FF::initializeAtoms( int nAtoms, Atom** the_atoms ){ |
533 |
|
|
534 |
|
int i; |
535 |
< |
|
535 |
> |
|
536 |
|
// initialize the atoms |
537 |
|
|
538 |
|
|
552 |
|
the_atoms[i]->setMass( currentAtomType->mass ); |
553 |
|
the_atoms[i]->setIdent( currentAtomType->ident ); |
554 |
|
the_atoms[i]->setEAM(); |
555 |
+ |
the_atoms[i]->setEamRcut( currentAtomType->eam_rcut); |
556 |
|
|
557 |
+ |
if (eamRcut < currentAtomType->eam_rcut) eamRcut = currentAtomType->eam_rcut; |
558 |
+ |
|
559 |
|
} |
560 |
|
} |
561 |
|
|
1023 |
|
myEam_rhovals[j+0] = atof( the_token ); |
1024 |
|
|
1025 |
|
// Value 2 |
1026 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
1026 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1027 |
|
sprintf( painCave.errMsg, |
1028 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1029 |
|
painCave.isFatal = 1; |
1033 |
|
myEam_rhovals[j+1] = atof( the_token ); |
1034 |
|
|
1035 |
|
// Value 3 |
1036 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
1036 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1037 |
|
sprintf( painCave.errMsg, |
1038 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1039 |
|
painCave.isFatal = 1; |
1043 |
|
myEam_rhovals[j+2] = atof( the_token ); |
1044 |
|
|
1045 |
|
// Value 4 |
1046 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
1046 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1047 |
|
sprintf( painCave.errMsg, |
1048 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1049 |
|
painCave.isFatal = 1; |
1053 |
|
myEam_rhovals[j+3] = atof( the_token ); |
1054 |
|
|
1055 |
|
// Value 5 |
1056 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
1056 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1057 |
|
sprintf( painCave.errMsg, |
1058 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1059 |
|
painCave.isFatal = 1; |
1061 |
|
} |
1062 |
|
|
1063 |
|
myEam_rhovals[j+4] = atof( the_token ); |
1064 |
< |
|
1064 |
> |
|
1065 |
|
} |
1066 |
|
*eam_rvals = myEam_rvals; |
1067 |
|
*eam_rhovals = myEam_rhovals; |