--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/03/27 19:21:42 422 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/03/27 20:48:37 427 @@ -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, @@ -654,8 +652,6 @@ 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 ); @@ -699,14 +695,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 +726,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 +736,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 +809,7 @@ void SimSetup::makeMolecules( void ){ if( currentBend->haveExtras() ){ - extras = current_bend->getExtras(); + extras = currentBend->getExtras(); current_extra = extras; while( current_extra != NULL ){ @@ -923,6 +926,9 @@ void SimSetup::makeMolecules( void ){ the_molecules[i].initialize( info ); atomOffset += info.nAtoms; + delete[] theBonds; + delete[] theBends; + delete[] theTorsions; } // clean up the forcefield