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 1529 by gezelter, Mon Dec 27 18:35:59 2010 UTC

# Line 44 | Line 44 | namespace OpenMD {
44   namespace OpenMD {
45  
46    bool InteractionManager::initialized_ = false;
47 +  RealType InteractionManager::rCut_ = -1.0;
48 +  RealType InteractionManager::rSwitch_ = -1.0;
49    ForceField* InteractionManager::forceField_ = NULL;  
50    InteractionManager* InteractionManager::_instance = NULL;
51    map<int, AtomType*> InteractionManager::typeMap_;
52    map<pair<AtomType*, AtomType*>, set<NonBondedInteraction*> > InteractionManager::interactions_;
53 +
54 +  LJ* InteractionManager::lj_ = new LJ();
55 +  GB* InteractionManager::gb_ = new GB();
56 +  Sticky* InteractionManager::sticky_ = new Sticky();
57 +  Morse* InteractionManager::morse_ = new Morse();
58 +  EAM* InteractionManager::eam_ = new EAM();
59 +  SC* InteractionManager::sc_ = new SC();
60 +  Electrostatic* InteractionManager::electrostatic_ = new Electrostatic();
61  
62    InteractionManager* InteractionManager::Instance() {
63      if (!_instance) {
# Line 58 | Line 68 | namespace OpenMD {
68  
69    void InteractionManager::initialize() {
70      
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
71      lj_->setForceField(forceField_);
72      gb_->setForceField(forceField_);
73      sticky_->setForceField(forceField_);
# Line 420 | Line 422 | namespace OpenMD {
422      return cutoff;    
423    }
424  
425 +  RealType InteractionManager::getSuggestedCutoffRadius(AtomType* atype) {
426 +    if (!initialized_) initialize();
427 +    
428 +    pair<AtomType*, AtomType*> key = make_pair(atype, atype);
429 +    set<NonBondedInteraction*>::iterator it;
430 +    RealType cutoff = 0.0;
431 +    
432 +    for (it = interactions_[key].begin(); it != interactions_[key].end(); ++it)
433 +      cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(atype, atype));  
434 +    return cutoff;    
435 +  }
436 +
437   } //end namespace OpenMD
438  
439   extern "C" {
# Line 438 | Line 452 | extern "C" {
452                                                               rho_i_at_j,  
453                                                               rho_j_at_i);
454    }
455 <  void fortranDoPreforce(int *atid, RealType *rho, RealType *frho,
455 >  void fortranDoPreForce(int *atid, RealType *rho, RealType *frho,
456                           RealType *dfrhodrho) {  
457      
458      return OpenMD::InteractionManager::Instance()->doPreForce(atid, rho, frho,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines