--- trunk/src/primitives/Molecule.cpp 2015/01/12 16:04:43 2053 +++ trunk/src/primitives/Molecule.cpp 2015/03/07 21:41:51 2071 @@ -53,14 +53,15 @@ #include "primitives/Molecule.hpp" #include "utils/MemoryUtils.hpp" #include "utils/simError.h" -#include "utils/ElementsTable.hpp" +#include "utils/StringUtils.hpp" namespace OpenMD { Molecule::Molecule(int stampId, int globalIndex, const std::string& molName, - int region) : stampId_(stampId), + int region) : globalIndex_(globalIndex), - moleculeName_(molName), - region_(region), + stampId_(stampId), + region_(region), + moleculeName_(molName), constrainTotalCharge_(false) { } @@ -196,11 +197,12 @@ namespace OpenMD { // get the chain of base types for this atom type: std::vector ayb = at->allYourBase(); // use the last type in the chain of base types for the name: - std::string bn = ayb[ayb.size()-1]->getName(); - - if (bn.compare("O")==0 || bn.compare("N")==0 || bn.compare("F")==0) - hBondAcceptors_.push_back( atom ); + std::string bn = UpperCase(ayb[ayb.size()-1]->getName()); + if (bn.compare("O")==0 || bn.compare("N")==0 + || bn.compare("F")==0) + hBondAcceptors_.push_back( atom ); + } // find electronegative atoms that are either bonded to @@ -215,8 +217,8 @@ namespace OpenMD { std::vector ayb1 = at1->allYourBase(); std::vector ayb2 = at2->allYourBase(); // use the last type in the chain of base types for the name: - std::string bn1 = ayb1[ayb1.size()-1]->getName(); - std::string bn2 = ayb2[ayb2.size()-1]->getName(); + std::string bn1 = UpperCase(ayb1[ayb1.size()-1]->getName()); + std::string bn2 = UpperCase(ayb2[ayb2.size()-1]->getName()); if (bn1.compare("H")==0) { if (bn2.compare("O")==0 || bn2.compare("N")==0 @@ -246,7 +248,7 @@ namespace OpenMD { // get the chain of base types for this atom type: std::vector ayb1 = at1->allYourBase(); // use the last type in the chain of base types for the name: - std::string bn1 = ayb1[ayb1.size()-1]->getName(); + std::string bn1 = UpperCase(ayb1[ayb1.size()-1]->getName()); if (bn1.compare("O")==0 || bn1.compare("N")==0 || bn1.compare("F")==0) { @@ -256,7 +258,7 @@ namespace OpenMD { // get the chain of base types for this atom type: std::vector ayb2 = at2->allYourBase(); // use the last type in the chain of base types for the name: - std::string bn2 = ayb2[ayb2.size()-1]->getName(); + std::string bn2 = UpperCase(ayb2[ayb2.size()-1]->getName()); if (bn2.compare("H")==0) { HBondDonor* donor = new HBondDonor(); donor->donorAtom = atom1;