--- trunk/OOPSE/libmdtools/Molecule.cpp 2004/04/15 16:18:26 1113 +++ trunk/OOPSE/libmdtools/Molecule.cpp 2004/08/23 15:11:36 1452 @@ -12,11 +12,12 @@ Molecule::Molecule( void ){ myBonds = NULL; myBends = NULL; myTorsions = NULL; - } 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; + GenericData* gdata; + ConsRbData* rbData; + RigidBody* oldRb; + nAtoms = theInit.nAtoms; nMembers = nAtoms; nBonds = theInit.nBonds; @@ -59,19 +73,45 @@ void Molecule::initialize( molInit &theInit ){ myIntegrableObjects = theInit.myIntegrableObjects; - for (int i = 0; i < myRigidBodies.size(); i++) + for (int i = 0; i < myRigidBodies.size(); i++){ myRigidBodies[i]->calcRefCoords(); + //just a quick hack + + gdata = myRigidBodies[i]->getProperty("OldState"); + if(gdata != NULL){ + rbData = dynamic_cast(gdata); + if(rbData ==NULL) + cerr << "dynamic_cast to ConsRbData Error in Molecule::initialize()" << endl; + else{ + oldRb = rbData->getData(); + oldRb->calcRefCoords(); + } + }//end if(gata != NULL) + }//end for(int i = 0; i < myRigidBodies.size(); i++) + + myCutoffGroups = theInit.myCutoffGroups; + nCutoffGroups = myCutoffGroups.size(); + + myConstraintPairs = theInit.myConstraintPairs; + } void Molecule::calcForces( void ){ int i; + double com[3]; for(i=0; iupdateAtoms(); } + //calculate the center of mass of the molecule + //getCOM(com); + //for(int i = 0; i < nAtoms; i ++) + // myAtoms[i]->setRc(com); + + for(i=0; icalc_forces(); }