| 53 |
|
#include "primitives/Molecule.hpp" |
| 54 |
|
#include "utils/MemoryUtils.hpp" |
| 55 |
|
#include "utils/simError.h" |
| 56 |
< |
#include "utils/ElementsTable.hpp" |
| 56 |
> |
#include "utils/StringUtils.hpp" |
| 57 |
|
|
| 58 |
|
namespace OpenMD { |
| 59 |
|
Molecule::Molecule(int stampId, int globalIndex, const std::string& molName, |
| 60 |
< |
int region) : stampId_(stampId), |
| 60 |
> |
int region) : |
| 61 |
|
globalIndex_(globalIndex), |
| 62 |
< |
moleculeName_(molName), |
| 63 |
< |
region_(region), |
| 62 |
> |
stampId_(stampId), |
| 63 |
> |
region_(region), |
| 64 |
> |
moleculeName_(molName), |
| 65 |
|
constrainTotalCharge_(false) { |
| 66 |
|
} |
| 67 |
|
|
| 197 |
|
// get the chain of base types for this atom type: |
| 198 |
|
std::vector<AtomType*> ayb = at->allYourBase(); |
| 199 |
|
// use the last type in the chain of base types for the name: |
| 200 |
< |
std::string bn = ayb[ayb.size()-1]->getName(); |
| 200 |
< |
|
| 201 |
< |
if (bn.compare("O")==0 || bn.compare("N")==0 || bn.compare("F")==0) |
| 202 |
< |
hBondAcceptors_.push_back( atom ); |
| 200 |
> |
std::string bn = UpperCase(ayb[ayb.size()-1]->getName()); |
| 201 |
|
|
| 202 |
+ |
if (bn.compare("O")==0 || bn.compare("N")==0 |
| 203 |
+ |
|| bn.compare("F")==0) |
| 204 |
+ |
hBondAcceptors_.push_back( atom ); |
| 205 |
+ |
|
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
// find electronegative atoms that are either bonded to |
| 217 |
|
std::vector<AtomType*> ayb1 = at1->allYourBase(); |
| 218 |
|
std::vector<AtomType*> ayb2 = at2->allYourBase(); |
| 219 |
|
// use the last type in the chain of base types for the name: |
| 220 |
< |
std::string bn1 = ayb1[ayb1.size()-1]->getName(); |
| 221 |
< |
std::string bn2 = ayb2[ayb2.size()-1]->getName(); |
| 220 |
> |
std::string bn1 = UpperCase(ayb1[ayb1.size()-1]->getName()); |
| 221 |
> |
std::string bn2 = UpperCase(ayb2[ayb2.size()-1]->getName()); |
| 222 |
|
|
| 223 |
|
if (bn1.compare("H")==0) { |
| 224 |
|
if (bn2.compare("O")==0 || bn2.compare("N")==0 |
| 248 |
|
// get the chain of base types for this atom type: |
| 249 |
|
std::vector<AtomType*> ayb1 = at1->allYourBase(); |
| 250 |
|
// use the last type in the chain of base types for the name: |
| 251 |
< |
std::string bn1 = ayb1[ayb1.size()-1]->getName(); |
| 251 |
> |
std::string bn1 = UpperCase(ayb1[ayb1.size()-1]->getName()); |
| 252 |
|
|
| 253 |
|
if (bn1.compare("O")==0 || bn1.compare("N")==0 |
| 254 |
|
|| bn1.compare("F")==0) { |
| 258 |
|
// get the chain of base types for this atom type: |
| 259 |
|
std::vector<AtomType*> ayb2 = at2->allYourBase(); |
| 260 |
|
// use the last type in the chain of base types for the name: |
| 261 |
< |
std::string bn2 = ayb2[ayb2.size()-1]->getName(); |
| 261 |
> |
std::string bn2 = UpperCase(ayb2[ayb2.size()-1]->getName()); |
| 262 |
|
if (bn2.compare("H")==0) { |
| 263 |
|
HBondDonor* donor = new HBondDonor(); |
| 264 |
|
donor->donorAtom = atom1; |