108 |
|
EFfrc = EF*chrg; |
109 |
|
EFfrc *= chrgToKcal; |
110 |
|
atom->addFrc(EFfrc); |
111 |
< |
// totally ad-hoc choice of the origin for potential calculation |
111 |
> |
// ad-hoc choice of the origin for potential calculation |
112 |
|
pos = atom->getPos(); |
113 |
|
pot = -dot(pos, EFfrc); |
114 |
|
if (doParticlePot) { |
119 |
|
|
120 |
|
MultipoleAdapter ma = MultipoleAdapter(atom->getAtomType()); |
121 |
|
if (ma.isDipole() ) { |
122 |
< |
Vector3d u_i = atom->getElectroFrame().getColumn(2); |
123 |
< |
moment = ma.getDipoleMoment(); |
124 |
< |
moment *= debyeToKcal; |
125 |
< |
dip = u_i * moment; |
126 |
< |
trq = cross(dip, EF); |
127 |
< |
//cerr << "dip = " << dip << "\n"; |
128 |
< |
// cerr << "trq = " << trq << "\n"; |
122 |
> |
Vector3d dipole = atom->getDipole(); |
123 |
> |
dipole *= debyeToKcal; |
124 |
> |
|
125 |
> |
trq = cross(dipole, EF); |
126 |
|
atom->addTrq(trq); |
127 |
< |
pot = -dot(dip, EF); |
128 |
< |
//cerr << "pot = " << pot << "\n"; |
127 |
> |
|
128 |
> |
pot = -dot(dipole, EF); |
129 |
|
if (doParticlePot) { |
130 |
|
atom->addParticlePot(pot); |
131 |
|
} |
139 |
|
#endif |
140 |
|
Snapshot* snap = info_->getSnapshotManager()->getCurrentSnapshot(); |
141 |
|
longRangePotential = snap->getLongRangePotentials(); |
145 |
– |
// << "longRangePotential = " << longRangePotential << "\n"; |
142 |
|
longRangePotential[ELECTROSTATIC_FAMILY] += fieldPot; |
147 |
– |
//cerr << "longRangePotential[ELECTROSTATIC_FAMILY] = " << longRangePotential[ELECTROSTATIC_FAMILY] << "\n"; |
143 |
|
snap->setLongRangePotential(longRangePotential); |
144 |
|
} |
145 |
|
} |