| 75 |
|
|
| 76 |
|
void add( atomStruct &info, double *the_eam_rvals, |
| 77 |
|
double *the_eam_rhovals,double *the_eam_Frhovals ){ |
| 78 |
– |
|
| 79 |
– |
int i; |
| 78 |
|
|
| 79 |
|
// check for duplicates |
| 80 |
|
|
| 162 |
|
char* ffPath_env = "FORCE_PARAM_PATH"; |
| 163 |
|
char* ffPath; |
| 164 |
|
char temp[200]; |
| 167 |
– |
char errMsg[1000]; |
| 165 |
|
|
| 166 |
|
headAtomType = NULL; |
| 167 |
|
currentAtomType = NULL; |
| 302 |
|
info.last = 1; // initialize last to have the last set. |
| 303 |
|
// if things go well, last will be set to 0 |
| 304 |
|
|
| 308 |
– |
int i; |
| 305 |
|
int identNum; |
| 306 |
|
double *eam_rvals; // Z of r values |
| 307 |
|
double *eam_rhovals; // rho of r values |
| 531 |
|
|
| 532 |
|
// initialize the atoms |
| 533 |
|
|
| 538 |
– |
|
| 539 |
– |
Atom* thisAtom; |
| 540 |
– |
|
| 534 |
|
for( i=0; i<nAtoms; i++ ){ |
| 535 |
|
|
| 536 |
|
currentAtomType = headAtomType->find( the_atoms[i]->getType() ); |
| 1016 |
|
myEam_rhovals[j+0] = atof( the_token ); |
| 1017 |
|
|
| 1018 |
|
// Value 2 |
| 1019 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
| 1019 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
| 1020 |
|
sprintf( painCave.errMsg, |
| 1021 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
| 1022 |
|
painCave.isFatal = 1; |
| 1026 |
|
myEam_rhovals[j+1] = atof( the_token ); |
| 1027 |
|
|
| 1028 |
|
// Value 3 |
| 1029 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
| 1029 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
| 1030 |
|
sprintf( painCave.errMsg, |
| 1031 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
| 1032 |
|
painCave.isFatal = 1; |
| 1036 |
|
myEam_rhovals[j+2] = atof( the_token ); |
| 1037 |
|
|
| 1038 |
|
// Value 4 |
| 1039 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
| 1039 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
| 1040 |
|
sprintf( painCave.errMsg, |
| 1041 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
| 1042 |
|
painCave.isFatal = 1; |
| 1046 |
|
myEam_rhovals[j+3] = atof( the_token ); |
| 1047 |
|
|
| 1048 |
|
// Value 5 |
| 1049 |
< |
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
| 1049 |
> |
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
| 1050 |
|
sprintf( painCave.errMsg, |
| 1051 |
|
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
| 1052 |
|
painCave.isFatal = 1; |
| 1054 |
|
} |
| 1055 |
|
|
| 1056 |
|
myEam_rhovals[j+4] = atof( the_token ); |
| 1057 |
< |
|
| 1057 |
> |
|
| 1058 |
|
} |
| 1059 |
|
*eam_rvals = myEam_rvals; |
| 1060 |
|
*eam_rhovals = myEam_rhovals; |