--- trunk/mdtools/interface_implementation/SimSetup.cpp 2002/12/12 21:21:59 206 +++ trunk/mdtools/interface_implementation/SimSetup.cpp 2003/01/27 19:28:21 248 @@ -10,6 +10,7 @@ #ifdef IS_MPI #include "mpiBASS.h" +#include "mpiSimulation.hpp" #include "bassDiag.hpp" #endif @@ -92,6 +93,7 @@ void SimSetup::createSim( void ){ if( !strcmp( force_field, "TraPPE" ) ) the_ff = new TraPPEFF(); else if( !strcmp( force_field, "DipoleTest" ) ) the_ff = new DipoleTestFF(); else if( !strcmp( force_field, "TraPPE_Ex" ) ) the_ff = new TraPPE_ExFF(); + else if( !strcmp( force_field, "LJ" ) ) the_ff = new LJ_FF(); else{ sprintf( painCave.errMsg, "SimSetup Error. Unrecognized force field -> %s\n", @@ -234,7 +236,7 @@ void SimSetup::createSim( void ){ // divide the molecules among processors here. - mpiSimulation* mpiSim = new mpiSimulation( simnfo ); + mpiSim = new mpiSimulation( simnfo ); mpiSim->divideLabor(); @@ -311,27 +313,8 @@ void SimSetup::createSim( void ){ simnfo->sr_interactions = the_sris; simnfo->n_exclude = tot_SRI; simnfo->excludes = the_excludes; - - - // initialize the arrays - - the_ff->setSimInfo( simnfo ); - - makeAtoms(); - - if( tot_bonds ){ - makeBonds(); - } - - if( tot_bends ){ - makeBends(); - } - if( tot_torsions ){ - makeTorsions(); - } - // get some of the tricky things that may still be in the globals if( simnfo->n_dipoles ){ @@ -402,9 +385,31 @@ void SimSetup::createSim( void ){ strcpy( checkPointMsg, "Box size set up" ); MPIcheckPoint(); #endif // is_mpi + + + // initialize the arrays + + the_ff->setSimInfo( simnfo ); + + makeAtoms(); + + if( tot_bonds ){ + makeBonds(); + } + + if( tot_bends ){ + makeBends(); + } + if( tot_torsions ){ + makeTorsions(); + } + + + + if( the_globals->haveInitialConfig() ){ InitializeFromFile* fileInit; @@ -558,13 +563,15 @@ void SimSetup::createSim( void ){ if( the_globals->haveTempSet() ) simnfo->setTemp = the_globals->getTempSet(); - // make the longe range forces and the integrator +// // make the longe range forces and the integrator - new AllLong( simnfo ); +// new AllLong( simnfo ); if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo ); if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo ); if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo ); + if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff ); + } void SimSetup::makeAtoms( void ){ @@ -583,8 +590,8 @@ void SimSetup::makeAtoms( void ){ for( j=0; jmpiSim->getMyMolStart() <= molIndex && - molIndex <= simnfo->mpiSim->getMyMolEnd() ){ + if( mpiSim->getMyMolStart() <= molIndex && + molIndex <= mpiSim->getMyMolEnd() ){ #endif // is_mpi molStart = index; @@ -650,14 +657,15 @@ void SimSetup::makeBonds( void ){ the_bonds = new bond_pair[tot_bonds]; index = 0; offset = 0; - molIndex = 0; + molIndex = 0;g1 + for( i=0; impiSim->getMyMolStart() <= molIndex && - molIndex <= simnfo->mpiSim->getMyMolEnd() ){ + if( mpiSim->getMyMolStart() <= molIndex && + molIndex <= mpiSim->getMyMolEnd() ){ #endif // is_mpi for( k=0; kgetNBonds(); k++ ){ @@ -700,8 +708,8 @@ void SimSetup::makeBends( void ){ for( j=0; jmpiSim->getMyMolStart() <= molIndex && - molIndex <= simnfo->mpiSim->getMyMolEnd() ){ + if( mpiSim->getMyMolStart() <= molIndex && + molIndex <= mpiSim->getMyMolEnd() ){ #endif // is_mpi for( k=0; kgetNBends(); k++ ){ @@ -745,8 +753,8 @@ void SimSetup::makeTorsions( void ){ for( j=0; jmpiSim->getMyMolStart() <= molIndex && - molIndex <= simnfo->mpiSim->getMyMolEnd() ){ + if( mpiSim->getMyMolStart() <= molIndex && + molIndex <= mpiSim->getMyMolEnd() ){ #endif // is_mpi for( k=0; kgetNTorsions(); k++ ){