--- trunk/OOPSE/libmdtools/ConstraintManager.cpp 2004/06/03 21:51:55 1232 +++ trunk/OOPSE/libmdtools/ConstraintManager.cpp 2004/06/04 03:15:31 1234 @@ -37,17 +37,17 @@ void ConstraintManager::addConstraints(Molecule* mol){ vector tempConsElem; foundResult = iterInfoMap.find(mol); - if (foundResult != iterInfoMap.end()){ + if (foundResult == iterInfoMap.end()){ //to improve efficiency, we will not record the molecule without constraint - if (mol->getNConstrains() == 0){ + if (mol->getNConstrains() > 0){ //if a molecule has constraint, all of its myIntegrableOjects must be constraint elements integrableObjects = mol->getIntegrableObjects(); for(sdIter = integrableObjects.begin(); sdIter != integrableObjects.end(); sdIter++){ - + sd = *sdIter; if(sd->isRigidBody()) ce = new ConstraintRigidBody((RigidBody*)sd, 0); else