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

Comparing trunk/src/perturbations/ElectricField.cpp (file contents):
Revision 1907 by gezelter, Sun Jun 16 15:15:42 2013 UTC vs.
Revision 1908 by gezelter, Fri Jul 19 21:25:45 2013 UTC

# Line 94 | Line 94 | namespace OpenMD {
94            RealType chrg = 0.0;
95            
96            AtomType* atype = atom->getAtomType();
97 +
98 +          // ad-hoc choice of the origin for potential calculation and
99 +          // fluctuating charge force:
100 +          pos = atom->getPos();
101            
102            if (atype->isElectrostatic()) {
103              atom->addElectricField(EF * chrgToKcal);
# Line 109 | Line 113 | namespace OpenMD {
113            if ( fqa.isFluctuatingCharge() ) {
114              isCharge = true;
115              chrg += atom->getFlucQPos();
116 +            atom->addFlucQFrc( dot(pos,EF) * chrgToKcal );
117            }
118            
119            if (isCharge) {
120              EFfrc = EF*chrg;
121              EFfrc *= chrgToKcal;
122              atom->addFrc(EFfrc);
118            // ad-hoc choice of the origin for potential calculation
119            pos = atom->getPos();
123              pot = -dot(pos, EFfrc);
124              if (doParticlePot) {      
125                atom->addParticlePot(pot);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines