--- trunk/src/selection/SelectionEvaluator.cpp 2012/12/07 18:33:33 1816 +++ trunk/src/selection/SelectionEvaluator.cpp 2013/08/19 19:20:32 1931 @@ -35,7 +35,7 @@ * * [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). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -56,7 +56,7 @@ namespace OpenMD { SelectionEvaluator::SelectionEvaluator(SimInfo* si) : info(si), nameFinder(info), distanceFinder(info), hullFinder(info), - indexFinder(info), + indexFinder(info), hasSurfaceArea_(false), isLoaded_(false){ nStuntDouble = info->getNGlobalAtoms() + info->getNGlobalRigidBodies(); } @@ -376,6 +376,8 @@ namespace OpenMD { int property, int comparator, float comparisonValue) { RealType propertyValue = 0.0; + Vector3d pos; + switch (property) { case Token::mass: propertyValue = sd->getMass(); @@ -401,7 +403,22 @@ namespace OpenMD { break; case Token::z: propertyValue = sd->getPos().z(); + break; + case Token::wrappedX: + pos = sd->getPos(); + info->getSnapshotManager()->getCurrentSnapshot()->wrapVector(pos); + propertyValue = pos.x(); + break; + case Token::wrappedY: + pos = sd->getPos(); + info->getSnapshotManager()->getCurrentSnapshot()->wrapVector(pos); + propertyValue = pos.y(); break; + case Token::wrappedZ: + pos = sd->getPos(); + info->getSnapshotManager()->getCurrentSnapshot()->wrapVector(pos); + propertyValue = pos.z(); + break; case Token::r: propertyValue = sd->getPos().length(); break; @@ -430,6 +447,7 @@ namespace OpenMD { match = propertyValue != comparisonValue; break; } + if (match) bs.setBitOn(sd->getGlobalIndex()); @@ -440,6 +458,7 @@ namespace OpenMD { int property, int comparator, float comparisonValue, int frame) { RealType propertyValue = 0.0; + Vector3d pos; switch (property) { case Token::mass: propertyValue = sd->getMass(); @@ -465,7 +484,23 @@ namespace OpenMD { break; case Token::z: propertyValue = sd->getPos(frame).z(); + break; + case Token::wrappedX: + pos = sd->getPos(frame); + info->getSnapshotManager()->getSnapshot(frame)->wrapVector(pos); + propertyValue = pos.x(); + break; + case Token::wrappedY: + pos = sd->getPos(frame); + info->getSnapshotManager()->getSnapshot(frame)->wrapVector(pos); + propertyValue = pos.y(); + break; + case Token::wrappedZ: + pos = sd->getPos(frame); + info->getSnapshotManager()->getSnapshot(frame)->wrapVector(pos); + propertyValue = pos.z(); break; + case Token::r: propertyValue = sd->getPos(frame).length(); break; @@ -697,7 +732,8 @@ namespace OpenMD { OpenMDBitSet bs(nStuntDouble); bs = hullFinder.findHull(); - + surfaceArea_ = hullFinder.getSurfaceArea(); + hasSurfaceArea_ = true; return bs; } @@ -706,7 +742,7 @@ namespace OpenMD { OpenMDBitSet bs(nStuntDouble); bs = hullFinder.findHull(frame); - + return bs; }