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 1505 by gezelter, Sun Oct 3 22:18:59 2010 UTC vs.
Revision 1528 by gezelter, Fri Dec 17 20:11:05 2010 UTC

# Line 48 | Line 48 | namespace OpenMD {
48    InteractionManager* InteractionManager::_instance = NULL;
49    map<int, AtomType*> InteractionManager::typeMap_;
50    map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > InteractionManager::interactions_;
51 +
52 +  LJ* InteractionManager::lj_ = new LJ();
53 +  GB* InteractionManager::gb_ = new GB();
54 +  Sticky* InteractionManager::sticky_ = new Sticky();
55 +  Morse* InteractionManager::morse_ = new Morse();
56 +  EAM* InteractionManager::eam_ = new EAM();
57 +  SC* InteractionManager::sc_ = new SC();
58 +  Electrostatic* InteractionManager::electrostatic_ = new Electrostatic();
59  
60    InteractionManager* InteractionManager::Instance() {
61      if (!_instance) {
# Line 58 | Line 66 | namespace OpenMD {
66  
67    void InteractionManager::initialize() {
68      
61    lj_ = new LJ();
62    gb_ = new GB();
63    sticky_ = new Sticky();
64    eam_ = new EAM();
65    sc_ = new SC();
66    morse_ = new Morse();
67    electrostatic_ = new Electrostatic();
68
69      lj_->setForceField(forceField_);
70      gb_->setForceField(forceField_);
71      sticky_->setForceField(forceField_);
# Line 410 | Line 410 | namespace OpenMD {
410      if (!initialized_) initialize();
411      
412      AtomType* atype = typeMap_[*atid];
413 +
414 +    pair<AtomType*, AtomType*> key = make_pair(atype, atype);
415 +    set<NonBondedInteraction*>::iterator it;
416 +    RealType cutoff = 0.0;
417 +    
418 +    for (it = interactions_[key].begin(); it != interactions_[key].end(); ++it)
419 +      cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(atype, atype));  
420 +    return cutoff;    
421 +  }
422  
423 +  RealType InteractionManager::getSuggestedCutoffRadius(AtomType* atype) {
424 +    if (!initialized_) initialize();
425 +    
426      pair<AtomType*, AtomType*> key = make_pair(atype, atype);
427      set<NonBondedInteraction*>::iterator it;
428      RealType cutoff = 0.0;
# Line 438 | Line 450 | extern "C" {
450                                                               rho_i_at_j,  
451                                                               rho_j_at_i);
452    }
453 <  void fortranDoPreforce(int *atid, RealType *rho, RealType *frho,
453 >  void fortranDoPreForce(int *atid, RealType *rho, RealType *frho,
454                           RealType *dfrhodrho) {  
455      
456      return OpenMD::InteractionManager::Instance()->doPreForce(atid, rho, frho,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines