--- trunk/OOPSE/libmdtools/Molecule.cpp 2004/04/28 22:34:02 1140 +++ trunk/OOPSE/libmdtools/Molecule.cpp 2004/05/12 16:38:45 1167 @@ -12,11 +12,12 @@ Molecule::Molecule( void ){ myBonds = NULL; myBends = NULL; myTorsions = NULL; - hasMassRatio = false; } Molecule::~Molecule( void ){ int i; + CutoffGroup* cg; + vector::iterator iter; if( myAtoms != NULL ){ for(i=0; i::iterator iterCutoff; + Atom* cutoffAtom; + vector::iterator iterAtom; + int atomIndex; + nAtoms = theInit.nAtoms; nMembers = nAtoms; nBonds = theInit.nBonds; @@ -62,6 +73,9 @@ void Molecule::initialize( molInit &theInit ){ for (int i = 0; i < myRigidBodies.size(); i++) myRigidBodies[i]->calcRefCoords(); + myCutoffGroups = theInit.myCutoffGroups; + nCutoffGroups = myCutoffGroups.size(); + } void Molecule::calcForces( void ){ @@ -73,19 +87,10 @@ void Molecule::calcForces( void ){ myRigidBodies[i]->updateAtoms(); } - //the mass ratio will never change during the simulation. Thus, we could - //just calculate it at the begining of the simulation - if (!hasMassRatio){ - double totMass = getTotalMass(); - for(int i = 0; i < nAtoms; i ++) - myAtoms[i]->setMassRatio(myAtoms[i]->getMass()/totMass); - hasMassRatio = true; - } - //calculate the center of mass of the molecule - getCOM(com); - for(int i = 0; i < nAtoms; i ++) - myAtoms[i]->setRc(com); + //getCOM(com); + //for(int i = 0; i < nAtoms; i ++) + // myAtoms[i]->setRc(com); for(i=0; i