80 |
|
|
81 |
|
if( !strcmp( info.name, name ) ){ |
82 |
|
sprintf( painCave.errMsg, |
83 |
< |
"Duplicate LJ atom type \"%s\" found in " |
84 |
< |
"the LJ_FF param file./n", |
83 |
> |
"Duplicate EAM atom type \"%s\" found in " |
84 |
> |
"the EAM_FF param file./n", |
85 |
|
name ); |
86 |
|
painCave.isFatal = 1; |
87 |
|
simError(); |
155 |
|
// begins the actual forcefield stuff. |
156 |
|
//**************************************************************** |
157 |
|
|
158 |
+ |
EAM_FF::EAM_FF() { |
159 |
+ |
EAM_FF(""); |
160 |
+ |
} |
161 |
|
|
162 |
< |
EAM_FF::EAM_FF(){ |
162 |
> |
EAM_FF::EAM_FF(char* the_variant){ |
163 |
|
|
164 |
|
char fileName[200]; |
165 |
|
char* ffPath_env = "FORCE_PARAM_PATH"; |
204 |
|
if( worldRank == 0 ){ |
205 |
|
#endif |
206 |
|
|
207 |
< |
// generate the force file name |
208 |
< |
|
209 |
< |
strcpy( fileName, "EAM_FF.frc" ); |
210 |
< |
// fprintf( stderr,"Trying to open %s\n", fileName ); |
207 |
> |
// generate the force file name |
208 |
> |
|
209 |
> |
strcpy( fileName, "EAM" ); |
210 |
> |
|
211 |
> |
if (strlen(the_variant) > 0) { |
212 |
> |
has_variant = 1; |
213 |
> |
strcpy( variant, the_variant); |
214 |
> |
strcat( fileName, "."); |
215 |
> |
strcat( fileName, variant ); |
216 |
> |
|
217 |
> |
sprintf( painCave.errMsg, |
218 |
> |
"Using %s variant of EAM force field.\n", |
219 |
> |
variant ); |
220 |
> |
painCave.severity = OOPSE_INFO; |
221 |
> |
painCave.isFatal = 0; |
222 |
> |
simError(); |
223 |
> |
} |
224 |
> |
strcat( fileName, ".frc"); |
225 |
> |
|
226 |
> |
//fprintf( stderr,"Trying to open %s\n", fileName ); |
227 |
|
|
228 |
|
// attempt to open the file in the current directory first. |
229 |
|
|
247 |
|
frcFile = fopen( fileName, "r" ); |
248 |
|
|
249 |
|
if( frcFile == NULL ){ |
250 |
< |
|
250 |
> |
|
251 |
|
sprintf( painCave.errMsg, |
252 |
< |
"Error opening the force field parameter file: %s\n" |
253 |
< |
"Have you tried setting the FORCE_PARAM_PATH environment " |
254 |
< |
"vairable?\n", |
252 |
> |
"Error opening the force field parameter file:\n" |
253 |
> |
"\t%s\n" |
254 |
> |
"\tHave you tried setting the FORCE_PARAM_PATH environment " |
255 |
> |
"variable?\n", |
256 |
|
fileName ); |
257 |
+ |
painCave.severity = OOPSE_ERROR; |
258 |
|
painCave.isFatal = 1; |
259 |
|
simError(); |
260 |
|
} |
261 |
|
} |
262 |
+ |
|
263 |
|
|
264 |
|
#ifdef IS_MPI |
265 |
|
} |
289 |
|
|
290 |
|
void EAM_FF::calcRcut( void ){ |
291 |
|
|
292 |
< |
#ifdef IS_MPI |
292 |
> |
#ifdef IS_MPI |
293 |
|
double tempEamRcut = eamRcut; |
294 |
|
MPI_Allreduce( &tempEamRcut, &eamRcut, 1, MPI_DOUBLE, MPI_MAX, |
295 |
|
MPI_COMM_WORLD); |
296 |
|
#endif //is_mpi |
297 |
< |
entry_plug->setRcut(eamRcut); |
297 |
> |
entry_plug->setDefaultRcut(eamRcut); |
298 |
|
} |
299 |
|
|
300 |
|
|
339 |
|
// read in the atom types. |
340 |
|
|
341 |
|
headAtomType = new LinkedAtomType; |
342 |
< |
|
342 |
> |
|
343 |
|
fastForward( "AtomTypes", "eam atom readParams" ); |
344 |
|
|
345 |
|
// we are now at the AtomTypes section. |
429 |
|
MPIcheckPoint(); |
430 |
|
|
431 |
|
headAtomType = new LinkedAtomType; |
432 |
< |
recieveFrcStruct( &info, mpiAtomStructType ); |
432 |
> |
receiveFrcStruct( &info, mpiAtomStructType ); |
433 |
|
|
434 |
|
while( !info.last ){ |
435 |
|
|
455 |
|
|
456 |
|
MPIcheckPoint(); |
457 |
|
|
458 |
< |
recieveFrcStruct( &info, mpiAtomStructType ); |
458 |
> |
receiveFrcStruct( &info, mpiAtomStructType ); |
459 |
|
|
460 |
|
|
461 |
|
} |
471 |
|
int isDipole = 0; |
472 |
|
int isSSD = 0; |
473 |
|
int isGB = 0; |
474 |
< |
int isEAM= 1; |
474 |
> |
int isEAM = 1; |
475 |
> |
int isCharge = 0; |
476 |
|
double dipole = 0.0; |
477 |
+ |
double charge = 0.0; |
478 |
|
double eamSigma = 0.0; |
479 |
|
double eamEpslon = 0.0; |
480 |
|
|
489 |
|
&isDipole, |
490 |
|
&isGB, |
491 |
|
&isEAM, |
492 |
+ |
&isCharge, |
493 |
|
&eamEpslon, |
494 |
|
&eamSigma, |
495 |
+ |
&charge, |
496 |
|
&dipole, |
497 |
|
&isError ); |
498 |
|
if( isError ){ |
570 |
|
|
571 |
|
the_atoms[i]->setMass( currentAtomType->mass ); |
572 |
|
the_atoms[i]->setIdent( currentAtomType->ident ); |
547 |
– |
the_atoms[i]->setEAM(); |
548 |
– |
the_atoms[i]->setEamRcut( currentAtomType->eam_rcut); |
573 |
|
|
574 |
|
if (eamRcut < currentAtomType->eam_rcut) eamRcut = currentAtomType->eam_rcut; |
575 |
< |
|
575 |
> |
|
576 |
|
} |
577 |
|
} |
578 |
|
|
749 |
|
sprintf( painCave.errMsg, |
750 |
|
"Error opening the EAM force parameter file: %s\n" |
751 |
|
"Have you tried setting the FORCE_PARAM_PATH environment " |
752 |
< |
"vairable?\n", |
752 |
> |
"variable?\n", |
753 |
|
eamPotFile ); |
754 |
|
painCave.isFatal = 1; |
755 |
|
simError(); |
783 |
|
|
784 |
|
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
785 |
|
sprintf( painCave.errMsg, |
786 |
< |
"Error parseing EAM ident line in %s\n", eamPotFile ); |
786 |
> |
"Error parsing EAM ident line in %s\n", eamPotFile ); |
787 |
|
painCave.isFatal = 1; |
788 |
|
simError(); |
789 |
|
} |
792 |
|
|
793 |
|
if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
794 |
|
sprintf( painCave.errMsg, |
795 |
< |
"Error parseing EAM mass in %s\n", eamPotFile ); |
795 |
> |
"Error parsing EAM mass in %s\n", eamPotFile ); |
796 |
|
painCave.isFatal = 1; |
797 |
|
simError(); |
798 |
|
} |
800 |
|
|
801 |
|
if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
802 |
|
sprintf( painCave.errMsg, |
803 |
< |
"Error parseing EAM Lattice Constant %s\n", eamPotFile ); |
803 |
> |
"Error parsing EAM Lattice Constant %s\n", eamPotFile ); |
804 |
|
painCave.isFatal = 1; |
805 |
|
simError(); |
806 |
|
} |
826 |
|
|
827 |
|
if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
828 |
|
sprintf( painCave.errMsg, |
829 |
< |
"Error parseing EAM drho in %s\n", eamPotFile ); |
829 |
> |
"Error parsing EAM drho in %s\n", eamPotFile ); |
830 |
|
painCave.isFatal = 1; |
831 |
|
simError(); |
832 |
|
} |
834 |
|
|
835 |
|
if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
836 |
|
sprintf( painCave.errMsg, |
837 |
< |
"Error parseing EAM # r in %s\n", eamPotFile ); |
837 |
> |
"Error parsing EAM # r in %s\n", eamPotFile ); |
838 |
|
painCave.isFatal = 1; |
839 |
|
simError(); |
840 |
|
} |
842 |
|
|
843 |
|
if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
844 |
|
sprintf( painCave.errMsg, |
845 |
< |
"Error parseing EAM dr in %s\n", eamPotFile ); |
845 |
> |
"Error parsing EAM dr in %s\n", eamPotFile ); |
846 |
|
painCave.isFatal = 1; |
847 |
|
simError(); |
848 |
|
} |
850 |
|
|
851 |
|
if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ |
852 |
|
sprintf( painCave.errMsg, |
853 |
< |
"Error parseing EAM rcut in %s\n", eamPotFile ); |
853 |
> |
"Error parsing EAM rcut in %s\n", eamPotFile ); |
854 |
|
painCave.isFatal = 1; |
855 |
|
simError(); |
856 |
|
} |
891 |
|
// Value 1 |
892 |
|
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
893 |
|
sprintf( painCave.errMsg, |
894 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
894 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
895 |
|
painCave.isFatal = 1; |
896 |
|
simError(); |
897 |
|
} |
901 |
|
// Value 2 |
902 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
903 |
|
sprintf( painCave.errMsg, |
904 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
904 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
905 |
|
painCave.isFatal = 1; |
906 |
|
simError(); |
907 |
|
} |
911 |
|
// Value 3 |
912 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
913 |
|
sprintf( painCave.errMsg, |
914 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
914 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
915 |
|
painCave.isFatal = 1; |
916 |
|
simError(); |
917 |
|
} |
921 |
|
// Value 4 |
922 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
923 |
|
sprintf( painCave.errMsg, |
924 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
924 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
925 |
|
painCave.isFatal = 1; |
926 |
|
simError(); |
927 |
|
} |
931 |
|
// Value 5 |
932 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
933 |
|
sprintf( painCave.errMsg, |
934 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
934 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
935 |
|
painCave.isFatal = 1; |
936 |
|
simError(); |
937 |
|
} |
962 |
|
// Value 1 |
963 |
|
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
964 |
|
sprintf( painCave.errMsg, |
965 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
965 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
966 |
|
painCave.isFatal = 1; |
967 |
|
simError(); |
968 |
|
} |
972 |
|
// Value 2 |
973 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
974 |
|
sprintf( painCave.errMsg, |
975 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
975 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
976 |
|
painCave.isFatal = 1; |
977 |
|
simError(); |
978 |
|
} |
982 |
|
// Value 3 |
983 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
984 |
|
sprintf( painCave.errMsg, |
985 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
985 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
986 |
|
painCave.isFatal = 1; |
987 |
|
simError(); |
988 |
|
} |
992 |
|
// Value 4 |
993 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
994 |
|
sprintf( painCave.errMsg, |
995 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
995 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
996 |
|
painCave.isFatal = 1; |
997 |
|
simError(); |
998 |
|
} |
1002 |
|
// Value 5 |
1003 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1004 |
|
sprintf( painCave.errMsg, |
1005 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1005 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
1006 |
|
painCave.isFatal = 1; |
1007 |
|
simError(); |
1008 |
|
} |
1032 |
|
// Value 1 |
1033 |
|
if ( (the_token = strtok( eam_read_buffer, " \n\t,;")) == NULL){ |
1034 |
|
sprintf( painCave.errMsg, |
1035 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1035 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
1036 |
|
painCave.isFatal = 1; |
1037 |
|
simError(); |
1038 |
|
} |
1042 |
|
// Value 2 |
1043 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1044 |
|
sprintf( painCave.errMsg, |
1045 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1045 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
1046 |
|
painCave.isFatal = 1; |
1047 |
|
simError(); |
1048 |
|
} |
1052 |
|
// Value 3 |
1053 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1054 |
|
sprintf( painCave.errMsg, |
1055 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1055 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
1056 |
|
painCave.isFatal = 1; |
1057 |
|
simError(); |
1058 |
|
} |
1062 |
|
// Value 4 |
1063 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1064 |
|
sprintf( painCave.errMsg, |
1065 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1065 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
1066 |
|
painCave.isFatal = 1; |
1067 |
|
simError(); |
1068 |
|
} |
1072 |
|
// Value 5 |
1073 |
|
if ( (the_token = strtok( NULL, " \n\t,;")) == NULL){ |
1074 |
|
sprintf( painCave.errMsg, |
1075 |
< |
"Error parseing EAM nrho: line in %s\n", eamPotFile ); |
1075 |
> |
"Error parsing EAM nrho: line in %s\n", eamPotFile ); |
1076 |
|
painCave.isFatal = 1; |
1077 |
|
simError(); |
1078 |
|
} |