ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/nonbonded/InteractionManager.cpp
(Generate patch)

Comparing branches/development/src/nonbonded/InteractionManager.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1874 by gezelter, Wed May 15 15:09:35 2013 UTC

# Line 35 | Line 35
35   *                                                                      
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39   * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40   * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
# Line 59 | Line 59 | namespace OpenMD {
59      maw_ = new MAW();
60    }
61  
62 +  InteractionManager::~InteractionManager() {
63 +    delete lj_;
64 +    delete gb_;
65 +    delete sticky_;
66 +    delete morse_;
67 +    delete repulsivePower_;
68 +    delete eam_;
69 +    delete sc_;
70 +    delete electrostatic_;
71 +    delete maw_;
72 +  }
73 +
74    void InteractionManager::initialize() {
75 <    
75 >
76 >    if (initialized_) return;
77 >
78      ForceField* forceField_ = info_->getForceField();
79      
80      lj_->setForceField(forceField_);
# Line 79 | Line 93 | namespace OpenMD {
93      AtomType* atype1;
94      AtomType* atype2;
95      pair<AtomType*, AtomType*> key;
82    pair<set<NonBondedInteraction*>::iterator, bool> ret;
96      
97      for (atype1 = atomTypes->beginType(i1); atype1 != NULL;
98           atype1 = atomTypes->nextType(i1)) {
99        
100        // add it to the map:
88      AtomTypeProperties atp = atype1->getATP();    
101        
102        pair<map<int,AtomType*>::iterator,bool> ret;    
103 <      ret = typeMap_.insert( pair<int, AtomType*>(atp.ident, atype1) );
103 >      ret = typeMap_.insert( pair<int, AtomType*>(atype1->getIdent(), atype1) );
104        if (ret.second == false) {
105          sprintf( painCave.errMsg,
106                   "InteractionManager already had a previous entry with ident %d\n",
107 <                 atp.ident);
107 >                 atype1->getIdent());
108          painCave.severity = OPENMD_INFO;
109          painCave.isFatal = 0;
110          simError();                
# Line 107 | Line 119 | namespace OpenMD {
119  
120        for( it2 = typeMap_.begin(); it2 != typeMap_.end(); ++it2) {        
121          atype2 = (*it2).second;
122 <        
111 <        bool vdwExplicit = false;
112 <        bool metExplicit = false;
113 <        bool hbExplicit = false;
114 <                      
122 >                              
123          key = make_pair(atype1, atype2);
124          
125          if (atype1->isLennardJones() && atype2->isLennardJones()) {
# Line 146 | Line 154 | namespace OpenMD {
154          
155          if (nbiType != NULL) {
156  
157 +          bool vdwExplicit = false;
158 +          bool metExplicit = false;
159 +          // bool hbExplicit = false;
160 +
161            if (nbiType->isLennardJones()) {
162              // We found an explicit Lennard-Jones interaction.  
163              // override all other vdw entries for this pair of atom types:
# Line 303 | Line 315 | namespace OpenMD {
315      eam_->setCutoffRadius(rcut);
316    }
317  
306  void InteractionManager::setSwitchingRadius(RealType rswitch) {
307    electrostatic_->setSwitchingRadius(rswitch);
308  }
309  
318    void InteractionManager::doPrePair(InteractionData idat){
319      
320      if (!initialized_) initialize();
# Line 380 | Line 388 | namespace OpenMD {
388  
389    RealType InteractionManager::getSuggestedCutoffRadius(int *atid) {
390      if (!initialized_) initialize();
391 <    
391 >
392      AtomType* atype = typeMap_[*atid];
393  
394      pair<AtomType*, AtomType*> key = make_pair(atype, atype);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines