42 |
|
#include <cmath> |
43 |
|
#include "restraints/ThermoIntegrationForceManager.hpp" |
44 |
|
#include "integrators/Integrator.hpp" |
45 |
+ |
#include "math/SquareMatrix3.hpp" |
46 |
|
#include "primitives/Molecule.hpp" |
47 |
|
#include "utils/simError.h" |
48 |
|
#include "utils/OOPSEConstant.hpp" |
92 |
|
// build the scaling factor used to modulate the forces and torques |
93 |
|
factor_ = pow(tIntLambda_, tIntK_); |
94 |
|
|
94 |
– |
printf("%f is the factor\n",factor_); |
95 |
– |
|
95 |
|
} |
96 |
|
|
97 |
|
ThermoIntegrationForceManager::~ThermoIntegrationForceManager(){ |
106 |
|
StuntDouble* integrableObject; |
107 |
|
Vector3d frc; |
108 |
|
Vector3d trq; |
109 |
+ |
Mat3x3d tempTau; |
110 |
|
|
111 |
|
// perform the standard calcForces first |
112 |
|
ForceManager::calcForces(needPotential, needStress); |
130 |
|
integrableObject->setTrq(trq); |
131 |
|
} |
132 |
|
} |
133 |
– |
|
134 |
– |
// set vraw to be the unmodulated potential |
135 |
– |
lrPot_ = curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL]; |
136 |
– |
curSnapshot->statData[Stats::VRAW] = lrPot_; |
137 |
– |
|
138 |
– |
// modulate the potential and update the snapshot |
139 |
– |
lrPot_ *= factor_; |
140 |
– |
curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot_; |
133 |
|
} |
134 |
+ |
|
135 |
+ |
// set vraw to be the unmodulated potential |
136 |
+ |
lrPot_ = curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL]; |
137 |
+ |
curSnapshot->statData[Stats::VRAW] = lrPot_; |
138 |
|
|
139 |
+ |
// modulate the potential and update the snapshot |
140 |
+ |
lrPot_ *= factor_; |
141 |
+ |
curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot_; |
142 |
+ |
|
143 |
+ |
// scale the pressure tensor |
144 |
+ |
tempTau = curSnapshot->statData.getTau(); |
145 |
+ |
tempTau *= factor_; |
146 |
+ |
curSnapshot->statData.setTau(tempTau); |
147 |
+ |
|
148 |
|
// do crystal restraint forces for thermodynamic integration |
149 |
|
if (simParam->getUseSolidThermInt()) { |
150 |
|
|