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 1576 by gezelter, Wed Jun 8 16:05:07 2011 UTC vs.
Revision 1586 by gezelter, Tue Jun 21 06:34:35 2011 UTC

# Line 67 | Line 67 | namespace OpenMD {
67      eam_->setForceField(forceField_);
68      sc_->setForceField(forceField_);
69      morse_->setForceField(forceField_);
70 +    electrostatic_->setSimInfo(info_);
71      electrostatic_->setForceField(forceField_);
72      maw_->setForceField(forceField_);
73  
# Line 241 | Line 242 | namespace OpenMD {
242      }
243      
244      
245 <    // make sure every pair of atom types in this simulation has a
246 <    // non-bonded interaction:
245 >    // Make sure every pair of atom types in this simulation has a
246 >    // non-bonded interaction.  If not, just inform the user.
247  
248      set<AtomType*> simTypes = info_->getSimulatedAtomTypes();
249      set<AtomType*>::iterator it, jt;
250 +
251      for (it = simTypes.begin(); it != simTypes.end(); ++it) {
252        atype1 = (*it);
253 <      for (jt = simTypes.begin(); jt != simTypes.end(); ++jt) {
253 >      for (jt = it; jt != simTypes.end(); ++jt) {
254          atype2 = (*jt);
255          key = make_pair(atype1, atype2);
256          
257          if (interactions_[key].size() == 0) {
258            sprintf( painCave.errMsg,
259 <                   "InteractionManager unable to find an appropriate non-bonded\n"
260 <                   "\tinteraction for atom types %s - %s\n",
259 >                   "InteractionManager could not find a matching non-bonded\n"
260 >                   "\tinteraction for atom types %s - %s\n"
261 >                   "\tProceeding without this interaction.\n",
262                     atype1->getName().c_str(), atype2->getName().c_str());
263            painCave.severity = OPENMD_INFO;
264 <          painCave.isFatal = 1;
264 >          painCave.isFatal = 0;
265            simError();
266          }
267        }
# Line 266 | Line 269 | namespace OpenMD {
269  
270      initialized_ = true;
271    }
272 +
273 +  void InteractionManager::setCutoffRadius(RealType rcut) {
274 +    electrostatic_->setCutoffRadius(rcut);
275 +    eam_->setCutoffRadius(rcut);
276 +  }
277 +
278 +  void InteractionManager::setSwitchingRadius(RealType rswitch) {
279 +    electrostatic_->setSwitchingRadius(rswitch);
280 +  }
281    
282    void InteractionManager::doPrePair(InteractionData idat){
283      
# Line 315 | Line 327 | namespace OpenMD {
327    void InteractionManager::doSkipCorrection(InteractionData idat){
328  
329      if (!initialized_) initialize();  
330 <    
330 >
331      set<NonBondedInteraction*>::iterator it;
332  
333      for (it = interactions_[ idat.atypes ].begin();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines