--- trunk/src/restraints/ThermoIntegrationForceManager.cpp 2005/03/10 15:10:24 417 +++ trunk/src/restraints/ThermoIntegrationForceManager.cpp 2005/03/12 19:05:16 437 @@ -42,6 +42,7 @@ #include #include "restraints/ThermoIntegrationForceManager.hpp" #include "integrators/Integrator.hpp" +#include "math/SquareMatrix3.hpp" #include "primitives/Molecule.hpp" #include "utils/simError.h" #include "utils/OOPSEConstant.hpp" @@ -90,7 +91,7 @@ namespace oopse { // build the scaling factor used to modulate the forces and torques factor_ = pow(tIntLambda_, tIntK_); - + } ThermoIntegrationForceManager::~ThermoIntegrationForceManager(){ @@ -105,12 +106,13 @@ namespace oopse { StuntDouble* integrableObject; Vector3d frc; Vector3d trq; + Mat3x3d tempTau; - curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); - // perform the standard calcForces first ForceManager::calcForces(needPotential, needStress); + curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); + // now scale forces and torques of all the integrableObjects for (mol = info_->beginMolecule(mi); mol != NULL; @@ -128,21 +130,26 @@ namespace oopse { integrableObject->setTrq(trq); } } - - // set vraw to be the unmodulated potential - lrPot_ = curSnapshot->statData[Stats::POTENTIAL_ENERGY]; - curSnapshot->statData[Stats::VRAW] = lrPot_; - - // modulate the potential and update the snapshot - lrPot_ *= factor_; - curSnapshot->statData[Stats::POTENTIAL_ENERGY] = lrPot_; } + + // set vraw to be the unmodulated potential + lrPot_ = curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL]; + curSnapshot->statData[Stats::VRAW] = lrPot_; + // modulate the potential and update the snapshot + lrPot_ *= factor_; + curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot_; + + // scale the pressure tensor + tempTau = curSnapshot->statData.getTau(); + tempTau *= factor_; + curSnapshot->statData.setTau(tempTau); + // do crystal restraint forces for thermodynamic integration if (simParam->getUseSolidThermInt()) { lrPot_ += restraint_->Calc_Restraint_Forces(); - curSnapshot->statData[Stats::POTENTIAL_ENERGY] = lrPot_; + curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot_; vHarm_ = restraint_->getVharm(); curSnapshot->statData[Stats::VHARM] = vHarm_;