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) { |
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_); |
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; |
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, |