--- trunk/src/selection/SelectionEvaluator.cpp 2009/11/25 20:02:06 1390 +++ trunk/src/selection/SelectionEvaluator.cpp 2012/08/22 02:28:28 1782 @@ -36,7 +36,8 @@ * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). - * [4] Vardeman & Gezelter, in progress (2009). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #include @@ -45,13 +46,14 @@ #include "primitives/DirectionalAtom.hpp" #include "primitives/RigidBody.hpp" #include "primitives/Molecule.hpp" -#include "io/basic_ifstrstream.hpp" +#include "io/ifstrstream.hpp" namespace OpenMD { SelectionEvaluator::SelectionEvaluator(SimInfo* si) - : info(si), nameFinder(info), distanceFinder(info), indexFinder(info), + : info(si), nameFinder(info), distanceFinder(info), hullFinder(info), + indexFinder(info), isLoaded_(false){ nStuntDouble = info->getNGlobalAtoms() + info->getNGlobalRigidBodies(); } @@ -148,7 +150,7 @@ namespace OpenMD { OpenMDBitSet bs; std::stack stack; - for (int pc = pcStart; pc < code.size(); ++pc) { + for (unsigned int pc = pcStart; pc < code.size(); ++pc) { Token instruction = code[pc]; switch (instruction.tok) { @@ -181,6 +183,9 @@ namespace OpenMD { case Token::within: withinInstruction(instruction, stack.top()); break; + case Token::hull: + stack.push(hull()); + break; //case Token::selected: // stack.push(getSelectionSet()); // break; @@ -217,7 +222,6 @@ namespace OpenMD { int comparator = instruction.tok; int property = instruction.intValue; float comparisonValue = boost::any_cast(instruction.value); - float propertyValue; OpenMDBitSet bs(nStuntDouble); bs.clearAll(); @@ -274,6 +278,9 @@ namespace OpenMD { case Token::z: propertyValue = sd->getPos().z(); break; + case Token::r: + propertyValue = sd->getPos().length(); + break; default: unrecognizedAtomProperty(property); } @@ -441,6 +448,16 @@ namespace OpenMD { } + OpenMDBitSet SelectionEvaluator::hull() { + OpenMDBitSet bs(nStuntDouble); + + bs = hullFinder.findHull(); + + return bs; + } + + + RealType SelectionEvaluator::getCharge(Atom* atom) { RealType charge =0.0; AtomType* atomType = atom->getAtomType();