| 72 |
|
Molecule::AtomIterator j; |
| 73 |
|
Molecule* mol; |
| 74 |
|
Atom* atom; |
| 75 |
+ |
AtomType* atype; |
| 76 |
|
potVec longRangePotential(0.0); |
| 77 |
|
Vector3d dip; |
| 78 |
|
Vector3d trq; |
| 79 |
|
Vector3d EFfrc; |
| 80 |
|
Vector3d pos; |
| 81 |
|
RealType chrg; |
| 82 |
< |
RealType pot, fieldPot, moment; |
| 82 |
> |
RealType pot, fieldPot; |
| 83 |
|
RealType chrgToKcal = 23.0609; |
| 84 |
|
RealType debyeToKcal = 4.8018969509; |
| 85 |
|
bool isCharge; |
| 87 |
|
if (doElectricField) { |
| 88 |
|
fieldPot = 0.0; |
| 89 |
|
|
| 90 |
< |
for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) { |
| 90 |
> |
for (mol = info_->beginMolecule(i); mol != NULL; |
| 91 |
> |
mol = info_->nextMolecule(i)) { |
| 92 |
> |
|
| 93 |
|
for (atom = mol->beginAtom(j); atom != NULL; |
| 94 |
|
atom = mol->nextAtom(j)) { |
| 95 |
+ |
|
| 96 |
|
isCharge = false; |
| 97 |
|
chrg = 0.0; |
| 98 |
< |
|
| 99 |
< |
FixedChargeAdapter fca = FixedChargeAdapter(atom->getAtomType()); |
| 98 |
> |
|
| 99 |
> |
atype = atom->getAtomType(); |
| 100 |
> |
|
| 101 |
> |
if (atype->isElectrostatic()) { |
| 102 |
> |
atom->addElectricField(EF * chrgToKcal); |
| 103 |
> |
} |
| 104 |
> |
|
| 105 |
> |
FixedChargeAdapter fca = FixedChargeAdapter(atype); |
| 106 |
|
if ( fca.isFixedCharge() ) { |
| 107 |
|
isCharge = true; |
| 108 |
|
chrg = fca.getCharge(); |
| 109 |
|
} |
| 110 |
|
|
| 111 |
< |
FluctuatingChargeAdapter fqa = FluctuatingChargeAdapter(atom->getAtomType()); |
| 111 |
> |
FluctuatingChargeAdapter fqa = FluctuatingChargeAdapter(atype); |
| 112 |
|
if ( fqa.isFluctuatingCharge() ) { |
| 113 |
|
isCharge = true; |
| 114 |
|
chrg += atom->getFlucQPos(); |
| 127 |
|
fieldPot += pot; |
| 128 |
|
} |
| 129 |
|
|
| 130 |
< |
MultipoleAdapter ma = MultipoleAdapter(atom->getAtomType()); |
| 130 |
> |
MultipoleAdapter ma = MultipoleAdapter(atype); |
| 131 |
|
if (ma.isDipole() ) { |
| 132 |
|
Vector3d dipole = atom->getDipole(); |
| 133 |
|
dipole *= debyeToKcal; |
| 153 |
|
snap->setLongRangePotential(longRangePotential); |
| 154 |
|
} |
| 155 |
|
} |
| 146 |
– |
|
| 156 |
|
} |