ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/primitives/Molecule.cpp
(Generate patch)

Comparing trunk/src/primitives/Molecule.cpp (file contents):
Revision 2053 by gezelter, Mon Jan 12 16:04:43 2015 UTC vs.
Revision 2054 by gezelter, Tue Jan 13 20:14:57 2015 UTC

# Line 53 | Line 53
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,
# Line 196 | Line 196 | namespace OpenMD {
196        // get the chain of base types for this atom type:
197        std::vector<AtomType*> ayb = at->allYourBase();
198        // use the last type in the chain of base types for the name:
199 <      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 );
199 >      std::string bn = UpperCase(ayb[ayb.size()-1]->getName());
200  
201 +        if (bn.compare("O")==0 || bn.compare("N")==0
202 +            || bn.compare("F")==0)
203 +          hBondAcceptors_.push_back( atom );
204 +      
205      }
206      
207      // find electronegative atoms that are either bonded to
# Line 215 | Line 216 | namespace OpenMD {
216        std::vector<AtomType*> ayb1 = at1->allYourBase();
217        std::vector<AtomType*> ayb2 = at2->allYourBase();
218        // use the last type in the chain of base types for the name:
219 <      std::string bn1 = ayb1[ayb1.size()-1]->getName();
220 <      std::string bn2 = ayb2[ayb2.size()-1]->getName();
219 >      std::string bn1 = UpperCase(ayb1[ayb1.size()-1]->getName());
220 >      std::string bn2 = UpperCase(ayb2[ayb2.size()-1]->getName());
221        
222        if (bn1.compare("H")==0) {
223          if (bn2.compare("O")==0 || bn2.compare("N")==0
# Line 246 | Line 247 | namespace OpenMD {
247          // get the chain of base types for this atom type:
248          std::vector<AtomType*> ayb1 = at1->allYourBase();
249          // use the last type in the chain of base types for the name:
250 <        std::string bn1 = ayb1[ayb1.size()-1]->getName();
250 >        std::string bn1 = UpperCase(ayb1[ayb1.size()-1]->getName());
251          
252          if (bn1.compare("O")==0 || bn1.compare("N")==0
253              || bn1.compare("F")==0) {
# Line 256 | Line 257 | namespace OpenMD {
257              // get the chain of base types for this atom type:              
258              std::vector<AtomType*> ayb2 = at2->allYourBase();
259              // use the last type in the chain of base types for the name:
260 <            std::string bn2 = ayb2[ayb2.size()-1]->getName();
260 >            std::string bn2 = UpperCase(ayb2[ayb2.size()-1]->getName());
261              if (bn2.compare("H")==0) {              
262                HBondDonor* donor = new HBondDonor();
263                donor->donorAtom = atom1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines