| 1 |
< |
#include <cstdlib> |
| 2 |
< |
#include <cstdio> |
| 3 |
< |
#include <cstring> |
| 1 |
> |
#include <stdlib.h> |
| 2 |
> |
#include <stdio.h> |
| 3 |
> |
#include <string.h> |
| 4 |
|
|
| 5 |
|
#include <iostream> |
| 6 |
|
using namespace std; |
| 123 |
|
char* ffPath_env = "FORCE_PARAM_PATH"; |
| 124 |
|
char* ffPath; |
| 125 |
|
char temp[200]; |
| 126 |
– |
char errMsg[1000]; |
| 126 |
|
|
| 127 |
|
headAtomType = NULL; |
| 128 |
|
currentAtomType = NULL; |
| 162 |
|
// generate the force file name |
| 163 |
|
|
| 164 |
|
strcpy( fileName, "LJFF.frc" ); |
| 165 |
< |
fprintf( stderr,"Trying to open %s\n", fileName ); |
| 165 |
> |
// fprintf( stderr,"Trying to open %s\n", fileName ); |
| 166 |
|
|
| 167 |
|
// attempt to open the file in the current directory first. |
| 168 |
|
|
| 186 |
|
frcFile = fopen( fileName, "r" ); |
| 187 |
|
|
| 188 |
|
if( frcFile == NULL ){ |
| 189 |
< |
|
| 189 |
> |
|
| 190 |
|
sprintf( painCave.errMsg, |
| 191 |
< |
"Error opening the force field parameter file: %s\n" |
| 192 |
< |
"Have you tried setting the FORCE_PARAM_PATH environment " |
| 193 |
< |
"vairable?\n", |
| 191 |
> |
"Error opening the force field parameter file:\n" |
| 192 |
> |
"\t%s\n" |
| 193 |
> |
"\tHave you tried setting the FORCE_PARAM_PATH environment " |
| 194 |
> |
"variable?\n", |
| 195 |
|
fileName ); |
| 196 |
+ |
painCave.severity = OOPSE_ERROR; |
| 197 |
|
painCave.isFatal = 1; |
| 198 |
|
simError(); |
| 199 |
|
} |
| 250 |
|
info.last = 1; // initialize last to have the last set. |
| 251 |
|
// if things go well, last will be set to 0 |
| 252 |
|
|
| 252 |
– |
int i; |
| 253 |
|
int identNum; |
| 254 |
|
|
| 255 |
|
|
| 333 |
|
MPIcheckPoint(); |
| 334 |
|
|
| 335 |
|
headAtomType = new LinkedAtomType; |
| 336 |
< |
recieveFrcStruct( &info, mpiAtomStructType ); |
| 336 |
> |
receiveFrcStruct( &info, mpiAtomStructType ); |
| 337 |
|
|
| 338 |
|
while( !info.last ){ |
| 339 |
|
|
| 343 |
|
|
| 344 |
|
MPIcheckPoint(); |
| 345 |
|
|
| 346 |
< |
recieveFrcStruct( &info, mpiAtomStructType ); |
| 346 |
> |
receiveFrcStruct( &info, mpiAtomStructType ); |
| 347 |
|
} |
| 348 |
|
} |
| 349 |
|
#endif // is_mpi |
| 357 |
|
int isDipole = 0; |
| 358 |
|
int isSSD = 0; |
| 359 |
|
int isGB = 0; |
| 360 |
+ |
int isEAM = 0; |
| 361 |
+ |
int isCharge = 0; |
| 362 |
+ |
double charge = 0.0; |
| 363 |
|
double dipole = 0.0; |
| 364 |
|
|
| 365 |
|
currentAtomType = headAtomType; |
| 372 |
|
&isSSD, |
| 373 |
|
&isDipole, |
| 374 |
|
&isGB, |
| 375 |
+ |
&isEAM, |
| 376 |
+ |
&isCharge, |
| 377 |
|
&(currentAtomType->epslon), |
| 378 |
|
&(currentAtomType->sigma), |
| 379 |
+ |
&charge, |
| 380 |
|
&dipole, |
| 381 |
|
&isError ); |
| 382 |
|
if( isError ){ |
| 408 |
|
// initialize the atoms |
| 409 |
|
|
| 410 |
|
|
| 405 |
– |
Atom* thisAtom; |
| 406 |
– |
|
| 411 |
|
for( i=0; i<nAtoms; i++ ){ |
| 412 |
|
|
| 413 |
|
currentAtomType = headAtomType->find( the_atoms[i]->getType() ); |
| 420 |
|
} |
| 421 |
|
|
| 422 |
|
the_atoms[i]->setMass( currentAtomType->mass ); |
| 419 |
– |
the_atoms[i]->setEpslon( currentAtomType->epslon ); |
| 420 |
– |
the_atoms[i]->setSigma( currentAtomType->sigma ); |
| 423 |
|
the_atoms[i]->setIdent( currentAtomType->ident ); |
| 422 |
– |
the_atoms[i]->setLJ(); |
| 424 |
|
|
| 425 |
|
if( bigSigma < currentAtomType->sigma ) bigSigma = currentAtomType->sigma; |
| 426 |
|
} |