--- trunk/src/brains/ForceManager.cpp 2005/10/04 19:34:03 645 +++ trunk/src/brains/ForceManager.cpp 2005/10/13 22:26:47 665 @@ -50,6 +50,8 @@ #include "brains/ForceManager.hpp" #include "primitives/Molecule.hpp" #include "UseTheForce/doForces_interface.h" +#define __C +#include "UseTheForce/DarkSide/fInteractionMap.h" #include "utils/simError.h" namespace oopse { @@ -126,13 +128,34 @@ namespace oopse { } - double shortRangePotential = 0.0; + + double bondPotential = 0.0; + double bendPotential = 0.0; + double torsionPotential = 0.0; + for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { - shortRangePotential += mol->getPotential(); - } + for (bond = mol->beginBond(bondIter); bond != NULL; bond = mol->nextBond(bondIter)) { + bondPotential += bond->getPotential(); + } + + for (bend = mol->beginBend(bendIter); bend != NULL; bend = mol->nextBend(bendIter)) { + bendPotential += bend->getPotential(); + } + + for (torsion = mol->beginTorsion(torsionIter); torsion != NULL; torsion = mol->nextTorsion(torsionIter)) { + torsionPotential += torsion->getPotential(); + } + + } + + double shortRangePotential = bondPotential + bendPotential + torsionPotential; Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); curSnapshot->statData[Stats::SHORT_RANGE_POTENTIAL] = shortRangePotential; + curSnapshot->statData[Stats::BOND_POTENTIAL] = bondPotential; + curSnapshot->statData[Stats::BEND_POTENTIAL] = bendPotential; + curSnapshot->statData[Stats::DIHEDRAL_POTENTIAL] = torsionPotential; + } void ForceManager::calcLongRangeInteraction(bool needPotential, bool needStress) { @@ -180,12 +203,20 @@ namespace oopse { } //initialize data before passing to fortran - double longRangePotential = 0.0; + double longRangePotential[LR_POT_TYPES]; + double lrPot = 0.0; + Mat3x3d tau; short int passedCalcPot = needPotential; short int passedCalcStress = needStress; int isError = 0; + for (int i=0; istatData[Stats::LONG_RANGE_POTENTIAL] = longRangePotential; + curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot; + // curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = longRangePotential; curSnapshot->statData.setTau(tau); }