--- branches/development/src/perturbations/ElectricField.cpp 2013/01/30 14:43:08 1844 +++ branches/development/src/perturbations/ElectricField.cpp 2013/05/15 15:09:35 1874 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -72,7 +72,6 @@ namespace OpenMD { Molecule::AtomIterator j; Molecule* mol; Atom* atom; - AtomType* atype; potVec longRangePotential(0.0); Vector3d dip; Vector3d trq; @@ -82,8 +81,8 @@ namespace OpenMD { RealType pot, fieldPot; RealType chrgToKcal = 23.0609; RealType debyeToKcal = 4.8018969509; - bool isCharge; + if (doElectricField) { fieldPot = 0.0; @@ -93,10 +92,10 @@ namespace OpenMD { for (atom = mol->beginAtom(j); atom != NULL; atom = mol->nextAtom(j)) { - isCharge = false; + bool isCharge = false; chrg = 0.0; - atype = atom->getAtomType(); + AtomType* atype = atom->getAtomType(); if (atype->isElectrostatic()) { atom->addElectricField(EF * chrgToKcal);