ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/selection/DistanceFinder.cpp
(Generate patch)

Comparing trunk/src/selection/DistanceFinder.cpp (file contents):
Revision 1969 by gezelter, Wed Feb 26 14:14:50 2014 UTC vs.
Revision 2052 by gezelter, Fri Jan 9 19:06:35 2015 UTC

# Line 55 | Line 55 | namespace OpenMD {
55      nObjects_.push_back(info_->getNGlobalBends());
56      nObjects_.push_back(info_->getNGlobalTorsions());
57      nObjects_.push_back(info_->getNGlobalInversions());
58 +    nObjects_.push_back(info_->getNGlobalMolecules());
59  
60      stuntdoubles_.resize(nObjects_[STUNTDOUBLE]);
61      bonds_.resize(nObjects_[BOND]);
62      bends_.resize(nObjects_[BEND]);
63      torsions_.resize(nObjects_[TORSION]);
64      inversions_.resize(nObjects_[INVERSION]);
65 +    molecules_.resize(nObjects_[MOLECULE]);
66      
67      SimInfo::MoleculeIterator mi;
68      Molecule::AtomIterator ai;
# Line 80 | Line 82 | namespace OpenMD {
82      
83      for (mol = info_->beginMolecule(mi); mol != NULL;
84           mol = info_->nextMolecule(mi)) {
85 <        
85 >
86 >      molecules_[mol->getGlobalIndex()] = mol;
87 >      
88        for(atom = mol->beginAtom(ai); atom != NULL;
89            atom = mol->nextAtom(ai)) {
90          stuntdoubles_[atom->getGlobalIndex()] = atom;
# Line 162 | Line 166 | namespace OpenMD {
166        centerPos = center->getPos();
167   #endif
168        
169 +      for (unsigned int j = 0; j < molecules_.size(); ++j) {
170 +        Vector3d r =centerPos - molecules_[j]->getCom();
171 +        currSnapshot->wrapVector(r);
172 +        if (r.length() <= distance) {
173 +          bsResult.bitsets_[MOLECULE].setBitOn(j);
174 +        }
175 +      }
176        for (unsigned int j = 0; j < stuntdoubles_.size(); ++j) {
177          Vector3d r =centerPos - stuntdoubles_[j]->getPos();
178          currSnapshot->wrapVector(r);
# Line 271 | Line 282 | namespace OpenMD {
282        center = stuntdoubles_[i];
283        centerPos = center->getPos(frame);
284   #endif
285 +      for (unsigned int j = 0; j < molecules_.size(); ++j) {
286 +        Vector3d r =centerPos - molecules_[j]->getCom(frame);
287 +        currSnapshot->wrapVector(r);
288 +        if (r.length() <= distance) {
289 +          bsResult.bitsets_[MOLECULE].setBitOn(j);
290 +        }
291 +      }
292 +      
293        for (unsigned int j = 0; j < stuntdoubles_.size(); ++j) {
294          Vector3d r =centerPos - stuntdoubles_[j]->getPos(frame);
295          currSnapshot->wrapVector(r);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines