| 128 |  |  | 
| 129 |  | } | 
| 130 |  |  | 
| 131 | < | double  shortRangePotential = 0.0; | 
| 131 | > |  | 
| 132 | > | double bondPotential = 0.0; | 
| 133 | > | double bendPotential = 0.0; | 
| 134 | > | double torsionPotential = 0.0; | 
| 135 | > |  | 
| 136 |  | for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { | 
| 133 | – | shortRangePotential += mol->getPotential(); | 
| 134 | – | } | 
| 137 |  |  | 
| 138 | + | for (bond = mol->beginBond(bondIter); bond != NULL; bond = mol->nextBond(bondIter)) { | 
| 139 | + | bondPotential += bond->getPotential(); | 
| 140 | + | } | 
| 141 | + |  | 
| 142 | + | for (bend = mol->beginBend(bendIter); bend != NULL; bend = mol->nextBend(bendIter)) { | 
| 143 | + | bendPotential += bend->getPotential(); | 
| 144 | + | } | 
| 145 | + |  | 
| 146 | + | for (torsion = mol->beginTorsion(torsionIter); torsion != NULL; torsion = mol->nextTorsion(torsionIter)) { | 
| 147 | + | torsionPotential += torsion->getPotential(); | 
| 148 | + | } | 
| 149 | + |  | 
| 150 | + | } | 
| 151 | + |  | 
| 152 | + | double  shortRangePotential = bondPotential + bendPotential + torsionPotential; | 
| 153 |  | Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); | 
| 154 |  | curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] = shortRangePotential; | 
| 155 | + | curSnapshot->statData[Stats::BOND_POTENTIAL] = bondPotential; | 
| 156 | + | curSnapshot->statData[Stats::BEND_POTENTIAL] = bendPotential; | 
| 157 | + | curSnapshot->statData[Stats::DIHEDRAL_POTENTIAL] = torsionPotential; | 
| 158 | + |  | 
| 159 |  | } | 
| 160 |  |  | 
| 161 |  | void ForceManager::calcLongRangeInteraction(bool needPotential, bool needStress) { |