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

Comparing branches/development/src/selection/SelectionEvaluator.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1803 by gezelter, Wed Oct 3 14:20:07 2012 UTC

# Line 150 | Line 150 | namespace OpenMD {
150      OpenMDBitSet bs;
151      std::stack<OpenMDBitSet> stack;
152    
153 <    for (int pc = pcStart; pc < code.size(); ++pc) {
153 >    for (unsigned int pc = pcStart; pc < code.size(); ++pc) {
154        Token instruction = code[pc];
155  
156        switch (instruction.tok) {
# Line 159 | Line 159 | namespace OpenMD {
159        case Token::expressionEnd:
160          break;
161        case Token::all:
162 <        bs = OpenMDBitSet(nStuntDouble);
163 <        bs.setAll();
162 >        bs = allInstruction();
163          stack.push(bs);            
164          break;
165        case Token::none:
# Line 222 | Line 221 | namespace OpenMD {
221      int comparator = instruction.tok;
222      int property = instruction.intValue;
223      float comparisonValue = boost::any_cast<float>(instruction.value);
225    float propertyValue;
224      OpenMDBitSet bs(nStuntDouble);
225      bs.clearAll();
226      
# Line 448 | Line 446 | namespace OpenMD {
446      return bs;
447    }
448  
449 +  OpenMDBitSet SelectionEvaluator::allInstruction() {
450 +    OpenMDBitSet bs(nStuntDouble);
451  
452 +    SimInfo::MoleculeIterator mi;
453 +    Molecule* mol;
454 +    Molecule::AtomIterator ai;
455 +    Atom* atom;
456 +    Molecule::RigidBodyIterator rbIter;
457 +    RigidBody* rb;
458 +
459 +    // Doing the loop insures that we're actually on this processor.
460 +
461 +    for (mol = info->beginMolecule(mi); mol != NULL;
462 +         mol = info->nextMolecule(mi)) {
463 +
464 +      for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) {
465 +        bs.setBitOn(atom->getGlobalIndex());
466 +      }
467 +    
468 +      for (rb = mol->beginRigidBody(rbIter); rb != NULL;
469 +           rb = mol->nextRigidBody(rbIter)) {
470 +        bs.setBitOn(rb->getGlobalIndex());
471 +      }
472 +    }
473 +
474 +    return bs;
475 +  }
476 +
477    OpenMDBitSet SelectionEvaluator::hull() {
478      OpenMDBitSet bs(nStuntDouble);
479      
# Line 457 | Line 482 | namespace OpenMD {
482      return bs;
483    }
484  
460
461
485    RealType SelectionEvaluator::getCharge(Atom* atom) {
486      RealType charge =0.0;
487      AtomType* atomType = atom->getAtomType();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines