ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/integrators/NVT.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-4/src/integrators/NVT.cpp (file contents):
Revision 1837 by tim, Thu Dec 2 22:15:31 2004 UTC vs.
Revision 1852 by tim, Sun Dec 5 17:09:27 2004 UTC

# Line 10 | Line 10 | NVT::NVT(SimInfo* info) : VelocityVerletIntegrator(inf
10  
11   NVT::NVT(SimInfo* info) : VelocityVerletIntegrator(info), chiTolerance_ (1e-6) {
12  
13 <    Globals* globals = info_->getGlobals();
13 >    Globals* simParams = info_->getSimParams();
14  
15 <    if (globals->getUseInitXSstate()) {
15 >    if (simParams->getUseInitXSstate()) {
16          Snapshot* currSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
17          currSnapshot->setChi(0.0);
18          currSnapshot->setIntegralOfChiDt(0.0);
19      }
20      
21 <    if (!globals->haveTargetTemp()) {
21 >    if (!simParams->haveTargetTemp()) {
22          sprintf(painCave.errMsg, "You can't use the NVT integrator without a targetTemp_!\n");
23          painCave.isFatal = 1;
24          painCave.severity = OOPSE_ERROR;
25          simError();
26      } else {
27 <        targetTemp_ = globals->getTargetTemp();
27 >        targetTemp_ = simParams->getTargetTemp();
28      }
29  
30      // We must set tauThermostat_.
31  
32 <    if (!globals->haveTauThermostat()) {
32 >    if (!simParams->haveTauThermostat()) {
33          sprintf(painCave.errMsg, "If you use the constant temperature\n"
34                                       "\tintegrator, you must set tauThermostat_.\n");
35  
# Line 37 | Line 37 | NVT::NVT(SimInfo* info) : VelocityVerletIntegrator(inf
37          painCave.isFatal = 1;
38          simError();
39      } else {
40 <        tauThermostat_ = globals->getTauThermostat();
40 >        tauThermostat_ = simParams->getTauThermostat();
41      }
42  
43      update();
# Line 79 | Line 79 | void NVT::moveA() {
79  
80          // velocity half step  (use chi from previous step here):
81          //vel[j] += dt2 * ((frc[j] / mass ) * OOPSEConstant::energyConvert - vel[j]*chi);
82 <        vel = dt2 *OOPSEConstant::energyConvert/mass*frc - dt2*chi*vel;
82 >        vel += dt2 *OOPSEConstant::energyConvert/mass*frc - dt2*chi*vel;
83          
84          // position whole step
85          //pos[j] += dt * vel[j];
# Line 193 | Line 193 | void NVT::moveB() {
193  
194                      integrableObject->setJ(ji);
195                  }
196 +
197 +
198 +                ++index;
199              }
200          }
201      
# Line 202 | Line 205 | void NVT::moveB() {
205          if (fabs(prevChi - chi) <= chiTolerance_)
206              break;
207  
205        ++index;
208      }
209  
210      integralOfChidt += dt2 * chi;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines