| 10 |
|
|
| 11 |
|
#ifdef IS_MPI |
| 12 |
|
#include "mpiBASS.h" |
| 13 |
+ |
#include "mpiSimulation.hpp" |
| 14 |
|
#include "bassDiag.hpp" |
| 15 |
|
#endif |
| 16 |
|
|
| 93 |
|
if( !strcmp( force_field, "TraPPE" ) ) the_ff = new TraPPEFF(); |
| 94 |
|
else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); |
| 95 |
|
else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); |
| 96 |
+ |
else if( !strcmp( force_field, "LJ" ) ) the_ff = new LJ_FF(); |
| 97 |
|
else{ |
| 98 |
|
sprintf( painCave.errMsg, |
| 99 |
|
"SimSetup Error. Unrecognized force field -> %s\n", |
| 236 |
|
|
| 237 |
|
// divide the molecules among processors here. |
| 238 |
|
|
| 239 |
< |
mpiSimulation* mpiSim = new mpiSimulation( simnfo ); |
| 239 |
> |
mpiSim = new mpiSimulation( simnfo ); |
| 240 |
|
|
| 241 |
|
mpiSim->divideLabor(); |
| 242 |
|
|
| 407 |
|
|
| 408 |
|
|
| 409 |
|
|
| 410 |
< |
// if( the_globals->haveInitialConfig() ){ |
| 411 |
< |
// InitializeFromFile* fileInit; |
| 412 |
< |
// fileInit = new InitializeFromFile( the_globals->getInitialConfig() ); |
| 413 |
< |
|
| 414 |
< |
// fileInit->read_xyz( simnfo ); // default velocities on |
| 410 |
> |
if( the_globals->haveInitialConfig() ){ |
| 411 |
> |
|
| 412 |
> |
InitializeFromFile* fileInit; |
| 413 |
> |
#ifdef IS_MPI // is_mpi |
| 414 |
> |
if( worldRank == 0 ){ |
| 415 |
> |
#endif //is_mpi |
| 416 |
> |
fileInit = new InitializeFromFile( the_globals->getInitialConfig() ); |
| 417 |
> |
#ifdef IS_MPI |
| 418 |
> |
}else fileInit = new InitializeFromFile( NULL ); |
| 419 |
> |
#endif |
| 420 |
> |
fileInit->read_xyz( simnfo ); // default velocities on |
| 421 |
|
|
| 422 |
< |
// delete fileInit; |
| 423 |
< |
// } |
| 424 |
< |
// else{ |
| 422 |
> |
delete fileInit; |
| 423 |
> |
} |
| 424 |
> |
else{ |
| 425 |
|
|
| 426 |
|
#ifdef IS_MPI |
| 427 |
|
|
| 436 |
|
|
| 437 |
|
initFromBass(); |
| 438 |
|
|
| 439 |
< |
#endif // is_mpi |
| 440 |
< |
|
| 439 |
> |
|
| 440 |
> |
#endif |
| 441 |
> |
} |
| 442 |
> |
|
| 443 |
|
#ifdef IS_MPI |
| 444 |
|
strcpy( checkPointMsg, "Successfully read in the initial configuration" ); |
| 445 |
|
MPIcheckPoint(); |
| 449 |
|
|
| 450 |
|
|
| 451 |
|
|
| 452 |
< |
// } |
| 452 |
> |
|
| 453 |
|
|
| 454 |
|
#ifdef IS_MPI |
| 455 |
|
if( worldRank == 0 ){ |
| 585 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
| 586 |
|
|
| 587 |
|
#ifdef IS_MPI |
| 588 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
| 589 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
| 588 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
| 589 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
| 590 |
|
#endif // is_mpi |
| 591 |
|
|
| 592 |
|
molStart = index; |
| 652 |
|
the_bonds = new bond_pair[tot_bonds]; |
| 653 |
|
index = 0; |
| 654 |
|
offset = 0; |
| 655 |
< |
molIndex = 0; |
| 655 |
> |
molIndex = 0;g1 |
| 656 |
> |
|
| 657 |
|
for( i=0; i<n_components; i++ ){ |
| 658 |
|
|
| 659 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
| 660 |
|
|
| 661 |
|
#ifdef IS_MPI |
| 662 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
| 663 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
| 662 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
| 663 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
| 664 |
|
#endif // is_mpi |
| 665 |
|
|
| 666 |
|
for( k=0; k<comp_stamps[i]->getNBonds(); k++ ){ |
| 703 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
| 704 |
|
|
| 705 |
|
#ifdef IS_MPI |
| 706 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
| 707 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
| 706 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
| 707 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
| 708 |
|
#endif // is_mpi |
| 709 |
|
|
| 710 |
|
for( k=0; k<comp_stamps[i]->getNBends(); k++ ){ |
| 748 |
|
for( j=0; j<components_nmol[i]; j++ ){ |
| 749 |
|
|
| 750 |
|
#ifdef IS_MPI |
| 751 |
< |
if( simnfo->mpiSim->getMyMolStart() <= molIndex && |
| 752 |
< |
molIndex <= simnfo->mpiSim->getMyMolEnd() ){ |
| 751 |
> |
if( mpiSim->getMyMolStart() <= molIndex && |
| 752 |
> |
molIndex <= mpiSim->getMyMolEnd() ){ |
| 753 |
|
#endif // is_mpi |
| 754 |
|
|
| 755 |
|
for( k=0; k<comp_stamps[i]->getNTorsions(); k++ ){ |