--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/03/27 19:21:42 422 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/03/27 23:33:40 432 @@ -88,9 +88,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(); + 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, @@ -241,8 +239,6 @@ void SimSetup::createSim( void ){ globalIndex = mpiSim->divideLabor(); - - // set up the local variables @@ -337,8 +333,12 @@ void SimSetup::createSim( void ){ if( simnfo->n_SRI ){ + + std::cerr << "n_SRI = " << simnfo->n_SRI << "\n"; + Exclude::createArray(simnfo->n_SRI); the_excludes = new Exclude*[simnfo->n_SRI]; + for( int ex=0; exn_SRI; ex++) the_excludes[ex] = new Exclude(ex); simnfo->globalExcludes = new int; simnfo->n_exclude = tot_SRI; } @@ -356,6 +356,7 @@ void SimSetup::createSim( void ){ // set the arrays into the SimInfo object simnfo->atoms = the_atoms; + simnfo->molecules = the_molecules; simnfo->nGlobalExcludes = 0; simnfo->excludes = the_excludes; @@ -654,15 +655,16 @@ void SimSetup::createSim( void ){ // new AllLong( simnfo ); - if( !strcmp( force_field, "TraPPE" ) ) new Verlet( *simnfo, the_ff ); - if( !strcmp( force_field, "DipoleTest" ) ) new Symplectic( simnfo, the_ff ); if( !strcmp( force_field, "TraPPE_Ex" ) ) new Symplectic( simnfo, the_ff ); if( !strcmp( force_field, "LJ" ) ) new Verlet( *simnfo, the_ff ); - +#ifdef IS_MPI + mpiSim->mpiRefresh(); +#endif // initialize the Fortran - + + simnfo->refreshSim(); if( !strcmp( simnfo->mixingRule, "standard") ){ @@ -699,14 +701,21 @@ void SimSetup::makeMolecules( void ){ BondStamp* currentBond; BendStamp* currentBend; TorsionStamp* currentTorsion; + + bond_pair* theBonds; + bend_set* theBends; + torsion_set* theTorsions; + //init the forceField paramters the_ff->readParams(); - // init the molecules + // init the atoms + double ux, uy, uz, u, uSqr; + atomOffset = 0; excludeOffset = 0; for(i=0; in_mol; i++){ @@ -723,7 +732,7 @@ void SimSetup::makeMolecules( void ){ info.myExcludes = &the_excludes[excludeOffset]; info.myBonds = new Bond*[info.nBonds]; info.myBends = new Bend*[info.nBends]; - info.myTorsions = new Torsions*[info.nTorsions]; + info.myTorsions = new Torsion*[info.nTorsions]; theBonds = new bond_pair[info.nBonds]; theBends = new bend_set[info.nBends]; @@ -733,7 +742,7 @@ void SimSetup::makeMolecules( void ){ for(j=0; jgetAtom( j ); + currentAtom = comp_stamps[stampID]->getAtom( j ); if( currentAtom->haveOrientation() ){ dAtom = new DirectionalAtom(j + atomOffset); @@ -806,7 +815,7 @@ void SimSetup::makeMolecules( void ){ if( currentBend->haveExtras() ){ - extras = current_bend->getExtras(); + extras = currentBend->getExtras(); current_extra = extras; while( current_extra != NULL ){ @@ -923,6 +932,9 @@ void SimSetup::makeMolecules( void ){ the_molecules[i].initialize( info ); atomOffset += info.nAtoms; + delete[] theBonds; + delete[] theBends; + delete[] theTorsions; } // clean up the forcefield