58 |
|
EAM* InteractionManager::eam_ = new EAM(); |
59 |
|
SC* InteractionManager::sc_ = new SC(); |
60 |
|
Electrostatic* InteractionManager::electrostatic_ = new Electrostatic(); |
61 |
+ |
MAW* InteractionManager::maw_ = new MAW(); |
62 |
|
SwitchingFunction* InteractionManager::switcher_ = new SwitchingFunction(); |
63 |
|
|
64 |
|
InteractionManager* InteractionManager::Instance() { |
77 |
|
sc_->setForceField(forceField_); |
78 |
|
morse_->setForceField(forceField_); |
79 |
|
electrostatic_->setForceField(forceField_); |
80 |
+ |
maw_->setForceField(forceField_); |
81 |
|
|
82 |
|
ForceFieldOptions& fopts = forceField_->getForceFieldOptions(); |
83 |
|
// Force fields can set options on how to scale van der Waals and electrostatic |
233 |
|
interactions_[key].insert(sc_); |
234 |
|
metExplicit = true; |
235 |
|
} |
236 |
+ |
|
237 |
+ |
if (nbiType->isMAW()) { |
238 |
+ |
if (vdwExplicit) { |
239 |
+ |
sprintf( painCave.errMsg, |
240 |
+ |
"InteractionManager::initialize found more than one explicit\n" |
241 |
+ |
"\tvan der Waals interaction for atom types %s - %s\n", |
242 |
+ |
atype1->getName().c_str(), atype2->getName().c_str()); |
243 |
+ |
painCave.severity = OPENMD_ERROR; |
244 |
+ |
painCave.isFatal = 1; |
245 |
+ |
simError(); |
246 |
+ |
} |
247 |
+ |
// We found an explicit MAW interaction. |
248 |
+ |
// override all other vdw entries for this pair of atom types: |
249 |
+ |
set<NonBondedInteraction*>::iterator it; |
250 |
+ |
for (it = interactions_[key].begin(); it != interactions_[key].end(); ++it) { |
251 |
+ |
InteractionFamily ifam = (*it)->getFamily(); |
252 |
+ |
if (ifam == VANDERWAALS_FAMILY) interactions_[key].erase(*it); |
253 |
+ |
} |
254 |
+ |
interactions_[key].insert(maw_); |
255 |
+ |
vdwExplicit = true; |
256 |
+ |
} |
257 |
|
} |
258 |
|
} |
259 |
|
|