| 6 |
|
#include "parse_me.h" |
| 7 |
|
#include "LRI.hpp" |
| 8 |
|
#include "Integrator.hpp" |
| 9 |
+ |
#include "simError.h" |
| 10 |
|
|
| 11 |
|
#ifdef IS_MPI |
| 12 |
|
#include "mpiBASS.h" |
| 20 |
|
#ifdef IS_MPI |
| 21 |
|
strcpy( checkPointMsg, "SimSetup creation successful" ); |
| 22 |
|
MPIcheckPoint(); |
| 23 |
< |
#endif IS_MPI |
| 23 |
> |
#endif // IS_MPI |
| 24 |
|
} |
| 25 |
|
|
| 26 |
|
SimSetup::~SimSetup(){ |
| 46 |
|
#ifdef IS_MPI |
| 47 |
|
throwMPIEvent(NULL); |
| 48 |
|
} |
| 49 |
< |
else recieveParse(); |
| 49 |
> |
else receiveParse(); |
| 50 |
|
#endif |
| 51 |
|
|
| 52 |
|
} |
| 68 |
|
delete dumpMe; |
| 69 |
|
} |
| 70 |
|
#endif |
| 71 |
+ |
|
| 72 |
|
void SimSetup::createSim( void ){ |
| 73 |
|
|
| 74 |
|
MakeStamps *the_stamps; |
| 93 |
|
else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); |
| 94 |
|
else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); |
| 95 |
|
else{ |
| 96 |
< |
std::cerr<< "SimSetup Error. Unrecognized force field -> " |
| 97 |
< |
<< force_field << "\n"; |
| 98 |
< |
exit(8); |
| 96 |
> |
sprintf( painCave.errMsg, |
| 97 |
> |
"SimSetup Error. Unrecognized force field -> %s\n", |
| 98 |
> |
force_field ); |
| 99 |
> |
painCave.isFatal = 1; |
| 100 |
> |
simError(); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
+ |
#ifdef IS_MPI |
| 104 |
+ |
strcpy( checkPointMsg, "ForceField creation successful" ); |
| 105 |
+ |
MPIcheckPoint(); |
| 106 |
+ |
#endif // is_mpi |
| 107 |
+ |
|
| 108 |
|
// get the components and calculate the tot_nMol and indvidual n_mol |
| 109 |
|
the_components = the_globals->getComponents(); |
| 110 |
|
components_nmol = new int[n_components]; |
| 179 |
|
|
| 180 |
|
// create the atom and short range interaction arrays |
| 181 |
|
|
| 173 |
– |
the_atoms = new Atom*[tot_atoms]; |
| 182 |
|
Atom::createArrays(tot_atoms); |
| 183 |
+ |
the_atoms = new Atom*[tot_atoms]; |
| 184 |
|
the_molecules = new Molecule[tot_nmol]; |
| 185 |
|
|
| 186 |
|
|
| 280 |
|
// else{ |
| 281 |
|
|
| 282 |
|
initFromBass(); |
| 274 |
– |
|
| 275 |
– |
|
| 276 |
– |
// } |
| 277 |
– |
|
| 278 |
– |
// if( the_globals->haveFinalConfig() ){ |
| 279 |
– |
// strcpy( simnfo->finalName, the_globals->getFinalConfig() ); |
| 280 |
– |
// } |
| 281 |
– |
// else{ |
| 282 |
– |
// strcpy( simnfo->finalName, inFileName ); |
| 283 |
– |
// char* endTest; |
| 284 |
– |
// int nameLength = strlen( simnfo->finalName ); |
| 285 |
– |
// endTest = &(simnfo->finalName[nameLength - 5]); |
| 286 |
– |
// if( !strcmp( endTest, ".bass" ) ){ |
| 287 |
– |
// strcpy( endTest, ".eor" ); |
| 288 |
– |
// } |
| 289 |
– |
// else if( !strcmp( endTest, ".BASS" ) ){ |
| 290 |
– |
// strcpy( endTest, ".eor" ); |
| 291 |
– |
// } |
| 292 |
– |
// else{ |
| 293 |
– |
// endTest = &(simnfo->finalName[nameLength - 4]); |
| 294 |
– |
// if( !strcmp( endTest, ".bss" ) ){ |
| 295 |
– |
// strcpy( endTest, ".eor" ); |
| 296 |
– |
// } |
| 297 |
– |
// else if( !strcmp( endTest, ".mdl" ) ){ |
| 298 |
– |
// strcpy( endTest, ".eor" ); |
| 299 |
– |
// } |
| 300 |
– |
// else{ |
| 301 |
– |
// strcat( simnfo->finalName, ".eor" ); |
| 302 |
– |
// } |
| 303 |
– |
// } |
| 304 |
– |
// } |
| 283 |
|
|
| 306 |
– |
// // make the sample and status out names |
| 284 |
|
|
| 308 |
– |
// strcpy( simnfo->sampleName, inFileName ); |
| 309 |
– |
// char* endTest; |
| 310 |
– |
// int nameLength = strlen( simnfo->sampleName ); |
| 311 |
– |
// endTest = &(simnfo->sampleName[nameLength - 5]); |
| 312 |
– |
// if( !strcmp( endTest, ".bass" ) ){ |
| 313 |
– |
// strcpy( endTest, ".dump" ); |
| 314 |
– |
// } |
| 315 |
– |
// else if( !strcmp( endTest, ".BASS" ) ){ |
| 316 |
– |
// strcpy( endTest, ".dump" ); |
| 317 |
– |
// } |
| 318 |
– |
// else{ |
| 319 |
– |
// endTest = &(simnfo->sampleName[nameLength - 4]); |
| 320 |
– |
// if( !strcmp( endTest, ".bss" ) ){ |
| 321 |
– |
// strcpy( endTest, ".dump" ); |
| 322 |
– |
// } |
| 323 |
– |
// else if( !strcmp( endTest, ".mdl" ) ){ |
| 324 |
– |
// strcpy( endTest, ".dump" ); |
| 325 |
– |
// } |
| 326 |
– |
// else{ |
| 327 |
– |
// strcat( simnfo->sampleName, ".dump" ); |
| 328 |
– |
// } |
| 329 |
– |
// } |
| 330 |
– |
|
| 331 |
– |
// strcpy( simnfo->statusName, inFileName ); |
| 332 |
– |
// nameLength = strlen( simnfo->statusName ); |
| 333 |
– |
// endTest = &(simnfo->statusName[nameLength - 5]); |
| 334 |
– |
// if( !strcmp( endTest, ".bass" ) ){ |
| 335 |
– |
// strcpy( endTest, ".stat" ); |
| 336 |
– |
// } |
| 337 |
– |
// else if( !strcmp( endTest, ".BASS" ) ){ |
| 338 |
– |
// strcpy( endTest, ".stat" ); |
| 339 |
– |
// } |
| 340 |
– |
// else{ |
| 341 |
– |
// endTest = &(simnfo->statusName[nameLength - 4]); |
| 342 |
– |
// if( !strcmp( endTest, ".bss" ) ){ |
| 343 |
– |
// strcpy( endTest, ".stat" ); |
| 344 |
– |
// } |
| 345 |
– |
// else if( !strcmp( endTest, ".mdl" ) ){ |
| 346 |
– |
// strcpy( endTest, ".stat" ); |
| 347 |
– |
// } |
| 348 |
– |
// else{ |
| 349 |
– |
// strcat( simnfo->statusName, ".stat" ); |
| 350 |
– |
// } |
| 285 |
|
// } |
| 286 |
|
|
| 287 |
+ |
#ifdef IS_MPI |
| 288 |
+ |
if( worldRank == TESTWRITE ){ |
| 289 |
+ |
#endif // is_mpi |
| 290 |
+ |
|
| 291 |
+ |
fprintf( stderr, |
| 292 |
+ |
"infile name is \"%s\"\n", |
| 293 |
+ |
inFileName ); |
| 294 |
+ |
|
| 295 |
+ |
inFileName = "./butane.bass"; |
| 296 |
+ |
|
| 297 |
+ |
if( the_globals->haveFinalConfig() ){ |
| 298 |
+ |
strcpy( simnfo->finalName, the_globals->getFinalConfig() ); |
| 299 |
+ |
} |
| 300 |
+ |
else{ |
| 301 |
+ |
strcpy( simnfo->finalName, inFileName ); |
| 302 |
+ |
char* endTest; |
| 303 |
+ |
int nameLength = strlen( simnfo->finalName ); |
| 304 |
+ |
endTest = &(simnfo->finalName[nameLength - 5]); |
| 305 |
+ |
if( !strcmp( endTest, ".bass" ) ){ |
| 306 |
+ |
strcpy( endTest, ".eor" ); |
| 307 |
+ |
} |
| 308 |
+ |
else if( !strcmp( endTest, ".BASS" ) ){ |
| 309 |
+ |
strcpy( endTest, ".eor" ); |
| 310 |
+ |
} |
| 311 |
+ |
else{ |
| 312 |
+ |
endTest = &(simnfo->finalName[nameLength - 4]); |
| 313 |
+ |
if( !strcmp( endTest, ".bss" ) ){ |
| 314 |
+ |
strcpy( endTest, ".eor" ); |
| 315 |
+ |
} |
| 316 |
+ |
else if( !strcmp( endTest, ".mdl" ) ){ |
| 317 |
+ |
strcpy( endTest, ".eor" ); |
| 318 |
+ |
} |
| 319 |
+ |
else{ |
| 320 |
+ |
strcat( simnfo->finalName, ".eor" ); |
| 321 |
+ |
} |
| 322 |
+ |
} |
| 323 |
+ |
} |
| 324 |
+ |
|
| 325 |
+ |
// make the sample and status out names |
| 326 |
+ |
|
| 327 |
+ |
strcpy( simnfo->sampleName, inFileName ); |
| 328 |
+ |
char* endTest; |
| 329 |
+ |
int nameLength = strlen( simnfo->sampleName ); |
| 330 |
+ |
endTest = &(simnfo->sampleName[nameLength - 5]); |
| 331 |
+ |
if( !strcmp( endTest, ".bass" ) ){ |
| 332 |
+ |
strcpy( endTest, ".dump" ); |
| 333 |
+ |
} |
| 334 |
+ |
else if( !strcmp( endTest, ".BASS" ) ){ |
| 335 |
+ |
strcpy( endTest, ".dump" ); |
| 336 |
+ |
} |
| 337 |
+ |
else{ |
| 338 |
+ |
endTest = &(simnfo->sampleName[nameLength - 4]); |
| 339 |
+ |
if( !strcmp( endTest, ".bss" ) ){ |
| 340 |
+ |
strcpy( endTest, ".dump" ); |
| 341 |
+ |
} |
| 342 |
+ |
else if( !strcmp( endTest, ".mdl" ) ){ |
| 343 |
+ |
strcpy( endTest, ".dump" ); |
| 344 |
+ |
} |
| 345 |
+ |
else{ |
| 346 |
+ |
strcat( simnfo->sampleName, ".dump" ); |
| 347 |
+ |
} |
| 348 |
+ |
} |
| 349 |
+ |
|
| 350 |
+ |
strcpy( simnfo->statusName, inFileName ); |
| 351 |
+ |
nameLength = strlen( simnfo->statusName ); |
| 352 |
+ |
endTest = &(simnfo->statusName[nameLength - 5]); |
| 353 |
+ |
if( !strcmp( endTest, ".bass" ) ){ |
| 354 |
+ |
strcpy( endTest, ".stat" ); |
| 355 |
+ |
} |
| 356 |
+ |
else if( !strcmp( endTest, ".BASS" ) ){ |
| 357 |
+ |
strcpy( endTest, ".stat" ); |
| 358 |
+ |
} |
| 359 |
+ |
else{ |
| 360 |
+ |
endTest = &(simnfo->statusName[nameLength - 4]); |
| 361 |
+ |
if( !strcmp( endTest, ".bss" ) ){ |
| 362 |
+ |
strcpy( endTest, ".stat" ); |
| 363 |
+ |
} |
| 364 |
+ |
else if( !strcmp( endTest, ".mdl" ) ){ |
| 365 |
+ |
strcpy( endTest, ".stat" ); |
| 366 |
+ |
} |
| 367 |
+ |
else{ |
| 368 |
+ |
strcat( simnfo->statusName, ".stat" ); |
| 369 |
+ |
} |
| 370 |
+ |
} |
| 371 |
+ |
|
| 372 |
+ |
#ifdef IS_MPI |
| 373 |
+ |
} |
| 374 |
+ |
#endif // is_mpi |
| 375 |
|
|
| 376 |
|
// set the status, sample, and themal kick times |
| 377 |
|
|