98 |
|
AtomType* atype2; |
99 |
|
int atid1, atid2; |
100 |
|
|
101 |
< |
// We only need to worry about the types that are actually in the simulation: |
102 |
< |
|
101 |
> |
// We only need to worry about the types that are actually in the |
102 |
> |
// simulation: |
103 |
> |
|
104 |
|
set<AtomType*> atypes = info_->getSimulatedAtomTypes(); |
105 |
|
|
106 |
|
lj_->setSimulatedAtomTypes(atypes); |
117 |
|
set<AtomType*>::iterator at; |
118 |
|
|
119 |
|
for (at = atypes.begin(); at != atypes.end(); ++at) { |
120 |
< |
|
120 |
< |
//for (atype1 = atomTypes->beginType(i1); atype1 != NULL; |
121 |
< |
// atype1 = atomTypes->nextType(i1)) { |
122 |
< |
|
120 |
> |
|
121 |
|
atype1 = *at; |
122 |
|
atid1 = atype1->getIdent(); |
123 |
|
iHash_[atid1].resize(nTypes); |
134 |
|
painCave.isFatal = 0; |
135 |
|
simError(); |
136 |
|
} |
137 |
< |
} |
138 |
< |
|
139 |
< |
if (atype1->isLennardJones()) { |
140 |
< |
sHash_[atid1] |= LJ_INTERACTION; |
141 |
< |
} |
142 |
< |
if (atype1->isElectrostatic()) { |
143 |
< |
sHash_[atid1] |= ELECTROSTATIC_INTERACTION; |
144 |
< |
} |
145 |
< |
if (atype1->isSticky()) { |
146 |
< |
sHash_[atid1] |= STICKY_INTERACTION; |
147 |
< |
} |
148 |
< |
if (atype1->isStickyPower()) { |
149 |
< |
sHash_[atid1] |= STICKY_INTERACTION; |
150 |
< |
} |
151 |
< |
if (atype1->isEAM()) { |
152 |
< |
sHash_[atid1] |= EAM_INTERACTION; |
153 |
< |
} |
154 |
< |
if (atype1->isSC()) { |
155 |
< |
sHash_[atid1] |= SC_INTERACTION; |
156 |
< |
} |
157 |
< |
if (atype1->isGayBerne()) { |
158 |
< |
sHash_[atid1] |= GB_INTERACTION; |
137 |
> |
|
138 |
> |
if (atype1->isLennardJones()) { |
139 |
> |
sHash_[atid1] |= LJ_INTERACTION; |
140 |
> |
} |
141 |
> |
if (atype1->isElectrostatic()) { |
142 |
> |
sHash_[atid1] |= ELECTROSTATIC_INTERACTION; |
143 |
> |
} |
144 |
> |
if (atype1->isSticky()) { |
145 |
> |
sHash_[atid1] |= STICKY_INTERACTION; |
146 |
> |
} |
147 |
> |
if (atype1->isStickyPower()) { |
148 |
> |
sHash_[atid1] |= STICKY_INTERACTION; |
149 |
> |
} |
150 |
> |
if (atype1->isEAM()) { |
151 |
> |
sHash_[atid1] |= EAM_INTERACTION; |
152 |
> |
} |
153 |
> |
if (atype1->isSC()) { |
154 |
> |
sHash_[atid1] |= SC_INTERACTION; |
155 |
> |
} |
156 |
> |
if (atype1->isGayBerne()) { |
157 |
> |
sHash_[atid1] |= GB_INTERACTION; |
158 |
> |
} |
159 |
|
} |
162 |
– |
|
160 |
|
// Now, iterate over all known types and add to the interaction map: |
161 |
|
|
162 |
|
map<int, AtomType*>::iterator it1, it2; |
175 |
|
iHash_[atid1][atid2] |= LJ_INTERACTION; |
176 |
|
} |
177 |
|
if (atype1->isElectrostatic() && atype2->isElectrostatic() ) { |
178 |
< |
// Pairs of fluctuating density EAM atoms have their |
179 |
< |
// interactions handled via the EAM routines. All other |
183 |
< |
// interactions with these atoms are handled via normal |
184 |
< |
// electrostatic channels: |
185 |
< |
if (!(atype1->isEAM() && atype2->isEAM())) { |
186 |
< |
interactions_[atid1][atid2].insert(electrostatic_); |
187 |
< |
iHash_[atid1][atid2] |= ELECTROSTATIC_INTERACTION; |
188 |
< |
} |
178 |
> |
interactions_[atid1][atid2].insert(electrostatic_); |
179 |
> |
iHash_[atid1][atid2] |= ELECTROSTATIC_INTERACTION; |
180 |
|
} |
181 |
|
if (atype1->isSticky() && atype2->isSticky() ) { |
182 |
|
interactions_[atid1][atid2].insert(sticky_); |
372 |
|
atid1 = atype1->getIdent(); |
373 |
|
for (jt = it; jt != simTypes.end(); ++jt) { |
374 |
|
atype2 = (*jt); |
375 |
< |
atid1 = atype1->getIdent(); |
375 |
> |
atid2 = atype2->getIdent(); |
376 |
|
|
377 |
|
if (interactions_[atid1][atid2].size() == 0) { |
378 |
|
sprintf( painCave.errMsg, |
426 |
|
|
427 |
|
int& sHash = sHash_[sdat.atid]; |
428 |
|
|
429 |
< |
if ((sHash & EAM_INTERACTION) != 0) eam_->calcFunctional(sdat); |
429 |
> |
if ((sHash & EAM_INTERACTION) != 0) eam_->calcFunctional(sdat); |
430 |
|
if ((sHash & SC_INTERACTION) != 0) sc_->calcFunctional(sdat); |
431 |
|
|
432 |
|
// set<NonBondedInteraction*>::iterator it; |
513 |
|
for (it = interactions_[*atid][*atid].begin(); |
514 |
|
it != interactions_[*atid][*atid].end(); |
515 |
|
++it) |
516 |
< |
cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, atype))); |
516 |
> |
cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, |
517 |
> |
atype))); |
518 |
|
return cutoff; |
519 |
|
} |
520 |
|
|
528 |
|
|
529 |
|
for (it = interactions_[atid][atid].begin(); |
530 |
|
it != interactions_[atid][atid].end(); ++it) |
531 |
< |
cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, atype))); |
531 |
> |
cutoff = max(cutoff, (*it)->getSuggestedCutoffRadius(make_pair(atype, |
532 |
> |
atype))); |
533 |
|
return cutoff; |
534 |
|
} |
535 |
|
} //end namespace OpenMD |