--- branches/development/src/perturbations/ElectricField.cpp 2013/02/20 15:39:39 1850 +++ branches/development/src/perturbations/ElectricField.cpp 2013/05/17 14:41:42 1875 @@ -72,20 +72,17 @@ namespace OpenMD { Molecule::AtomIterator j; Molecule* mol; Atom* atom; - AtomType* atype; potVec longRangePotential(0.0); Vector3d dip; Vector3d trq; Vector3d EFfrc; Vector3d pos; - RealType chrg; - RealType pot, fieldPot; - RealType chrgToKcal = 23.0609; - RealType debyeToKcal = 4.8018969509; - bool isCharge; if (doElectricField) { - fieldPot = 0.0; + const RealType chrgToKcal = 23.0609; + const RealType debyeToKcal = 4.8018969509; + RealType pot; + RealType fieldPot = 0.0; for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) { @@ -93,10 +90,10 @@ namespace OpenMD { for (atom = mol->beginAtom(j); atom != NULL; atom = mol->nextAtom(j)) { - isCharge = false; - chrg = 0.0; + bool isCharge = false; + RealType chrg = 0.0; - atype = atom->getAtomType(); + AtomType* atype = atom->getAtomType(); if (atype->isElectrostatic()) { atom->addElectricField(EF * chrgToKcal);