44 |
|
#include "utils/simError.h" |
45 |
|
namespace oopse { |
46 |
|
Integrator::Integrator(SimInfo* info) |
47 |
< |
: info_(info), forceMan_(NULL) , needPotential(false), needStress(false), needReset(false), velocitizer_(NULL), |
48 |
< |
needVelocityScaling(false), dumpWriter(NULL), statWriter(NULL), thermo(info), |
47 |
> |
: info_(info), forceMan_(NULL) , needPotential(false), needStress(false), |
48 |
> |
needReset(false), velocitizer_(NULL), needVelocityScaling(false), |
49 |
> |
rnemd_(NULL), useRNEMD(false), |
50 |
> |
dumpWriter(NULL), statWriter(NULL), thermo(info), |
51 |
|
currentSnapshot_(info->getSnapshotManager()->getCurrentSnapshot()) { |
52 |
|
|
53 |
|
simParams = info->getSimParams(); |
96 |
|
needReset = true; |
97 |
|
resetTime = simParams->getResetTime(); |
98 |
|
} |
99 |
+ |
|
100 |
+ |
|
101 |
+ |
if (simParams->haveUseRNEMD()) { |
102 |
+ |
if (simParams->getUseRNEMD()) { |
103 |
+ |
useRNEMD = simParams->getUseRNEMD(); |
104 |
+ |
if (simParams->haveRNEMD_swapTime()) { |
105 |
+ |
RNEMD_swapTime = simParams->getRNEMD_swapTime(); |
106 |
+ |
} |
107 |
+ |
} |
108 |
+ |
} |
109 |
|
|
110 |
< |
//create a default ForceManager |
111 |
< |
//if the subclass wants to use a different ForceManager, use setForceManager |
110 |
> |
// Create a default ForceManager: If the subclass wants to use |
111 |
> |
// a different ForceManager, use setForceManager |
112 |
|
forceMan_ = new ForceManager(info); |
113 |
|
|
102 |
– |
//set the force manager for thermodynamic integration if specified |
103 |
– |
if (simParams->getUseSolidThermInt() || simParams->getUseLiquidThermInt()){ |
104 |
– |
ThermoIntegrationForceManager* thermoForce_ |
105 |
– |
= new ThermoIntegrationForceManager(info); |
106 |
– |
setForceManager(thermoForce_); |
107 |
– |
} |
108 |
– |
|
114 |
|
// check for the temperature set flag (velocity scaling) |
115 |
|
if (simParams->haveTempSet()) { |
116 |
|
needVelocityScaling = simParams->getTempSet(); |
127 |
|
} |
128 |
|
} |
129 |
|
|
130 |
< |
//create a default a velocitizer |
131 |
< |
//if the subclass want to using different velocitizer, use setVelocitizer |
130 |
> |
// Create a default a velocitizer: If the subclass wants to use |
131 |
> |
// a different velocitizer, use setVelocitizer |
132 |
|
velocitizer_ = new Velocitizer(info); |
133 |
+ |
// Create a default a RNEMD. |
134 |
+ |
rnemd_ = new RNEMD(info); |
135 |
|
|
136 |
|
} |
137 |
|
|
138 |
|
Integrator::~Integrator(){ |
139 |
|
delete forceMan_; |
140 |
|
delete velocitizer_; |
141 |
+ |
delete rnemd_; |
142 |
|
|
143 |
|
delete dumpWriter; |
144 |
|
delete statWriter; |