--- trunk/mdtools/interface_implementation/SimSetup.cpp 2002/12/19 21:59:51 215 +++ trunk/mdtools/interface_implementation/SimSetup.cpp 2003/01/30 15:20:21 253 @@ -189,7 +189,7 @@ void SimSetup::createSim( void ){ if( currentStamp == NULL ){ sprintf( painCave.errMsg, "SimSetup error: Component \"%s\" was not found in the " - "list of declared molecules\n" + "list of declared molecules\n", id ); painCave.isFatal = 1; simError(); @@ -238,7 +238,7 @@ void SimSetup::createSim( void ){ mpiSim = new mpiSimulation( simnfo ); - mpiSim->divideLabor(); + globalIndex = mpiSim->divideLabor(); // set up the local variables @@ -313,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 ){ @@ -406,7 +387,29 @@ void SimSetup::createSim( void ){ #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; @@ -560,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, "TraPPE" ) ) new Verlet( *simnfo, the_ff ); 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 ){ @@ -640,6 +645,12 @@ void SimSetup::makeAtoms( void ){ } } +#ifdef IS_MPI + for( i=0; igetMyNlocal(); i++ ) the_atoms[i]->setGlobalIndex( globalIndex[i] ); + + delete[] globalIndex; +#endif IS_MPI + the_ff->initializeAtoms(); } @@ -652,7 +663,7 @@ void SimSetup::makeBonds( void ){ the_bonds = new bond_pair[tot_bonds]; index = 0; offset = 0; - molIndex = 0;g1 + molIndex = 0; for( i=0; i