ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/perturbations/ElectricField.cpp
(Generate patch)

Comparing branches/development/src/perturbations/ElectricField.cpp (file contents):
Revision 1786 by jmarr, Mon Aug 20 18:28:22 2012 UTC vs.
Revision 1787 by gezelter, Wed Aug 29 18:13:11 2012 UTC

# Line 108 | Line 108 | namespace OpenMD {
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) {      
# Line 119 | Line 119 | namespace OpenMD {
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              }
# Line 142 | Line 139 | namespace OpenMD {
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    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines