--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/04/08 21:35:49 481 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/04/11 18:46:37 491 @@ -67,7 +67,7 @@ void SimSetup::createSim( void ){ MakeStamps *the_stamps; Globals* the_globals; ExtendedSystem* the_extendedsystem; - int i, j; + int i, j, k, globalAtomIndex; // get the stamps and globals; the_stamps = stamps; @@ -298,16 +298,15 @@ void SimSetup::createSim( void ){ simnfo->n_torsions = tot_torsions; simnfo->n_SRI = tot_SRI; simnfo->n_mol = tot_nmol; - + simnfo->molMembershipArray = new int[tot_atoms]; + #ifdef IS_MPI // divide the molecules among processors here. mpiSim = new mpiSimulation( simnfo ); - - globalIndex = mpiSim->divideLabor(); // set up the local variables @@ -324,11 +323,14 @@ void SimSetup::createSim( void ){ local_bonds = 0; local_bends = 0; local_torsions = 0; + globalAtomIndex = 0; + + for( i=0; igetNAtoms(); local_bonds += comp_stamps[i]->getNBonds(); @@ -336,12 +338,16 @@ void SimSetup::createSim( void ){ local_torsions += comp_stamps[i]->getNTorsions(); localMol++; } - allMol++; + for (k = 0; k < comp_stamps[i]->getNAtoms(); k++) { + simnfo->molMembershipArray[globalAtomIndex] = allMol; + globalAtomIndex++; + } + + allMol++; } } local_SRI = local_bonds + local_bends + local_torsions; - simnfo->n_atoms = mpiSim->getMyNlocal(); if( local_atoms != simnfo->n_atoms ){ @@ -385,6 +391,7 @@ void SimSetup::createSim( void ){ if(mol2proc[i] == worldRank ){ the_molecules[molIndex].setStampID( molCompType[i] ); the_molecules[molIndex].setMyIndex( molIndex ); + the_molecules[molIndex].setGlobalIndex( i ); molIndex++; } } @@ -392,10 +399,16 @@ void SimSetup::createSim( void ){ #else // is_mpi molIndex = 0; + globalAtomIndex = 0; for(i=0; igetNAtoms(); k++) { + simnfo->molMembershipArray[globalAtomIndex] = molIndex; + globalAtomIndex++; + } molIndex++; } } @@ -728,13 +741,9 @@ void SimSetup::createSim( void ){ if( !strcmp( force_field, "TraPPE_Ex" ) ){ new Symplectic(simnfo, the_ff, the_extendedsystem); - std::cerr << "called new Symplecic\n"; - fprintf( stderr, "called new Symplectic. stderr\n" ); } else if( !strcmp( force_field, "LJ" ) ){ new Verlet( *simnfo, the_ff, the_extendedsystem ); - std::cerr << "called new Verlet\n"; - fprintf( stderr, "called new Verlet. stderr\n" ); } else { std::cerr << "I'm a bug.\n";