78 |
|
Vector3d EFfrc; |
79 |
|
Vector3d pos; |
80 |
|
RealType chrg; |
81 |
< |
RealType pot, fieldPot, moment; |
81 |
> |
RealType pot, fieldPot; |
82 |
|
RealType chrgToKcal = 23.0609; |
83 |
|
RealType debyeToKcal = 4.8018969509; |
84 |
|
bool isCharge; |
92 |
|
isCharge = false; |
93 |
|
chrg = 0.0; |
94 |
|
|
95 |
+ |
atom->addElectricField(EF * chrgToKcal); |
96 |
+ |
|
97 |
|
FixedChargeAdapter fca = FixedChargeAdapter(atom->getAtomType()); |
98 |
|
if ( fca.isFixedCharge() ) { |
99 |
|
isCharge = true; |
110 |
|
EFfrc = EF*chrg; |
111 |
|
EFfrc *= chrgToKcal; |
112 |
|
atom->addFrc(EFfrc); |
113 |
< |
// totally ad-hoc choice of the origin for potential calculation |
113 |
> |
// ad-hoc choice of the origin for potential calculation |
114 |
|
pos = atom->getPos(); |
115 |
|
pot = -dot(pos, EFfrc); |
116 |
|
if (doParticlePot) { |
121 |
|
|
122 |
|
MultipoleAdapter ma = MultipoleAdapter(atom->getAtomType()); |
123 |
|
if (ma.isDipole() ) { |
124 |
< |
Vector3d u_i = atom->getElectroFrame().getColumn(2); |
125 |
< |
moment = ma.getDipoleMoment(); |
126 |
< |
moment *= debyeToKcal; |
127 |
< |
dip = u_i * moment; |
126 |
< |
trq = cross(dip, EF); |
127 |
< |
//cerr << "dip = " << dip << "\n"; |
128 |
< |
// cerr << "trq = " << trq << "\n"; |
124 |
> |
Vector3d dipole = atom->getDipole(); |
125 |
> |
dipole *= debyeToKcal; |
126 |
> |
|
127 |
> |
trq = cross(dipole, EF); |
128 |
|
atom->addTrq(trq); |
129 |
< |
pot = -dot(dip, EF); |
130 |
< |
//cerr << "pot = " << pot << "\n"; |
129 |
> |
|
130 |
> |
pot = -dot(dipole, EF); |
131 |
|
if (doParticlePot) { |
132 |
|
atom->addParticlePot(pot); |
133 |
|
} |
141 |
|
#endif |
142 |
|
Snapshot* snap = info_->getSnapshotManager()->getCurrentSnapshot(); |
143 |
|
longRangePotential = snap->getLongRangePotentials(); |
145 |
– |
// << "longRangePotential = " << longRangePotential << "\n"; |
144 |
|
longRangePotential[ELECTROSTATIC_FAMILY] += fieldPot; |
147 |
– |
//cerr << "longRangePotential[ELECTROSTATIC_FAMILY] = " << longRangePotential[ELECTROSTATIC_FAMILY] << "\n"; |
145 |
|
snap->setLongRangePotential(longRangePotential); |
146 |
|
} |
147 |
|
} |
151 |
– |
|
148 |
|
} |