diff --git a/src/AtomMask.cpp b/src/AtomMask.cpp index 6e6512a359..497200a551 100644 --- a/src/AtomMask.cpp +++ b/src/AtomMask.cpp @@ -196,8 +196,16 @@ void AtomMask::AddAtomRange(int minAtom, int maxAtom) { /** Add atoms in given unit to mask. */ void AtomMask::AddUnit(Unit const& unitIn) { + // Atoms in a unit should already be sorted, and should have no duplicates. for (Unit::const_iterator it = unitIn.segBegin(); it != unitIn.segEnd(); ++it) - AddAtomRange( it->Begin(), it->End() ); + { + //AddAtomRange( it->Begin(), it->End() ); + for (int atom = it->Begin(); atom < it->End(); atom++) + Selected_.push_back( atom ); + } + // Update Natom_ if necessary + if (Selected_.back() >= Natom_) + Natom_ = Selected_.back() + 1; } // AtomMask::AddMaskAtPosition() diff --git a/src/Version.h b/src/Version.h index b85eef9ba4..c9554bb47b 100644 --- a/src/Version.h +++ b/src/Version.h @@ -12,7 +12,7 @@ * Whenever a number that precedes is incremented, all subsequent * numbers should be reset to 0. */ -#define CPPTRAJ_INTERNAL_VERSION "V6.29.15" +#define CPPTRAJ_INTERNAL_VERSION "V6.29.16" /// PYTRAJ relies on this #define CPPTRAJ_VERSION_STRING CPPTRAJ_INTERNAL_VERSION #endif