| 35 | 
  | 
 *                                                                       | 
| 36 | 
  | 
 * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).              | 
| 37 | 
  | 
 * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).           | 
| 38 | 
< | 
 * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).           | 
| 38 | 
> | 
 * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).           | 
| 39 | 
  | 
 * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010). | 
| 40 | 
  | 
 * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). | 
| 41 | 
  | 
 */ | 
| 72 | 
  | 
    Molecule::AtomIterator  j; | 
| 73 | 
  | 
    Molecule* mol; | 
| 74 | 
  | 
    Atom* atom; | 
| 75 | 
– | 
    AtomType* atype; | 
| 75 | 
  | 
    potVec longRangePotential(0.0); | 
| 76 | 
  | 
    Vector3d dip; | 
| 77 | 
  | 
    Vector3d trq; | 
| 78 | 
  | 
    Vector3d EFfrc;                              | 
| 79 | 
  | 
    Vector3d pos; | 
| 81 | 
– | 
    RealType chrg; | 
| 82 | 
– | 
    RealType pot, fieldPot; | 
| 83 | 
– | 
    RealType chrgToKcal = 23.0609; | 
| 84 | 
– | 
    RealType debyeToKcal = 4.8018969509; | 
| 85 | 
– | 
    bool isCharge; | 
| 80 | 
  | 
 | 
| 81 | 
  | 
    if (doElectricField) { | 
| 82 | 
< | 
      fieldPot = 0.0; | 
| 82 | 
> | 
      const RealType chrgToKcal = 23.0609; | 
| 83 | 
> | 
      const RealType debyeToKcal = 4.8018969509; | 
| 84 | 
> | 
      RealType pot; | 
| 85 | 
> | 
      RealType fieldPot = 0.0; | 
| 86 | 
  | 
 | 
| 87 | 
  | 
      for (mol = info_->beginMolecule(i); mol != NULL;  | 
| 88 | 
  | 
           mol = info_->nextMolecule(i)) {       | 
| 90 | 
  | 
        for (atom = mol->beginAtom(j); atom != NULL; | 
| 91 | 
  | 
             atom = mol->nextAtom(j)) { | 
| 92 | 
  | 
 | 
| 93 | 
< | 
          isCharge = false; | 
| 94 | 
< | 
          chrg = 0.0; | 
| 93 | 
> | 
          bool isCharge = false; | 
| 94 | 
> | 
          RealType chrg = 0.0; | 
| 95 | 
  | 
           | 
| 96 | 
< | 
          atype = atom->getAtomType(); | 
| 96 | 
> | 
          AtomType* atype = atom->getAtomType(); | 
| 97 | 
  | 
           | 
| 98 | 
  | 
          if (atype->isElectrostatic()) { | 
| 99 | 
  | 
            atom->addElectricField(EF * chrgToKcal); |