ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/brains/SimInfo.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/brains/SimInfo.cpp (file contents):
Revision 2097 by tim, Wed Mar 9 17:30:29 2005 UTC vs.
Revision 2187 by tim, Wed Apr 13 18:41:17 2005 UTC

# Line 65 | Line 65 | SimInfo::SimInfo(std::vector<std::pair<MoleculeStamp*,
65  
66   namespace oopse {
67  
68 < SimInfo::SimInfo(std::vector<std::pair<MoleculeStamp*, int> >& molStampPairs,
68 > SimInfo::SimInfo(MakeStamps* stamps, std::vector<std::pair<MoleculeStamp*, int> >& molStampPairs,
69                                  ForceField* ff, Globals* simParams) :
70 <                                forceField_(ff), simParams_(simParams),
70 >                                stamps_(stamps), forceField_(ff), simParams_(simParams),
71                                  ndf_(0), ndfRaw_(0), ndfTrans_(0), nZconstraint_(0),
72                                  nGlobalMols_(0), nGlobalAtoms_(0), nGlobalCutoffGroups_(0),
73                                  nGlobalIntegrableObjects_(0), nGlobalRigidBodies_(0),
# Line 147 | Line 147 | SimInfo::~SimInfo() {
147          delete i->second;
148      }
149      molecules_.clear();
150 <    
151 <    MemoryUtils::deletePointers(moleculeStamps_);
152 <    
150 >      
151 >    delete stamps_;
152      delete sman_;
153      delete simParams_;
154      delete forceField_;
# Line 367 | Line 366 | void SimInfo::addExcludePairs(Molecule* mol) {
366          exclude_.addPair(c, d);        
367      }
368  
369 <    
369 >    Molecule::RigidBodyIterator rbIter;
370 >    RigidBody* rb;
371 >    for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) {
372 >        std::vector<Atom*> atoms = rb->getAtoms();
373 >        for (int i = 0; i < atoms.size() -1 ; ++i) {
374 >            for (int j = i + 1; j < atoms.size(); ++j) {
375 >                a = atoms[i]->getGlobalIndex();
376 >                b = atoms[j]->getGlobalIndex();
377 >                exclude_.addPair(a, b);
378 >            }
379 >        }
380 >    }        
381 >
382   }
383  
384   void SimInfo::removeExcludePairs(Molecule* mol) {
# Line 411 | Line 422 | void SimInfo::removeExcludePairs(Molecule* mol) {
422          exclude_.removePair(b, d);
423          exclude_.removePair(c, d);        
424      }
425 +
426 +    Molecule::RigidBodyIterator rbIter;
427 +    RigidBody* rb;
428 +    for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) {
429 +        std::vector<Atom*> atoms = rb->getAtoms();
430 +        for (int i = 0; i < atoms.size() -1 ; ++i) {
431 +            for (int j = i + 1; j < atoms.size(); ++j) {
432 +                a = atoms[i]->getGlobalIndex();
433 +                b = atoms[j]->getGlobalIndex();
434 +                exclude_.removePair(a, b);
435 +            }
436 +        }
437 +    }        
438  
439   }
440  
# Line 646 | Line 670 | void SimInfo::setupFortranSim() {
670      }
671      
672      //setup fortran simulation
649    //gloalExcludes and molMembershipArray should go away (They are never used)
650    //why the hell fortran need to know molecule?
651    //OOPSE = Object-Obfuscated Parallel Simulation Engine
673      int nGlobalExcludes = 0;
674      int* globalExcludes = NULL;
675      int* excludeList = exclude_.getExcludeList();
# Line 836 | Line 857 | void SimInfo::setSnapshotManager(SnapshotManager* sman
857   }
858  
859   void SimInfo::setSnapshotManager(SnapshotManager* sman) {
860 <    //if (sman_ == sman_) {
861 <    //    return;
862 <    //}
863 <    
843 <    //delete sman_;
860 >    if (sman_ == sman) {
861 >        return;
862 >    }    
863 >    delete sman_;
864      sman_ = sman;
865  
866      Molecule* mol;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines