43 |
|
} atomStruct; |
44 |
|
|
45 |
|
int parseAtom( char *lineBuffer, int lineNum, atomStruct &info, string eamPotFile ); |
46 |
< |
int parseEAM( atomStruct &info, string eamPotFile, double **eam_rvals, |
47 |
< |
double **eam_rhovals, double **eam_Frhovals); |
46 |
> |
int parseEAM( atomStruct &info, string ffPath, string eamPotFile, |
47 |
> |
double **eam_rvals, double **eam_rhovals, |
48 |
> |
double **eam_Frhovals); |
49 |
|
#ifdef IS_MPI |
50 |
|
|
51 |
|
MPI_Datatype mpiAtomStructType; |
69 |
|
if( eam_Frhovals != NULL ) delete[] eam_Frhovals; |
70 |
|
} |
71 |
|
|
72 |
< |
LinkedAtomType* find(char* key){ |
72 |
> |
LinkedAtomType* find(const char* key){ |
73 |
|
if( !strcmp(name, key) ) return this; |
74 |
|
if( next != NULL ) return next->find(key); |
75 |
|
return NULL; |
158 |
|
// begins the actual forcefield stuff. |
159 |
|
//**************************************************************** |
160 |
|
|
161 |
< |
EAM_FF::EAM_FF() { |
161 |
> |
EAM_FF::EAM_FF(){ |
162 |
|
EAM_FF(""); |
163 |
|
} |
164 |
|
|
165 |
< |
EAM_FF::EAM_FF(string the_variant){ |
165 |
> |
EAM_FF::EAM_FF(const string &the_variant) : ForceFields(the_variant) { |
166 |
|
|
167 |
|
string fileName; |
168 |
|
string tempString; |
358 |
|
|
359 |
|
// the parser returns 0 if the line was blank |
360 |
|
if( parseAtom( readLine, lineNum, info, eamPotFile ) ){ |
361 |
< |
parseEAM(info,eamPotFile, &eam_rvals, |
361 |
> |
parseEAM(info, ffPath, eamPotFile, &eam_rvals, |
362 |
|
&eam_rhovals, &eam_Frhovals); |
363 |
|
info.ident = identNum; |
364 |
|
headAtomType->add( info, eam_rvals, |
527 |
|
|
528 |
|
for( i=0; i<nAtoms; i++ ){ |
529 |
|
|
530 |
< |
currentAtomType = headAtomType->find( the_atoms[i]->getType() ); |
530 |
> |
currentAtomType = headAtomType->find(the_atoms[i]->getType().c_str() ); |
531 |
|
if( currentAtomType == NULL ){ |
532 |
|
sprintf( painCave.errMsg, |
533 |
|
"AtomType error, %s not found in force file.\n", |
534 |
< |
the_atoms[i]->getType() ); |
534 |
> |
the_atoms[i]->getType().c_str() ); |
535 |
|
painCave.isFatal = 1; |
536 |
|
simError(); |
537 |
|
} |
665 |
|
else return 0; |
666 |
|
} |
667 |
|
|
668 |
< |
int EAM_NS::parseEAM(atomStruct &info, string eamPotFile, |
668 |
> |
int EAM_NS::parseEAM(atomStruct &info, string ffPath, string eamPotFile, |
669 |
|
double **eam_rvals, |
670 |
|
double **eam_rhovals, |
671 |
|
double **eam_Frhovals){ |